Comprehensive Markdoc language support for the Zed editor.
- Syntax highlighting for Markdoc documents (.mdoc, .markdoc)
- Tree-sitter based parsing using tree-sitter-markdoc
- Code fence language injection for embedded syntax highlighting
- Folding, indentation, and bracket matching
- Support for Markdoc tags, variables, and attributes
- Automatic installation and startup of the official Markdoc language server
markdoc.config.jsonsupport for schema-aware completions and validation
The latest version is v1.0.0 - Registry Launch Release. See releases page for all versions.
After this extension is accepted in the Zed extension registry:
- Open Zed
- Go to Extensions
- Search for "Markdoc"
- Click Install
- Clone this repository:
git clone https://github.com/louiss0/zed-markdoc-extension.git
- Symlink or copy the
extension/subdirectory to Zed's dev extensions directory:- Linux:
ln -s /path/to/zed-markdoc-extension/extension ~/.config/zed/extensions/dev/markdoc - macOS:
ln -s /path/to/zed-markdoc-extension/extension ~/Library/Application\ Support/Zed/extensions/dev/markdoc - Windows:
mklink /D "%APPDATA%\Zed\extensions\dev\markdoc" "C:\path\to\zed-markdoc-extension\extension"
- Linux:
- Restart Zed
Why the extra folder? The
extension/directory is what ships to the registry. Keeping samples and documentation at the repo root lets us exclude them from the Zed submission by pointing the registry topath = "extension"(seePUBLISHING.md).
This extension starts the official @markdoc/language-server package through
Zed's Rust extension API.
For schema-aware validation, completions, definitions, and routing, add a
markdoc.config.json file at your workspace root. The Markdoc language server
expects an array of server instances. Example:
[
{
"id": "docs",
"path": "docs/content",
"schema": {
"path": "docs/dist/schema.js",
"type": "node",
"property": "default",
"watch": true
},
"routing": {
"frontmatter": "route"
}
}
]Without a markdoc.config.json, the server still starts, but it falls back to
workspace-root defaults and won't have project-specific schema information.
extension/- distributable Zed extension (manifest, languages, Rust source)samples/- rich Markdoc examples for regression testing and screenshotsPUBLISHING.mdandCONTRIBUTING.md- publishing and contribution guides- Everything else - project metadata (CHANGELOG, README, LICENSE, etc.)
The separation keeps full-length samples in this repository while the registry bundle only ships the extension payload.
By default, this extension handles:
.mdocfiles.markdocfiles
To avoid conflicts with standard Markdown, .md files are not associated by
default.
To use Markdoc highlighting for specific .md files, add this to Zed settings:
{
"file_types": {
"Markdoc": ["**/*.markdoc.md", "content/**/*.md"]
}
}- Grammar: tree-sitter-markdoc
- Extension developed for Zed editor
- Blockquote highlighting does not yet distinguish nested blockquote content nodes reliably; marker vs. content highlighting still needs refinement.
MIT License - See LICENSE file for details
Step-by-step instructions for opening the upstream PR
(extensions.toml, submodule, pnpm sort-extensions, and review flow) live in
PUBLISHING.md. Follow that guide when preparing the registry
submission so samples/ stay local while extension/ gets packaged.
- Run
scripts/release.sh <new-version>to bump manifests and the changelog, build the WASM, and prepare the tag. Use--dry-runto preview the steps. - Commit the changes, create the tag (
git tag v<new-version>), and push the tag and commits. - The
Release Markdoc ExtensionGitHub Action (.github/workflows/release.yml) fires on everyv*tag and useshuacnlee/zed-extension-actionto open the upstream PR pointing atextension/.
Set the
COMMITTER_TOKENrepository secret to a Personal Access Token withrepoandworkflowscopes so the workflow can push to yourextensionsfork. Without it the job will fail fast.