Code Blocks
docmd includes highlight.js for automatic syntax highlighting.
Fenced Code Blocks
Wrap your code in triple backticks and specify the language for the best results.
```javascript
function hello() {
console.log("Hello World");
}
```
Renders as:
function hello() {
console.log("Hello World");
}
Copy Button
If copyCode: true is enabled in your config (default), a copy button will automatically appear in the top-right corner of every code block when the user hovers.
AI Context Strategy
When documenting code for LLMs:
- Always specify the language: This helps AI models parse the block correctly in the
llms-full.txtpayload. - Add comments: Explaining complex logic within the code block helps the AI reason about your implementation during context retrieval.
Supported Languages
docmd supports hundreds of languages including: javascript, typescript, html, css, bash, json, python, rust, go, markdown, and yaml.