Skip to content

Replace recommonmark with myst-parser - #136

Merged
JulianGro merged 2 commits into
vircadia:masterfrom
JulianGro:myst
Apr 19, 2021
Merged

JulianGro merged 2 commits into
vircadia:masterfrom
JulianGro:myst

Conversation

@JulianGro

@JulianGro JulianGro commented Apr 17, 2021 •

Copy link
Copy Markdown
Contributor

This replaces the recommonmark markdown parser with myst-parser.
recommonmark is badly supported and will likely be deprecated at the end of this month.

Fixes #128
While it does fix links being parsed incorrectly for translation, the new strings will still contain the wrong translation and only be marked as "fuzzy" indicating that the translation needs to be updated. Translation tools like Weblate will see this fuzzy indicator and mark the translation as outdated and needing attention.

Another concern is that the switch to myst-parser adds 108 new warnings. These warnings are all of the same type and are all valid.
Example:

docs/source/release-notes/2021-1-1-Eos.md:9: WARNING: Non-consecutive header level increase; 2 to 4 [myst.header]

The warning indicated that the level 2 heading (In this example ## Interface (Codename Athena)) is followed by a level 2 heading (In this example #### General). To do this doesn't really make any sense and may break browser accessibility tools.
Recommonmark didn't throw a warning, but also didn't abide to the specified levels. In this example it just parsed the level 4 #### General heading as a level 3 heading. GitHub on the other hand does exactly what we say and parses it as a level 4 heading.
I assume this was done from a design perspective. Personally I like the smaller section headers more, but that should be changed in the theme and not by resorting to potentially incompatible/illegal behaviour in every markdown file.

A preview is available here: https://data.moto9000.moe/sphinx/PR136/ ( 2d37f9a )
The dependency has been installed on Weblate, so it will be able to immediately update the translation files.

@JulianGro JulianGro added the needs review Check proper display, understandability, grammar and spelling label Apr 17, 2021
@JulianGro
JulianGro marked this pull request as ready for review April 17, 2021 10:22

@digisomni digisomni left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work alright on Windows. (checked the Linux server documentation)

@digisomni

Copy link
Copy Markdown
Member

With regards to the issues on header levels, I take it that it's generally expected that MD should incrementally increase the header number instead of making jumps?

@digisomni digisomni mentioned this pull request Apr 19, 2021
@JulianGro

Copy link
Copy Markdown
Contributor Author

With regards to the issues on header levels, I take it that it's generally expected that MD should incrementally increase the header number instead of making jumps?

Rather than on markdown, that is pretty much expected for all kinds of documents. I don't think it is defined in any real standard, but I have seen linters which will not accept markdown with non-consecutive header levels. It also just doesn't make much sense from a logical perspective. It also doesn't work with both recommonmark or myst-parser, so even if we wanted to do it for aesthetic reasons or whatever, we can't easily do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sphinx breaks things by trying to translate them automatically

2 participants