Every docmd project includes a powerful, full-text search engine built-in. Unlike traditional search tools that require external indexing services or server-side databases, docmd search runs entirely in the user’s browser.
How it Works
- Build Phase:
docmdanalyzes your markdown and generates a compressedsearch-index.json. - Section Awareness: We don’t just index pages; we index headers. If a keyword appears in a specific
###section, the search result will link the user directly to that section using its permalink. - Local Execution: When a user types, the matching happens instantly in memory using
MiniSearch. It works perfectly in air-gapped environments or on slow connections.
Configuration
The search plugin is active by default. You can customize its presence via the layout object.
// docmd.config.js
module.exports = {
layout: {
optionsMenu: {
components: {
search: true // Set to false to remove the search button
}
}
}
}
Advanced Usage
Excluding Content
To prevent a specific page from being indexed (e.g., utility pages), add noindex to the frontmatter:
---
title: "Private Info"
noindex: true
---
Keyboard Shortcuts
We’ve optimized the search experience with native feeling shortcuts:
Cmd + K(Mac) orCtrl + K(Windows) to open.ESCto close.Arrow KeysandEnterto navigate.
Privacy First
Because the search happens entirely on the client, no data—not even keystrokes—is ever sent to a server. This makes docmd the Gold Standard for documentation search in privacy-sensitive industries (Healthcare, Finance, Security).
Comparison
Many documentation generators (like Docusaurus) rely on Algolia DocSearch. While Algolia is powerful, it introduces friction:
| Feature | docmd Search | Algolia / External |
|---|---|---|
| Setup | Zero Config (Automatic) | Complex (API Keys, CI/CD crawling) |
| Privacy | 100% Private (Client-side) | Data sent to 3rd party servers |
| Offline | Yes | No |
| Cost | Free | Free tier limits or Paid |
| Speed | Instant (In-memory) | Fast (Network latency dependent) |