Multiple templates in a vscode global markdown.json file
Multiple templates in a vscode global markdown.json file
Multiple Mkdocs templates in the global markdown.json file
Original question:
!!! question “If we want to create “templates” for more than one document type, can we add those in the same global markdown.json file?”
How to do it
Yes, you can add multiple templates in the same global markdown.json file. VS Code supports an unlimited number of snippets in one file - just add them as separate JSON objects with commas between them.
Example: Multiple MkDocs Templates
In your global ~/.config/Code/User/snippets/markdown.json:
{
"MkDocs Guides Page": {
"prefix": "guides",
"body": [
"---",
"title: ${1:Guide Title}",
"status: new",
"description: ${2:Short description}",
"---",
"",
"# ${1:Guide Title}",
"",
"Content here..."
],
"description": "MkDocs guides template"
},
"MkDocs API Page": {
"prefix": "api",
"body": [
"---",
"title: ${1:API Endpoint}",
"status: new",
"description: ${2:API description}",
"---",
"",
"## Endpoint",
"",
"`${3:GET /path}`",
"",
"## Parameters"
],
"description": "MkDocs API template"
},
"MkDocs Release Notes": {
"prefix": "release",
"body": [
"---",
"title: ${1:Release Notes}",
"status: new",
"---",
"",
"# ${1:Release Notes}",
"",
"## New Features",
"- ",
"",
"## Bug Fixes",
"- ",
"",
"## Breaking Changes",
"- "
],
"description": "MkDocs release notes template"
}
}How to Use
Ctrl+Shift+P → "Insert Snippet"
Type guides, api, or release → pick from dropdown
OR type prefix + Tab in .md file (if autocomplete works)
Key Rules
Comma after each snippet (except the last one)
Unique prefix for each template
Unique snippet name (first key: "MkDocs Guides Page")
Save file → snippets available immediately
Now you have guides, api, and release templates all in one file! Add as many as needed. Perfect for a complete MkDocs documentation workflow