The official MyST (Markedly Structured Text) Textmate grammar, and VS Code extension, for extending the markdown language.
This extension injects additional elements into the base markdown syntax highlighting grammar, and adds additional language support for MyST specific elements.
Important This extension is a work in progress, and future changes are likely.
Embedded code blocks/cells can be utilised in their native language:
Hover and Autocompletion
Directive completion and hover is available for all built-in sphinx directives:
Snippet completions are also available for a number of Sphinx directives:
This extension enhances VS Code's built-in Markdown previewer (see this guide for info), to properly render nested admonitions, and code directives, etc.
If you encounter any issues with this, you can disable it
Working with Markdown
Here are some useful editor keyboard shortcuts:
For more information:
The main grammar is stored in
Building the Grammar
The grammar is written as a jinja template YAML file,
with the templates and default variables stored in
or with python:
Snippets are also built in the same manner.
To run the full test suite:
The test suite is split into 'integration' tests, which require VS Code to be launched, and 'standalone' tests, which can be run in the standard fashion with mocha.
The highlighting test cases are stored as markdown files under
To visualise the grammar in VS Code, select the
See also VS Code Testing Extension Guide
and to auto-fix lints:
Publishing to VS Marketplace
The publishing of the package should be done via the Github Actions CI. To trigger a release, bump the version in
Testing originally adapted from vscode-markdown-tm-grammar.