{"library":"mdformat-myst","title":"mdformat-myst","description":"mdformat-myst is a plugin for the mdformat Markdown formatter, providing compatibility with MyST (Markedly Structured Text) Markdown syntax. It enables mdformat to correctly parse and format MyST-specific elements like directives, roles, and math blocks. The current version is 0.3.0, and it follows an active release cadence, frequently updating to support new mdformat features and MyST specifications.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install mdformat-myst"],"cli":{"name":"mdformat","version":"mdformat 1.0.0 (mdformat_front_matters 2.0.0, mdformat-gfm 1.0.0, mdformat_myst 0.3.0, mdformat_footnote 0.1.3)"}},"imports":["from mdformat import text"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom mdformat import text\n\n# Example Markdown with MyST syntax\nmyst_markdown = \"\"\"\n---\ntitle: MyST Example\nauthor: Me\n---\n\n# MyST Title\n\n````{myst-role}\nThis is a myst role content.\n````\n\n$$a^2 + b^2 = c^2$$\n\n:::{note}\nThis is a MyST directive.\n:::\n\"\"\"\n\n# --- Command Line Usage ---\n# For command line, save the content to a file, e.g., 'example.md'\n# Then run: mdformat example.md --plugin myst\n\n# --- Python API Usage ---\nformatted_text = text(myst_markdown, extensions=(\"myst\",))\nprint(formatted_text)\n\n# To verify it's formatted by mdformat-myst\n# Note: This is a simplified check, actual verification requires inspecting output\nassert ':::{note}' in formatted_text or '$a^2 + b^2 = c^2$' in formatted_text, \\\n    \"MyST specific elements should be preserved/formatted.\"\n","lang":"python","description":"To use mdformat-myst, you invoke `mdformat` from the command line or use its Python API, specifying `myst` as an enabled extension or plugin. The plugin automatically integrates with `mdformat` to handle MyST-specific syntax. The example demonstrates programmatic usage; for command line, save the MyST markdown to a file and run `mdformat <file> --plugin myst`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}