-
Notifications
You must be signed in to change notification settings - Fork 196
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
include directive: start from alternative heading level #262
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
thanks, I'll have to think about this one, perhaps as part of the |
Maybe as a first step we can figure out what warning class is raised here so that you could use the suppress warnings config that you mentioned. Surely somebody else in the Sphinx world has had the same problem before? Maybe there’s a stackoverflow question about this or something? |
No this warning arises directly from MyST-Parser: MyST-Parser/myst_parser/docutils_renderer.py Lines 258 to 266 in 4e02629
correctly, because for example # title
## sub-title # title
### sub-title ## title
### sub-title all are parsed to sphinx AST: <section>
<section> which will then be always rendered as # title
## sub-title so it is not possible to conserve the original levels, if they are not consecutive and starting from 1
|
With #313, this warning can now be suppressed. I will leave this issue open though, as for |
Thanks a lot for picking this up. Being able to suppress warnings does the job for the moment. Your suggestion sounds even nicer. |
Sounds like a great idea but I'm a bit concerned about the inconsistency with the Sphinx-native directive settings. I think if this is to be implemented, maybe there should be a PR submitted to the Sphinx upstream simultaneously so that it's consistent between RST and MD. |
Myst's
Others are welcome to try, but I have rarely found much join in trying to upstream changes like this |
Thanks for the great project. I perfectly fits the use case I have, with one minor issue.
TL;DR: Is it possible to fix or ignore non-consecutive header levels?
For a group of related projects, I want the contributors to write all the documentation in a single README.md.
From the README and the docstrings, I generate the online docs with Sphinx and MyST.
I want the sections of the README to end up in separate documents of my generated docs.
The
docs/
directory is populated with generic stub files that are generated by a cookiecutter.The README always has the same sections (second level):
From this, I generate separate pages (e.g. changelog.md):
My index.md:
What was a level 2 heading now should be a level 1 heading in the split documents.
When building the docs, MyST emits the warning
Non-consecutive header level increase
because of this. The warning is correct and intended, see #71, but is there any way around this? I want to treat Sphinx warnings as errors, because it has proven very helpful in the past.Possible solutions:
The text was updated successfully, but these errors were encountered: