Provides syntax highlighting, bracket matching, and snippets for .mdma (Markdown Mapped) files. See the language specification and docs for the full grammar and filter reference.
Features
-
Syntax highlighting for:
@inputssection and typed declarations- Block headers
<blockname> - Multi-line block headers with
multiple: x in list/name: exprmodifiers - Template interpolation
{{ }}, control tags{% %}, and comments{# #} - Template keywords (
if,for,elif,else,endif,endfor,in,not,and,or) - Filter functions (
length,join,lower, etc.) - Markdown content within blocks (headings, bold, italic, blockquotes, code)
-
Bracket auto-closing for
{{ }},{% %}, and{# #}pairs, plus comment toggling (Ctrl+/) using{# ... #} -
Type declaration generation on save — for a template in a TypeScript project (one with an ancestor
tsconfig.json), writes/refreshes itsfoo.d.mdma.tsunder a.mdma-types/folder at that project's root, mirroring the template's relative path, soimporttypes stay in sync without runningmdma-typegenby hand. Pair it with arootDirsentry in thattsconfig.json(see the typescript-mdma docs) soimport x from "./foo.mdma"resolves the generated types, and gitignore.mdma-types/since it's regenerated on every save. Templates outside any TypeScript project are left untouched. -
Snippets — trigger with the prefix in any
.mdmafile:Prefix Description @inputsFull file skeleton inputSingle input declaration blockNamed block header multipleBlock with a multipleheader modifiermultiplenameBlock with multipleandnameheader modifiersifConditional block ifwConditional list section with whitespace control forFor loop forwFor loop with whitespace stripping {{Interpolation tag {#Comment breakingBreaking change blockquote
Installation
Development install (no packaging required)
cp -r /path/to/mdma-vscode ~/.vscode/extensions/mdma-language-0.1.0
Then reload VSCode (Ctrl+Shift+P → Developer: Reload Window).
Package and install with vsce
npm install -g @vscode/vsce
vsce package
code --install-extension mdma-language-0.1.0.vsix
Theme Compatibility
The extension uses standard TextMate scopes, so it works with any theme. Key scopes:
| Element | TextMate scope |
|---|---|
@inputs |
keyword.control.inputs.mdma |
| Input name | variable.parameter.input.mdma |
| Type | support.type.primitive.mdma |
| Block name | entity.name.section.block.mdma |
multiple modifier keyword |
keyword.control.multiple.mdma |
name modifier keyword |
keyword.control.name.mdma |
{{ }} delimiters |
punctuation.definition.template.expression.*.mdma |
{% %} delimiters |
punctuation.definition.tag.template.*.mdma |
| Control keywords | keyword.control.flow.mdma |
| Variables | variable.other.template.mdma |
| Filters | support.function.builtin.filter.mdma |
| Markdown headings | markup.heading.markdown.mdma |
| Markdown bold | markup.bold.markdown.mdma |