open-contracting/standard_profile_template

Switch to MyST Parser

Closed this issue · 4 comments

We're currently using my fork of recommonmark and a specific commit of commonmark.py (until > 0.9.1 is released), because the released versions don't work with Sphinx.

https://myst-parser.readthedocs.io/en/latest/index.html was built in 2020, and seems to work. It uses https://pypi.org/project/markdown-it-py/ instead of commonmark.py. We can see if anyone has written about their switch.

Follow-up: Switch from recommonmark to MyST-Parser in:

Steps from open-contracting/standard#1213

  • requirements
    • Remove commonmark and recommonmark dependencies
    • Use Sphinx >= 3.5.2
    • Add myst-parser and mdit-py-plugins
  • conf.py
    • Remove recommonmark
    • Add myst_parser extension
    • Set myst_enable_extensions = []
  • Markdown

Done for:

  • standard (need to upgrade MyST-Parser)
  • standard_profile_template
  • infrastructure open-contracting/infrastructure#302
  • european-union
  • government-procurement-agreement
  • public-private-partnerships (switch RST to Markdown tables)

Should also fix links to headings. Our options:

General process, matchind *.md files:

  1. Check no unusual link formats: \] +\(
  2. Check no fragments with non-/-terminated paths: \]+\((?!http)\S+[^/]#
  3. Perform substitution: \]+\((?!http)\.\./(\S+)/# for ]($1.md#
  4. Build docs and fix warnings

Done for:

  • standard
  • standard_profile_template
  • infrastructure open-contracting/infrastructure#302
  • european-union
  • government-procurement-agreement
  • public-private-partnerships (skipped: uses too many anchors in tables like #release-schema.json,,contracts/0/agreedMetrics)

All done!