Skip to content

Strategy for optional MyST syntax #5

Open
@hukkin

Description

@hukkin

The current state is that mdformat-myst only supports syntax that is enabled by default in myst-parser. User @ichard26 has voiced the need for optional syntax support (colon fence in particular). The purpose of this issue is to plan how support for optional syntax should be implemented.

I like that there is way to enable default syntax only so we shouldn't simply add optional syntax support the same way we do for non-optionals, as that would prevent installing "myst core" only. So that leaves us with a few options:

  1. Add optional syntax support to this plugin but disable it by default. Add a CLI argument for enabling the optional syntax.
  2. Make a mdformat-myst-extensions (or similar name) plugin that depends on mdformat-myst but adds optionals on top.
  3. Very similar to option 2 but different naming. Make a mdformat-myst-core and move this plugin in its current state there. Then make this plugin require it and add optional syntax support.
  4. Keep this plugin as "myst core" only and do not create a "mdformat full" plugin at all. Require separate plugin for each optional syntax that a user wishes to enable. We then end up having mdformat-colon-fence, mdformat-amsmath etc.

I think my favorite at least currently is option number 4, having the following strong points:

  • keeps mdformat-myst simple and stable
  • learning from the past: it's been useful how e.g. tables syntax is in its own plugin that can be collaboratively enabled by mdformat-gfm or mdformat-myst (whichever happens to run first)
  • it's not yet clear if there's demand for any other optionals besides colon-fence
  • transition from option 4 to any of the others is easy, if desired later

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions