getnikola / plugins

Extra plugins for Nikola
https://plugins.getnikola.com/
MIT License
56 stars 92 forks source link

Make the myst plugin compatible with myst-parser > 0.17.2 #429

Closed lorenzo-rovigatti closed 1 year ago

lorenzo-rovigatti commented 1 year ago

As discussed in #428 , the myst plugin is not compatible with myst-parser > 0.17.2 (which is already more than one year old). The patch contained in this PR keeps the plugin backward compatible with older myst-parser versions, but also supports the new versions by using docutils.core's publish_string, as suggested in the docs.

In principle with the publish_string method it is possible to list the myst extensions one wants to enable. Here I am enabling them all but support for mathematical equations (which is handled directly by nikola). I have also decided to suppress warnings related to out-of-order document headings, and to have myst add anchors to headers (i.e. lines starting with one or more #) in order to support internal links.

Kwpolska commented 1 year ago

Looks good; please fix the linter warnings so we can merge.

lorenzo-rovigatti commented 1 year ago

Done (hopefully)!