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
Replace recommonmark with myst_parser and fix changelog rendering #575
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
for more information, see https://pre-commit.ci
WIEEEE thanks @rccern! This is work that have made me stumble in the past. This LGTM from code review and looking at the RTD PR preview. @choldgraf with more experience about docs, does this LGTY also? |
That generally looks good to me, though I think you might need to explicitly enable the anchor auto-generator, as described here: https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#auto-generated-header-anchors |
@choldgraf it seems i can't get it to work...
if I run
but the html shows
Any suggestions? |
I'm not sure what you mean - that output looks correct to me. What is the problem with it? Can you give an example of a page with incorrect behavior? |
this line should be or am i missing something? |
In case you weren't aware readthedocs provides PR builds for testing. E.g. |
thank @manics , I noticed that, but maybe @choldgraf wanted to have https://jupyterhub-kubespawner--575.org.readthedocs.build/en/575/changelog.html#016 point to 0.16 (or did I misunderstand)? otherwise, the PR looks ok to merge |
@rccern I suspect that |
I checked https://html.spec.whatwg.org/multipage/dom.html#global-attributes:the-id-attribute-2 , in particular "There are no other restrictions on what form an ID can take; in particular, IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc.". the v20 tricks works, btw maybe something to check on MyST side? I'll unpin myst version edit: docutils generates 'polyglot html' which means that is also xml, and "Polyglot markup ensures that every id attribute must be unique within the document and must be a legal XML name, starting with a letter." https://www.w3.org/TR/html-polyglot/#id-attribute |
Thanks for that analysis - I opened up a bug to track this here: executablebooks/MyST-Parser#527 |
In the meantime, I think the easiest path forward is to add a letter to the beginning of the headers on this page (as well as in the references to it in the text) |
i think it's up to @consideRatio to choose if they are really needed. I think the current status (https://jupyterhub-kubespawner--575.org.readthedocs.build/en/575/changelog.html#id27) is already an improvement and this PR can be already merged as is |
We should check whether the |
ah I didn't think about that.... then if you want i can add a commit that prepends |
@rccern, @choldgraf, @manics ❤️ 🎉 🌻 thank you so much for your investigative work into resolving this very thoroughly!! I'll leave it to @manics / @choldgraf to merge given the better comprehension of the situation. |
Looks like the Therefore I don't think adding a |
I'd recommend not relying on auto-generated labels, and instead manually specifying them only when you need them. So for example, you can generate labels like: (mylabel)=
## My section
Reference [](mylabel) or [with some text](mylabel). I find that this is less brittle and leads to fewer unexpected surprises anyway, because you specifically define the label rather than compute it from the section title (for example, it won't break if you change a word or letter in the section title). @manics If anybody wants to give a shot at a PR in the issue I linked above, that'd be nice as well :-) |
While this doesn't solve all relevant issues, it is great progress! I'm making a push towards getting a new release out and added a commit to unpin myst_parser and then went for a merge. To resolve failing anchors in our Changelog where we have headings that are numerical, we should work on executablebooks/MyST-Parser#527. |
There are some issues with the docs hosted at https://jupyterhub-kubespawner.readthedocs.io/en/2.0.1/changelog.html , some of which are reported in #527 . I think they are in part due to issues with recommonmark, which has been discontinued in favor of myst-parser (readthedocs/recommonmark#221).
I also bumped the sphinx version to >=4.2 as versions below don't work with python 3.10 (see sphinx-doc/sphinx#9513 )
This PR aims to fix those issues.
PS. the page on RTD still points to 1.1.1 for
latest
, I don't know if that's intendedEDIT 1 by Erik: Closes #527, Closes #555
EDIT 2 by Erik: This doesn't resolve an upstream issue when our anchors are numeric though, but let's track that as part of executablebooks/MyST-Parser#527.