A modern GitBook-like documentation system that automatically creates beautiful documentation sites from Markdown files.
- 📝 Markdown Support: All documentation written in Markdown format
- 🔍 Advanced Search: Fast search across all content
- 📱 Responsive Design: Mobile and desktop compatible
- 🎨 Modern Interface: Clean and user-friendly design
- ⚡ Fast: Optimized performance
- 🔧 Customizable: Theme and style customizations
- 📚 Auto Navigation: Automatic menu generation from file structure
- 🏷️ Categories: Organize documentation into categories
- ⚙️ Configuration: Full customization via JSON config
- 🎯 Dynamic Homepage: Category-based homepage with clickable cards
- 🔗 Breadcrumbs: Easy navigation with breadcrumb trails
- 💻 Syntax Highlighting: Code syntax highlighting with Prism.js
- 🌐 API Ready: RESTful API for programmatic access
- Clone the project:
git clone <repository-url>
cd mdbook- Install dependencies:
npm install- Start the server:
npm start- Open
http://localhost:3000in your browser
To run in development mode:
npm run devAfter installation, your documentation will be automatically generated from the docs/ folder. The system will:
- Scan all
.mdfiles in thedocs/directory - Parse frontmatter metadata
- Generate navigation menus
- Create category-based organization
Simply add Markdown files to the docs/ folder:
docs/
├── README.md # Home page
├── getting-started/ # Getting started guides
│ ├── installation.md
│ └── writing-docs.md
├── api/ # API documentation
│ ├── authentication.md
│ └── endpoints.md
└── guides/ # Usage guides
├── basic-usage.md
└── advanced-features.md
Each Markdown file should start with YAML frontmatter:
---
title: "Page Title"
description: "Page description"
order: 1
category: "Category Name"
---Edit config.json to customize your site:
{
"site": {
"title": "My Documentation",
"description": "My awesome documentation"
},
"theme": {
"primaryColor": "#2563eb"
}
}Customize your site using the config.json file:
{
"site": {
"title": "My Documentation",
"description": "My awesome documentation",
"author": "My Name",
"version": "1.0.0",
"logo": "/images/logo.png",
"favicon": "/images/favicon.ico"
}
}{
"theme": {
"primaryColor": "#2563eb",
"primaryHover": "#1d4ed8",
"secondaryColor": "#64748b",
"backgroundColor": "#ffffff",
"sidebarBackground": "#f8fafc",
"textColor": "#1e293b",
"textMuted": "#64748b",
"borderColor": "#e2e8f0",
"hoverBackground": "#f1f5f9",
"codeBackground": "#f1f5f9"
}
}{
"content": {
"welcomeTitle": "Welcome to My Documentation",
"welcomeMessage": "Select a documentation from the left menu.",
"loadingMessage": "Loading documentation...",
"noDocsMessage": "No documentation found"
}
}{
"features": {
"search": false,
"breadcrumbs": true,
"syntaxHighlighting": true,
"responsive": true
}
}- Sidebar Navigation: Automatically generated from your file structure
- Category Organization: Files are grouped by their
categoryfrontmatter - Ordering: Files are sorted by their
orderfrontmatter (default: 999) - Icons: Automatic icon assignment based on file path and category
- Dynamic Categories: Homepage displays all available categories as clickable cards
- Document Count: Shows number of documents in each category
- Quick Access: Click any category card to jump to its first document
- Markdown Support: Full Markdown syntax support including:
- Headers, lists, tables
- Code blocks with syntax highlighting
- Links, images, blockquotes
- Custom HTML when needed
- Frontmatter: YAML metadata for each page
- Auto-reload: Changes are reflected immediately in development mode
- Mobile-First: Optimized for mobile devices
- Collapsible Sidebar: Mobile-friendly navigation
- Touch-Friendly: Large touch targets for mobile users
- Adaptive Layout: Content adjusts to screen size
- Full-Text Search: Search across all documentation content
- Real-Time Results: Instant search results as you type
- Highlighted Matches: Search terms are highlighted in results
- Context Snippets: Shows relevant text snippets from matches
Organize your documentation using folders and frontmatter:
docs/
├── README.md # Home page
├── getting-started/ # Getting started guides
│ ├── installation.md
│ └── writing-docs.md
├── api/ # API documentation
│ ├── authentication.md
│ └── endpoints.md
└── guides/ # Usage guides
├── basic-usage.md
└── advanced-features.md
Each Markdown file can include these frontmatter options:
---
title: "Page Title" # Display title
description: "Page description" # Meta description
order: 1 # Sort order (lower = first)
category: "Category Name" # Grouping category
---- Automatic Grouping: Files with the same category are grouped together
- Default Category: Files without a category go to "General"
- Category Icons: Automatic icon assignment based on category name
- Category Cards: Homepage shows clickable category cards
- CSS Variables: Easy theme customization via CSS custom properties
- Color Scheme: Customize primary, secondary, and background colors
- Typography: Consistent typography with system fonts
- Dark Mode Ready: CSS structure supports dark mode implementation
The system provides a RESTful API for programmatic access:
GET /api/config- Get configuration settingsGET /api/docs- List all documentation filesGET /api/docs/:path- Get specific documentation fileGET /api/search?q=query- Search documentation
// Get configuration
const config = await fetch('/api/config');
const settings = await config.json();
// Get all documentation
const response = await fetch('/api/docs');
const docs = await response.json();
// Get specific documentation
const doc = await fetch('/api/docs/getting-started/installation');
const content = await doc.json();
// Search documentation
const results = await fetch('/api/search?q=installation');
const searchResults = await results.json();Documentation List (/api/docs):
{
"Getting Started": [
{
"path": "getting-started/installation.md",
"title": "Installation",
"description": "Learn how to install the system",
"order": 1,
"category": "Getting Started"
}
],
"API": [
{
"path": "api/authentication.md",
"title": "Authentication",
"description": "API authentication system",
"order": 1,
"category": "API"
}
]
}Document Content (/api/docs/:path):
{
"title": "Installation",
"description": "Learn how to install the system",
"content": "<h1>Installation</h1><p>Follow these steps...</p>",
"frontmatter": {
"title": "Installation",
"order": 1,
"category": "Getting Started"
}
}Edit the theme section in config.json:
{
"theme": {
"primaryColor": "#your-color",
"backgroundColor": "#your-bg-color",
"sidebarBackground": "#your-sidebar-color"
}
}- Add your logo and favicon files to the
public/images/folder - Specify their paths in
config.json:
{
"site": {
"logo": "/images/your-logo.png",
"favicon": "/images/your-favicon.ico"
}
}- Add new endpoints to
server.js - Add frontend functions to
public/app.js - Add necessary styles to
public/styles.css
- Create a new
.mdfile in thedocs/folder - Add frontmatter with title, description, order, and category
- Write your content in Markdown
- The system will automatically detect and include it
- Edit
public/styles.cssfor styling changes - Modify
public/app.jsfor functionality changes - Update
public/index.htmlfor structural changes
- Add new routes in
server.js - Modify the documentation parsing logic
- Add new API endpoints as needed
- Use clear, descriptive titles
- Group related content in categories
- Use consistent frontmatter
- Keep file names lowercase with hyphens
- Write clear, concise documentation
- Use code examples where appropriate
- Include screenshots for complex procedures
- Keep content up-to-date
- Optimize images before adding them
- Use relative links for internal navigation
- Keep individual pages focused and not too long
- Use the search feature to help users find content quickly
- Files not appearing: Check that files are in the
docs/folder and have.mdextension - Styling issues: Verify
config.jsonsyntax and CSS variable names - Navigation problems: Ensure frontmatter is properly formatted
- Search not working: Check that search is enabled in config
- Check the console for error messages
- Verify file permissions and paths
- Ensure all dependencies are installed
- Review the configuration file syntax
MIT License
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For issues and questions:
- Use GitHub Issues for bug reports
- Check the documentation for common solutions
- Review the configuration examples
- Test with the provided sample documentation