Get started with Docmach in a few simple steps.
# Install locally
npm i docmach
npx docmach
# Or install globally
npm i docmach -g
docmachmkdir my-docs
cd my-docsAdd the following to your package.json file:
"docmach": {
"docs-directory": "./docs",
"build-directory": "./docmach",
"assets-folder": "./assets"
}Create a file called index.md in your docs directory:
<docmach type="fragment" file="template.html" params="title=My First Docmach Page">
<docmach type="wrapper" replacement="replacement" file="fragments/post-wrapper.html" params="title: post 2;">
<h1>Nice h1 tag</h1>
</docmach>
# Hello Docmach!
This is my first page created with Docmach.
</docmach>docmachdocmach buildThis command:
- Compiles all Markdown files to HTML
- Copies assets to build directory
- Generates
docmach-manifest.json - Compiles Tailwind CSS
docmach printDisplays a tree view of all generated pages:
Docmach site structure
┬
├── /docs/
├── /introduction.html
├── /quickstart.html
├── /index.html
Use Docmach as a library:
import Docmach from "docmach";
// Compile specific file
await Docmach("docs/my-post.md");Perfect for:
- Dynamic blog engines
- CMS integrations
- On-demand page generation
Open your browser and navigate to http://localhost:4000
- Create more Markdown files in your docs directory
- Customize templates in your fragments directory
- Add function templates for dynamic content
- Explore custom themes and Tailwind CSS options