Skip to content

add 404 page to docs #5057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 11, 2021
Merged

add 404 page to docs #5057

merged 6 commits into from
Oct 11, 2021

Conversation

OriolAbril
Copy link
Member

This should add a 404 page to the documentation so when users follow a non existing link
within the docs.pymc.io domain they'll go to this page instead of the rtd maze page.

Follows what I did for ArviZ, if you go to a non existing page like https://arviz-devs.github.io/arviz/generated/arviz.plot_autocorr.html
you see a somewhat informative page.

@OriolAbril
Copy link
Member Author

You can preview the 404 page from any wrong url with the base corresponding to this PR, for example https://pymc--5057.org.readthedocs.build/en/5057/api/inexistent.html

@codecov
Copy link

codecov bot commented Oct 8, 2021

Codecov Report

Merging #5057 (9d23f52) into main (328a8eb) will increase coverage by 0.10%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5057      +/-   ##
==========================================
+ Coverage   78.29%   78.40%   +0.10%     
==========================================
  Files         129      130       +1     
  Lines       24396    24464      +68     
==========================================
+ Hits        19102    19182      +80     
+ Misses       5294     5282      -12     
Impacted Files Coverage Δ
pymc/step_methods/hmc/base_hmc.py 90.32% <0.00%> (-0.81%) ⬇️
pymc/tests/test_distributions.py 96.27% <0.00%> (-0.08%) ⬇️
pymc/tests/test_bart.py 100.00% <0.00%> (ø)
pymc/tests/test_sampling.py 97.29% <0.00%> (ø)
pymc/step_methods/__init__.py 100.00% <0.00%> (ø)
pymc/distributions/__init__.py 100.00% <0.00%> (ø)
pymc/step_methods/pgbart.py
pymc/distributions/tree.py
pymc/distributions/bart.py
pymc/bart/__init__.py 100.00% <0.00%> (ø)
... and 10 more

@twiecki
Copy link
Member

twiecki commented Oct 8, 2021

/pre-commit-run

@twiecki
Copy link
Member

twiecki commented Oct 8, 2021

This is great. I'm wondering if we could also redirect any links to e.g. docs.pymc.io/notebook to docs.pymc.io/en-stable/notebook? This way all our links will continue to work.

@twiecki
Copy link
Member

twiecki commented Oct 8, 2021

I think we should first try to auto-direct actually, a lot of those links will never be updated (e.g. if they are in a book) and still keeping them working is pretty easy by just redirecting to stable.

@OriolAbril
Copy link
Member Author

I'm wondering if we could also redirect any links to e.g. docs.pymc.io/notebook to docs.pymc.io/en-stable/notebook? This way all our links will continue to work.
I think we should first try to auto-direct actually, a lot of those links will never be updated (e.g. if they are in a book) and still keeping them working is pretty easy by just redirecting to stable.

redirecting would be great too, both options should be perfectly compatible with one another, and the 404 page will probably be quite useful with the 4.0 release because there the change won't only be this language plus version extension to the url, most pages will be reorganized or renamed. We will also use sphinx-design in v4 docs which is the pip only dependency that is somehow breaking pre-commit so this is also something that needs to be adressed at some point, why not now to get this page up.

I have no idea if this redirection is possible nor how to do it, and I can't look into it either in the near-mid future either. We should probably open an issue for that or even ask for help on twitter. The only comment regarding the redirection is that it should not add /en/stable/ because we'll again all the links with the 4.0 release, nor stable nor latest are permanent links, they change where they point to with our releases. As we want these links to work and be somewhat frozen, they should redirect to /en/v3.11.4 instead.

@twiecki
Copy link
Member

twiecki commented Oct 8, 2021

OK this turned out to be trivial: https://docs.readthedocs.io/en/stable/user-defined-redirects.html should work now.

@twiecki
Copy link
Member

twiecki commented Oct 8, 2021

- hook id: conda-env-sort
68
- exit code: 1
69

70
Traceback (most recent call last):
71
  File "/home/runner/work/pymc/pymc/scripts/sort_conda_envs.py", line 19, in <module>
72
    doc["dependencies"].sort()
73
TypeError: '<' not supported between instances of 'dict' and 'str'
74

75
Generate pip dependency from conda.......................................Passed
76
No relative imports......................................................Passed
77
Error: The process '/opt/hostedtoolcache/Python/3.9.7/x64/bin/pre-commit' failed with exit code 1
Post Run actions/checkout@v2

@OriolAbril
Copy link
Member Author

@Sayam753 @michaelosthege @MarcoGorelli maybe, ideas on how to fix pre-commit?

@michaelosthege
Copy link
Member

@OriolAbril I'm not familiar with yaml but it looks like you'll have to go in manually (maybe with an interactive debugger) and replace the sorting with something that recursively sorts hierarchies too.
https://github.com/pymc-devs/pymc/blob/main/scripts/sort_conda_envs.py

@MarcoGorelli
Copy link
Contributor

Can you try using the conda env sorter from https://github.com/MarcoGorelli/madforhooks ? IIRC it handles this - else I'll take a look next week

@Sayam753
Copy link
Member

The failing pre-commit hooks changed the files in place. So, @OriolAbril to fix them all -

pre-commit run --all-files

And push?

@OriolAbril
Copy link
Member Author

OriolAbril commented Oct 10, 2021

I will try that, but the environments and requirement checks are broken or didn't work from the start. I also did some clean-up in #5060 and not only the version requirements were different on different files, but also nbsphinx was listed as requirement in some places but not everywhere. Or it doesn't run in all cases where one of the modified files is changed

@twiecki twiecki merged commit 33dd132 into main Oct 11, 2021
@twiecki
Copy link
Member

twiecki commented Oct 11, 2021

Thanks @OriolAbril!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants