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 v0.1.0 - Initial 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 to Zed's dev extensions directory:
- Linux:
ln -s /path/to/zed-markdoc-extension ~/.config/zed/extensions/dev/markdoc - macOS:
ln -s /path/to/zed-markdoc-extension ~/Library/Application\ Support/Zed/extensions/dev/markdoc - Windows:
mklink /D "%APPDATA%\Zed\extensions\dev\markdoc" "C:\path\to\zed-markdoc-extension"
- Linux:
-
Restart Zed
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.
Zed publishes extensions from PRs to the zed-industries/extensions repository.
- Fork
zed-industries/extensionsto your account. - Add this repository as a submodule in your fork (HTTPS URL required):
git submodule add https://github.com/louiss0/zed-markdoc-extension.git extensions/markdoc git add extensions/markdoc
- Add this entry to your fork's top-level
extensions.toml:[markdoc] submodule = "extensions/markdoc" version = "0.1.0"
- Run
pnpm sort-extensionsin thezed-industries/extensionsrepo. - Open a PR from your fork to
zed-industries/extensions.
This repository now includes .github/workflows/release.yml, powered by huacnlee/zed-extension-action@v2, to automate update PRs to zed-industries/extensions on each release tag.
Before using the workflow:
- Fork
zed-industries/extensionstolouiss0/extensions. - Create a GitHub personal access token with
repoandworkflowscopes. - Add that token in this repo as the
COMMITTER_TOKENActions secret.
Then publish by tagging:
git tag v0.1.1
git push origin v0.1.1By 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 to your Zed settings:
{
"file_types": {
"Markdoc": ["**/*.markdoc.md", "content/**/*.md"]
}
}- Grammar: tree-sitter-markdoc
- Extension developed for Zed editor
- Blockquote highlighting currently does not distinguish nested blockquote content nodes reliably; marker vs. content highlighting is still being refined.
MIT License - See LICENSE file for details