myst-language-supportThe 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. FeaturesSyntax Highlighting![]() Embedded code blocks/cells can be utilised in their native language: ![]() Hover and AutocompletionDirective completion and hover is available for all built-in sphinx directives: ![]() ![]() Snippet completions are also available for a number of Sphinx directives: ![]() Preview EnhancementThis 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
with the Working with MarkdownHere are some useful editor keyboard shortcuts:
For more information: ContributingThe main grammar is stored in See this guide on textmate bundles and the VS Code guide for more help. Building the GrammarThe grammar is written as a jinja template YAML file,
with the templates and default variables stored in To generate the main grammar with javascript:
or with python:
Snippets are also built in the same manner. TestingTo 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 Linting
and to auto-fix lints:
Publishing to VS MarketplaceThe publishing of the package should be done via the Github Actions CI. To trigger a release, bump the version in See: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#publishing-extensions AcknowledgementsTesting originally adapted from vscode-markdown-tm-grammar. |