-
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
Issues with sphinx Locale
transform (assumes rST)
#302
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
cc @choldgraf |
can you provide a minimal working of example of a file that causes this. (it may be related to #262) |
also does this only happen for a translated document? |
system_message
node
Yes, it only happens for a translated document. I'll try to work up an example. As you can see in the screenshot, the warning text is where the Spanish-language header would be otherwise. |
thanks, it looks to me that there is something weird going on with these translated texts, where the heading levels are messed up: For example I don't see why it would think that: https://raw.githubusercontent.com/choldgraf/standard/myst-parser-switch/docs/404.md, has a level 2 (i.e.
Is there a way to view the source text of these special |
Here's a simple example: https://github.com/jpmckinney/myst-parser-tests Instructions to reproduce are at: https://github.com/jpmckinney/myst-parser-tests/blob/master/index.md Thanks for the quick responses! |
Note that, using the code in #303, the heading does appear in Spanish. |
indeed, but that is not addressing the root issue of the heading levels I'll have to leave @choldgraf to look into this for now (perhaps the translation is converting |
So this is actually an upstream bug with the In particular here, for This leads to parsing e.g.: Un título
------------------ to <document source="/Users/chrisjsewell/Documents/GitHub/myst-parser-intl-tests/index.md:6:<translated>">
<system_message level="2" line="1" source="/Users/chrisjsewell/Documents/GitHub/myst-parser-intl-tests/index.md:6:<translated>" type="WARNING">
<paragraph>
Non-consecutive header level increase; 0 to 2
<section ids="un-titulo" names="un\ título">
<title>
Un título then the first node is assumed to be the title => "Non-consecutive header level increase; 0 to 2" becoming the title. translations in literal blocks also look to be an issue, because it pre-converts them from
to
So yeh this requires a "fix" in the sphinx |
system_message
nodeLocale
transform (assumes RST)
Locale
transform (assumes RST)Locale
transform (assumes rST)
Hmm, for my organization's project, we might need to do both, since even if there's a fix for Sphinx, it will only be available in the latest release (whenever that occurs). @choldgraf Will you be having a look? This would be a blocker for using MyST. If we need to temporarily fork Sphinx or MyST-Parser, that's fine. Update: We can use my branch here (which is a PR for Sphinx): https://github.com/jpmckinney/sphinx/tree/markdown-locale-heading-3.x |
I created sphinx-doc/sphinx#8852, but I assume the issue will only be fixed in Sphinx>=4, which myst-parser doesn't presently support. Update: Nevermind, they're accepting non-breaking PRs for 3.x. |
Sphinx merged by PR in its 3.x branch to fix the heading level jump: sphinx-doc/sphinx#8853 The maintainer suggests an approach in sphinx-doc/sphinx#8852. I think we can close the issue here, since it's a problem with upstream. |
ah sounds great - thanks for the update @jpmckinney |
I wouldn't close |
Documentation repository: open-contracting/standard#1197
To reproduce:
The text was updated successfully, but these errors were encountered: