How to turn on heading numbering ? #951
-
Hello, I am building a project with Sphinx and myst_parser. Looking into the documentation of MyST Markdown, I saw this is possible to have numbering headers: https://mystmd.org/guide/cross-references But including this in my file.md and compiling with the classic Do I miss something ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
I'm not 100% sure, but it sounds like you are using Sphinx+Myst, which is different than mystmd. If that is the case, the documentation is here: https://myst-parser.readthedocs.io/en/latest/syntax/organising_content.html Look for the toctree option
Your index.md might look like:
Html output might format like:
In this case, make sure to do a |
Beta Was this translation helpful? Give feedback.
-
One way to do it is to put the desired link text inside the brackets
Reference doc: |
Beta Was this translation helpful? Give feedback.
-
With this option, I'm 99% sure the answer is "yes". Manual. Yuck. 😉 Maybe... I see in Mystmd they have number references and substitution, The myst-sphinx documentation says,
In addition to Question Additional Link Update I got it to work! 😄 I didn't have to add anything to conf.py. I created the explicit targets: And to use it: Anyone doing this with Sphinx-MyST? Did I get it right? Any suggestions for OP. |
Beta Was this translation helpful? Give feedback.
With this option, I'm 99% sure the answer is "yes".
Manual. Yuck. 😉
Maybe...
I see in Mystmd they have number references and substitution,
%s
or{number}
.The myst-sphinx documentation says,
In addition to
{ref}
, I see that sphinx also has a{numref}
. There is more doc at readthedocs for the numref role. There is one reference tonumref
in the MyST documentation.Question
The question becomes, will the
numref
role work in Sphinx+MyST for section/heading numbering?Addi…