In my jupyter-book, I want to reference a section header in the same document using the syntax below:
I want to refer to [section](intro.md#how-to-learn-python]
where intro.md is your current markdown file, and how-to-learn-python is a section inside this document.
I read that MyST-Parser has Auto-generated header anchors which allow me to do so using the above method. But after I placed my configuration into _config.yml:
parse:
myst_heading_anchors: 3
It still did not work. Currently, the jupyter-book tutorial requires me to create a tag manually for each section header, which consumes a lot of time.
Other references:
I had the same issue and found the reason to be that the jupyter-book config module , which generates the Sphinx configuration, does not include
myst_heading_anchors.So far, I've only managed to enable the feature by manually adding the entry toget_default_sphinx_configin jupyter-book'sconfig.py. This is obviously not a clean or permanent solution, but at least a first step towards a solution. A better solution would be to somehow communicate the directive via the_config.ymlconfig file.You can add the configuration directive to the generated config by adding
to your
_config.yml.