@mgks/docmd 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CONTRIBUTING.md +129 -0
- package/.github/workflows/publish.yml +3 -1
- package/README.md +119 -82
- package/config.js +2 -0
- package/docs/content/containers/changelogs.md +128 -0
- package/docs/content/containers/collapsible.md +89 -0
- package/package.json +1 -2
- package/src/assets/css/docmd-main.css +141 -31
- package/src/core/file-processor.js +49 -777
- package/src/core/markdown/containers.js +94 -0
- package/src/core/markdown/renderers.js +90 -0
- package/src/core/markdown/rules.js +355 -0
- package/src/core/markdown/setup.js +108 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Contributing to docmd
|
|
2
|
+
|
|
3
|
+
First off, thank you for considering contributing to `docmd`! It's people like you that make the open-source community such an amazing place to learn, inspire, and create.
|
|
4
|
+
|
|
5
|
+
We welcome contributions of all kinds: bug fixes, new features, documentation improvements, or even just typo fixes.
|
|
6
|
+
|
|
7
|
+
## ⚡ Quick Links
|
|
8
|
+
|
|
9
|
+
* [**Documentation**](https://docmd.mgks.dev) - Read the docs to understand how the tool works.
|
|
10
|
+
* [**GitHub Issues**](https://github.com/mgks/docmd/issues) - Browse existing bugs or feature requests.
|
|
11
|
+
* [**Discussions**](https://github.com/mgks/docmd/discussions) - Ask questions or share ideas.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🛠️ Development Setup
|
|
16
|
+
|
|
17
|
+
`docmd` is a Node.js CLI tool. Developing it locally requires a slightly different setup than a standard web app.
|
|
18
|
+
|
|
19
|
+
### Prerequisites
|
|
20
|
+
* **Node.js**: Version 22.x or higher.
|
|
21
|
+
* **npm**: Version 10.x or higher.
|
|
22
|
+
|
|
23
|
+
### 1. Fork and Clone
|
|
24
|
+
1. Fork the repository to your GitHub account.
|
|
25
|
+
2. Clone your fork locally:
|
|
26
|
+
```bash
|
|
27
|
+
git clone https://github.com/YOUR_USERNAME/docmd.git
|
|
28
|
+
cd docmd
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 2. Install Dependencies
|
|
32
|
+
```bash
|
|
33
|
+
npm install
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 3. Link for Local Development
|
|
37
|
+
To test the CLI command (`docmd`) globally on your machine while modifying the source code, use `npm link`.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# inside the project root
|
|
41
|
+
npm link
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Now, when you run `docmd` in *any* terminal window, it will use the code from your local folder.
|
|
45
|
+
|
|
46
|
+
### 4. Running the Dev Server
|
|
47
|
+
We have a built-in test site located in the `docs/` folder (this is the documentation for docmd itself).
|
|
48
|
+
|
|
49
|
+
To start the dev server and watch for changes:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Method 1: Using the npm script (Recommended)
|
|
53
|
+
npm start
|
|
54
|
+
|
|
55
|
+
# Method 2: If you have linked the package
|
|
56
|
+
docmd dev
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 5. Developer Mode (Important)
|
|
60
|
+
By default, `docmd` only watches the user's content files. To make `docmd` watch **its own internal source code** (templates, css, core logic) and trigger a rebuild when you edit them, set the environment variable:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Mac/Linux
|
|
64
|
+
export DOCMD_DEV=true
|
|
65
|
+
npm start
|
|
66
|
+
|
|
67
|
+
# Windows (PowerShell)
|
|
68
|
+
$env:DOCMD_DEV="true"
|
|
69
|
+
npm start
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## 📂 Project Structure
|
|
75
|
+
|
|
76
|
+
Here is a map of the codebase to help you navigate:
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
bin/
|
|
80
|
+
└── docmd.js # The CLI entry point
|
|
81
|
+
src/
|
|
82
|
+
├── commands/ # Logic for 'init', 'build', 'dev'
|
|
83
|
+
├── core/
|
|
84
|
+
│ ├── config-loader.js # Loads docmd.config.js
|
|
85
|
+
│ ├── config-validator.js # Validates config structure
|
|
86
|
+
│ ├── file-processor.js # Orchestrates file reading
|
|
87
|
+
│ ├── html-generator.js # Injects content into EJS templates
|
|
88
|
+
│ └── markdown/ # The Core Parsing Engine
|
|
89
|
+
│ ├── containers.js # Callout/Card definitions
|
|
90
|
+
│ ├── rules.js # Complex logic (Tabs, Changelogs)
|
|
91
|
+
│ └── setup.js # MarkdownIt configuration
|
|
92
|
+
├── plugins/ # Built-in plugins (SEO, Sitemap)
|
|
93
|
+
├── templates/ # EJS HTML templates
|
|
94
|
+
└── assets/ # Internal CSS and JS (Themes)
|
|
95
|
+
docs/ # The documentation site content
|
|
96
|
+
site/ # The generated output folder (gitignored)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🚀 Submitting a Pull Request
|
|
102
|
+
|
|
103
|
+
1. **Create a Branch:** Always create a new branch for your changes.
|
|
104
|
+
* `feat/my-new-feature`
|
|
105
|
+
* `fix/bug-description`
|
|
106
|
+
* `docs/update-readme`
|
|
107
|
+
2. **Make Changes:** Write clear, concise code.
|
|
108
|
+
3. **Test:**
|
|
109
|
+
* Run `docmd build` to ensure the build process finishes without errors.
|
|
110
|
+
* Verify your changes visually by running `docmd dev`.
|
|
111
|
+
4. **Commit:** We prefer [Conventional Commits](https://www.conventionalcommits.org/).
|
|
112
|
+
* `feat: add search bar`
|
|
113
|
+
* `fix: resolve css overflow in tables`
|
|
114
|
+
* `docs: fix typo in readme`
|
|
115
|
+
5. **Push & Open PR:** Push your branch to your fork and open a Pull Request against the `main` branch of `mgks/docmd`.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 🎨 Style Guidelines
|
|
120
|
+
|
|
121
|
+
* **Linting:** Please ensure your code follows the existing style. (We use standard ESLint/Prettier configurations).
|
|
122
|
+
* **No-Style:** If modifying `no-style` templates, ensure no external CSS is injected unless requested.
|
|
123
|
+
* **Compatibility:** `docmd` aims to be lightweight. Avoid adding heavy dependencies unless absolutely necessary.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 🤝 Community
|
|
128
|
+
|
|
129
|
+
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
|
@@ -39,7 +39,9 @@ jobs:
|
|
|
39
39
|
# --- Publish to GitHub Packages (GPR) ---
|
|
40
40
|
# ----------------------------------------
|
|
41
41
|
- name: Configure NPM for GitHub Packages registry
|
|
42
|
-
run:
|
|
42
|
+
run: |
|
|
43
|
+
echo "@mgks:registry=https://npm.pkg.github.com" > ~/.npmrc
|
|
44
|
+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
|
|
43
45
|
|
|
44
46
|
- name: Publish to GitHub Packages
|
|
45
47
|
run: npm publish
|
package/README.md
CHANGED
|
@@ -1,123 +1,160 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
2
|
+
<br>
|
|
3
|
+
<a href="https://docmd.mgks.dev">
|
|
4
|
+
<img src="https://github.com/mgks/docmd/blob/main/src/assets/images/docmd-logo-light.png?raw=true" alt="docmd logo" width="200" />
|
|
5
|
+
</a>
|
|
5
6
|
</p>
|
|
6
7
|
|
|
7
8
|
<p align="center">
|
|
8
|
-
<b>
|
|
9
|
-
<br>
|
|
9
|
+
<b>The minimalist, zero-config documentation generator for Node.js developers.</b>
|
|
10
|
+
<br>
|
|
11
|
+
Turn Markdown into beautiful, blazing-fast websites in seconds.
|
|
12
|
+
<br>
|
|
10
13
|
</p>
|
|
11
14
|
|
|
12
15
|
<p align="center">
|
|
13
|
-
<a href="https://www.npmjs.com/package/@mgks/docmd"><img src="https://img.shields.io/npm/v/@mgks/docmd.svg" alt="npm version"></a>
|
|
14
|
-
<a href="https://www.npmjs.com/package/@mgks/docmd"><img src="https://img.shields.io/npm/
|
|
15
|
-
<a href="https://github.com/mgks/docmd/blob/main/LICENSE"><img src="https://img.shields.io/github/license/mgks/docmd.svg" alt="license"></a>
|
|
16
|
+
<a href="https://www.npmjs.com/package/@mgks/docmd"><img src="https://img.shields.io/npm/v/@mgks/docmd.svg?style=flat-square&color=007acc" alt="npm version"></a>
|
|
17
|
+
<a href="https://www.npmjs.com/package/@mgks/docmd"><img src="https://img.shields.io/npm/dt/@mgks/docmd.svg?style=flat-square&color=success" alt="npm downloads"></a>
|
|
18
|
+
<a href="https://github.com/mgks/docmd/blob/main/LICENSE"><img src="https://img.shields.io/github/license/mgks/docmd.svg?style=flat-square&color=blue" alt="license"></a>
|
|
19
|
+
<a href="https://github.com/mgks/docmd/stargazers"><img src="https://img.shields.io/github/stars/mgks/docmd?style=flat-square&logo=github" alt="stars"></a>
|
|
16
20
|
</p>
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="https://docmd.mgks.dev"><b>View Live Demo</b></a> •
|
|
24
|
+
<a href="https://docmd.mgks.dev/getting-started/installation/"><b>Documentation</b></a> •
|
|
25
|
+
<a href="https://github.com/mgks/docmd/issues"><b>Report Bug</b></a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<br>
|
|
19
29
|
|
|
20
|
-
|
|
30
|
+
<p align="center">
|
|
31
|
+
<img width="2856" height="1558" alt="519536477-8d948e18-8e2d-420d-8902-96e1aafab1ba-modified" src="https://github.com/user-attachments/assets/5b883c80-8357-46e8-9adb-84e38a0da64c" />
|
|
32
|
+
<sup><i>docmd noStyle page preview in dark mode</i></sup>
|
|
33
|
+
</p>
|
|
21
34
|
|
|
22
|
-
##
|
|
35
|
+
## 🚀 Why docmd?
|
|
23
36
|
|
|
24
|
-
|
|
25
|
-
- **Beautiful Themes:** Comes with multiple built-in themes (`sky`, `ruby`, `retro`) and automatic light/dark mode support.
|
|
26
|
-
- **Fast & Lightweight:** Blazing fast static site generation with a minimal client-side footprint.
|
|
27
|
-
- **Rich Content:** Go beyond basic Markdown with custom components like callouts, cards, steps, tabs, and Mermaid diagrams.
|
|
28
|
-
- **Built-in Plugins:** SEO meta tags, sitemap, and analytics are all included out-of-the-box.
|
|
29
|
-
- **No-Style Pages:** Create completely custom pages (like landing pages) with full control over the HTML.
|
|
30
|
-
- **Customizable:** Easily extend or override styles with your own CSS and JavaScript.
|
|
31
|
-
- **Smart CLI:** Intelligent configuration validation catches typos and errors early. Simple workflow with `init`, `dev`, and `build`.
|
|
32
|
-
- **Deploy Anywhere:** The generated `site/` folder can be hosted on any static web host (GitHub Pages, Netlify, Vercel, etc.).
|
|
37
|
+
Most documentation tools today are too heavy (React hydration, massive bundles) or require ecosystems you don't use (Python/Ruby).
|
|
33
38
|
|
|
34
|
-
|
|
39
|
+
**docmd** fills the gap. It is a native Node.js tool that generates **pure, static HTML**.
|
|
35
40
|
|
|
36
|
-
**
|
|
41
|
+
* ⚡ **Blazing Fast:** No hydration delay. Instant page loads.
|
|
42
|
+
* 🛠 **Zero Config:** Works out of the box with sensible defaults.
|
|
43
|
+
* 🎨 **Theming:** Built-in light/dark modes and multiple themes (`sky`, `ruby`, `retro`).
|
|
44
|
+
* 📦 **Node.js Native:** No Python, no Gemfiles. Just `npm install`.
|
|
45
|
+
* 🧩 **Rich Content:** Built-in support for Callouts, Cards, Tabs, Steps, and Changelogs.
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
## 🏁 Quick Start
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
You don't need to install anything globally to try it out.
|
|
41
50
|
|
|
42
|
-
**1. Install Globally:**
|
|
43
51
|
```bash
|
|
44
|
-
|
|
52
|
+
# 1. Initialize a new project
|
|
53
|
+
npx @mgks/docmd init my-docs
|
|
54
|
+
|
|
55
|
+
# 2. Enter directory
|
|
56
|
+
cd my-docs
|
|
57
|
+
|
|
58
|
+
# 3. Start the dev server
|
|
59
|
+
npm start
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Dev server output:**
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
_ _
|
|
67
|
+
_| |___ ___ _____ _| |
|
|
68
|
+
| . | . | _| | . |
|
|
69
|
+
|___|___|___|_|_|_|___|
|
|
70
|
+
|
|
71
|
+
v0.x.x
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
🚀 Performing initial build for dev server...
|
|
75
|
+
✅ Generated sitemap at ./site/sitemap.xml
|
|
76
|
+
✅ Initial build complete.
|
|
77
|
+
👀 Watching for changes in:
|
|
78
|
+
- Source: ./docs
|
|
79
|
+
- Config: ./docmd.config.js
|
|
80
|
+
- Assets: ./assets
|
|
81
|
+
- docmd Templates: ./src/templates (internal)
|
|
82
|
+
- docmd Assets: ./src/assets (internal)
|
|
83
|
+
🎉 Dev server started at http://localhost:3000
|
|
84
|
+
Serving content from: ./site
|
|
85
|
+
Live reload is active. Browser will refresh automatically when files change.
|
|
45
86
|
```
|
|
46
87
|
|
|
47
|
-
|
|
48
|
-
Once installed, you can use the `docmd` command directly in any project folder.
|
|
88
|
+
## ✨ Features
|
|
49
89
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
90
|
+
| Feature | Description |
|
|
91
|
+
| :--- | :--- |
|
|
92
|
+
| **Markdown First** | Standard Markdown + Frontmatter. No proprietary syntax to learn. |
|
|
93
|
+
| **Smart CLI** | Intelligent config validation catches typos before they break your build. |
|
|
94
|
+
| **Custom Containers** | Use `::: callout`, `::: card`, `::: steps`, `::: tabs`, `::: collapsible`, `::: changelog`, and more to enrich content. |
|
|
95
|
+
| **Diagrams** | Create flowcharts, relationship diagrams, journey, piecharts, graphs, timelines and more with Mermaid. |
|
|
96
|
+
| **No-Style Pages** | Create custom landing pages (highly customizable custom HTML pages) without theme constraints. |
|
|
97
|
+
| **Auto Dark Mode** | Respects system preference and saves user choice. |
|
|
98
|
+
| **Plugins** | SEO, Sitemap, and Analytics support included out-of-the-box. |
|
|
55
99
|
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
# Starts a live-reloading server at http://localhost:3000
|
|
59
|
-
docmd dev
|
|
60
|
-
```
|
|
100
|
+
## 🆚 Comparison
|
|
61
101
|
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# Generates the static site into the `site/` directory
|
|
65
|
-
docmd build
|
|
66
|
-
```
|
|
102
|
+
How does `docmd` stack up against the giants?
|
|
67
103
|
|
|
68
|
-
|
|
104
|
+
| Feature | docmd | Docusaurus | MkDocs (Material) | Mintlify |
|
|
105
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
106
|
+
| **Language** | **Node.js** | React.js | Python | Proprietary |
|
|
107
|
+
| **Output** | **Static HTML** | React SPA | Static HTML | Hosted / Next.js |
|
|
108
|
+
| **JS Payload** | **Tiny (< 15kb)** | Heavy | Minimal | Medium |
|
|
109
|
+
| **Setup** | **~2 mins** | ~15 mins | ~10 mins | Instant (SaaS) |
|
|
110
|
+
| **Cost** | **100% Free OSS** | 100% Free OSS | 100% Free OSS | Freemium |
|
|
69
111
|
|
|
70
|
-
|
|
112
|
+
👉 *[Read the full comparison](https://docmd.mgks.dev/comparison/)*
|
|
71
113
|
|
|
72
|
-
|
|
73
|
-
This command will download the latest version, create a `my-docs` folder, and set up the project files inside it.
|
|
74
|
-
```bash
|
|
75
|
-
npx @mgks/docmd init my-docs
|
|
76
|
-
```
|
|
114
|
+
## 📦 Installation
|
|
77
115
|
|
|
78
|
-
|
|
79
|
-
Navigate into your new project and use `npx` again to start the server.
|
|
80
|
-
```bash
|
|
81
|
-
cd my-docs
|
|
82
|
-
npx @mgks/docmd dev
|
|
83
|
-
```
|
|
116
|
+
For frequent use, install globally:
|
|
84
117
|
|
|
85
|
-
|
|
118
|
+
```bash
|
|
119
|
+
npm install -g @mgks/docmd
|
|
120
|
+
```
|
|
86
121
|
|
|
87
|
-
|
|
122
|
+
### Commands
|
|
88
123
|
|
|
89
|
-
|
|
124
|
+
* `docmd init` - Create a new documentation project.
|
|
125
|
+
* `docmd dev` - Start the live-reloading local server.
|
|
126
|
+
* `docmd build` - Generate static files to `site/` for deployment.
|
|
90
127
|
|
|
91
|
-
|
|
92
|
-
- **[Getting Started](https://docmd.mgks.dev/getting-started/installation/):** Installation and basic CLI usage.
|
|
93
|
-
- **[Custom Containers](https://docmd.mgks.dev/content/containers/):** How to use Callouts, Cards, Tabs, and Steps.
|
|
94
|
-
- **[Theming](https://docmd.mgks.dev/theming/):** Customizing colors, dark mode, and adding your logo.
|
|
95
|
-
- **[Plugins](https://docmd.mgks.dev/plugins/):** SEO, Analytics, and Sitemap configuration.
|
|
96
|
-
- **[Recipes](https://docmd.mgks.dev/recipes/):** Step-by-step guides for common tasks like Custom Fonts and Landing Pages.
|
|
97
|
-
- **[Comparison](https://docmd.mgks.dev/comparison/):** How `docmd` stacks up against Docusaurus, MkDocs, and others.
|
|
128
|
+
## 🎨 Themes
|
|
98
129
|
|
|
99
|
-
|
|
130
|
+
Switching themes is as easy as changing one line in your `docmd.config.js`.
|
|
100
131
|
|
|
101
|
-
|
|
132
|
+
```javascript
|
|
133
|
+
module.exports = {
|
|
134
|
+
theme: {
|
|
135
|
+
name: 'sky', // Options: 'default', 'sky', 'ruby', 'retro'
|
|
136
|
+
defaultMode: 'dark'
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
102
140
|
|
|
103
|
-
|
|
104
|
-
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/docmd.git`
|
|
105
|
-
3. Install dependencies: `npm install`
|
|
106
|
-
4. Make your changes and test them thoroughly.
|
|
107
|
-
5. Submit a pull request to the `main` branch.
|
|
141
|
+
## 🤝 Contributing
|
|
108
142
|
|
|
109
|
-
Please
|
|
143
|
+
We welcome contributions! Please see our [Contribution Guidelines](.github/CONTRIBUTING.md) for details.
|
|
110
144
|
|
|
111
|
-
|
|
145
|
+
1. Fork the repository.
|
|
146
|
+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`).
|
|
147
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`).
|
|
148
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`).
|
|
149
|
+
5. Open a Pull Request.
|
|
112
150
|
|
|
113
|
-
|
|
151
|
+
## ❤️ Support
|
|
114
152
|
|
|
115
|
-
|
|
116
|
-
- Sharing it with others who might benefit.
|
|
117
|
-
- Reporting issues or submitting pull requests.
|
|
153
|
+
This project is open source and free to use. If you find it valuable, please consider:
|
|
118
154
|
|
|
119
|
-
|
|
155
|
+
1. ⭐️ **Starring the repo** on GitHub (it helps a lot!)
|
|
156
|
+
2. ☕ **[Sponsoring the project](https://github.com/sponsors/mgks)** to support ongoing development.
|
|
120
157
|
|
|
121
|
-
## License
|
|
158
|
+
## 📄 License
|
|
122
159
|
|
|
123
|
-
|
|
160
|
+
Distributed under the MIT License. See `LICENSE` for more information.
|
package/config.js
CHANGED
|
@@ -123,6 +123,8 @@ module.exports = {
|
|
|
123
123
|
{ title: 'Cards', path: '/content/containers/cards', icon: 'panel-top' },
|
|
124
124
|
{ title: 'Steps', path: '/content/containers/steps', icon: 'list-ordered' },
|
|
125
125
|
{ title: 'Tabs', path: '/content/containers/tabs', icon: 'columns-3' },
|
|
126
|
+
{ title: 'Collapsible', path: '/content/containers/collapsible', icon: 'chevrons-down' },
|
|
127
|
+
{ title: 'Changelogs', path: '/content/containers/changelogs', icon: 'logs' },
|
|
126
128
|
{ title: 'Buttons', path: '/content/containers/buttons', icon: 'mouse-pointer-click' },
|
|
127
129
|
{ title: 'Nested Containers', path: '/content/containers/nested-containers', icon: 'folder-tree' },
|
|
128
130
|
]
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Container: Changelogs"
|
|
3
|
+
description: "Create a beautiful, timeline-style version history for your project."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Changelog Container
|
|
7
|
+
|
|
8
|
+
The `changelog` container allows you to present version history and release notes in a clean, timeline layout. It separates metadata (dates/versions) from the narrative content, making it easy for users to scan updates.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
The changelog container uses a specific syntax where entries are separated by `==` markers.
|
|
13
|
+
|
|
14
|
+
::: callout info
|
|
15
|
+
Container blocks (like `::: changelog`) should be preceded by a blank line.
|
|
16
|
+
:::
|
|
17
|
+
|
|
18
|
+
**Syntax:**
|
|
19
|
+
```markdown
|
|
20
|
+
::: changelog
|
|
21
|
+
|
|
22
|
+
== Version/Date String
|
|
23
|
+
Content for this version.
|
|
24
|
+
Supports **Markdown**, lists, and other containers.
|
|
25
|
+
|
|
26
|
+
== Next Version/Date String
|
|
27
|
+
Content for the next version.
|
|
28
|
+
|
|
29
|
+
:::
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**`==`**: This marker denotes the start of a new entry. Everything after `==` on the same line is treated as the "Date" or "Version" badge on the left side of the timeline.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
### Basic Version History
|
|
39
|
+
|
|
40
|
+
**Code:**
|
|
41
|
+
```markdown
|
|
42
|
+
::: changelog
|
|
43
|
+
|
|
44
|
+
== v2.0.0 (2025-01-15)
|
|
45
|
+
### Major Update 🚀
|
|
46
|
+
We completely rewrote the core engine for better performance.
|
|
47
|
+
|
|
48
|
+
* Added new plugin system
|
|
49
|
+
* Improved build speed by 50%
|
|
50
|
+
|
|
51
|
+
== v1.1.0 (2024-12-01)
|
|
52
|
+
### Feature Drop
|
|
53
|
+
Added support for custom themes and dark mode.
|
|
54
|
+
|
|
55
|
+
== v1.0.0 (2024-11-10)
|
|
56
|
+
Initial public release.
|
|
57
|
+
:::
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Rendered Preview:**
|
|
61
|
+
|
|
62
|
+
::: changelog
|
|
63
|
+
|
|
64
|
+
== v2.0.0 (2025-01-15)
|
|
65
|
+
### Major Update 🚀
|
|
66
|
+
We completely rewrote the core engine for better performance.
|
|
67
|
+
|
|
68
|
+
* Added new plugin system
|
|
69
|
+
* Improved build speed by 50%
|
|
70
|
+
|
|
71
|
+
== v1.1.0 (2024-12-01)
|
|
72
|
+
### Feature Drop
|
|
73
|
+
Added support for custom themes and dark mode.
|
|
74
|
+
|
|
75
|
+
== v1.0.0 (2024-11-10)
|
|
76
|
+
Initial public release.
|
|
77
|
+
:::
|
|
78
|
+
|
|
79
|
+
### Changelog with Nested Elements
|
|
80
|
+
|
|
81
|
+
You can put anything inside a changelog entry, including callouts and code blocks.
|
|
82
|
+
|
|
83
|
+
**Code:**
|
|
84
|
+
````markdown
|
|
85
|
+
::: changelog
|
|
86
|
+
|
|
87
|
+
== v3.0.0-beta
|
|
88
|
+
### The Future is Here
|
|
89
|
+
|
|
90
|
+
::: callout warning Breaking Changes
|
|
91
|
+
This release changes the config format. Please update your `docmd.config.js`.
|
|
92
|
+
:::
|
|
93
|
+
|
|
94
|
+
**New Config Example:**
|
|
95
|
+
```javascript
|
|
96
|
+
module.exports = {
|
|
97
|
+
version: 3,
|
|
98
|
+
// ...
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
== v2.5.0
|
|
103
|
+
Maintenance release with bug fixes.
|
|
104
|
+
:::
|
|
105
|
+
````
|
|
106
|
+
|
|
107
|
+
**Rendered Preview:**
|
|
108
|
+
|
|
109
|
+
::: changelog
|
|
110
|
+
|
|
111
|
+
== v3.0.0-beta
|
|
112
|
+
### The Future is Here
|
|
113
|
+
|
|
114
|
+
::: callout warning Breaking Changes
|
|
115
|
+
This release changes the config format. Please update your `docmd.config.js`.
|
|
116
|
+
:::
|
|
117
|
+
|
|
118
|
+
**New Config Example:**
|
|
119
|
+
```javascript
|
|
120
|
+
module.exports = {
|
|
121
|
+
version: 3,
|
|
122
|
+
// ...
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
== v2.5.0
|
|
127
|
+
Maintenance release with bug fixes.
|
|
128
|
+
:::
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Container: Collapsible"
|
|
3
|
+
description: "Create accordion-style toggleable sections for FAQs, spoilers, or advanced details."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Collapsible Container
|
|
7
|
+
|
|
8
|
+
The `collapsible` container creates an accordion-style block that can be toggled open or closed. This is perfect for FAQs, "spoiler" content, or hiding complex details that aren't immediately necessary.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
The syntax allows you to define the title and the default state (open or closed).
|
|
13
|
+
|
|
14
|
+
**Syntax:**
|
|
15
|
+
```markdown
|
|
16
|
+
::: collapsible [open] Title Text Here
|
|
17
|
+
The hidden content goes here.
|
|
18
|
+
:::
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
- **`open`**: (Optional) If included, the section will be expanded by default on page load.
|
|
22
|
+
- **`Title Text Here`**: The text displayed on the clickable bar. If omitted, it defaults to "Click to expand".
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
### Basic Collapsible (Closed by Default)
|
|
29
|
+
|
|
30
|
+
Use this for content that should be hidden initially, like lengthy code examples or optional details.
|
|
31
|
+
|
|
32
|
+
**Code:**
|
|
33
|
+
```markdown
|
|
34
|
+
::: collapsible View Advanced Configuration
|
|
35
|
+
Here are the advanced settings for power users:
|
|
36
|
+
* `memory_limit`: Set the max heap size.
|
|
37
|
+
* `threads`: Number of worker threads.
|
|
38
|
+
:::
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Rendered Preview:**
|
|
42
|
+
|
|
43
|
+
::: collapsible View Advanced Configuration
|
|
44
|
+
Here are the advanced settings for power users:
|
|
45
|
+
* `memory_limit`: Set the max heap size.
|
|
46
|
+
* `threads`: Number of worker threads.
|
|
47
|
+
:::
|
|
48
|
+
|
|
49
|
+
### Default Open
|
|
50
|
+
|
|
51
|
+
Use the `open` keyword if you want the content visible but capable of being tucked away.
|
|
52
|
+
|
|
53
|
+
**Code:**
|
|
54
|
+
```markdown
|
|
55
|
+
::: collapsible open Important Notice
|
|
56
|
+
This content is visible immediately but can be collapsed if it takes up too much space.
|
|
57
|
+
:::
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Rendered Preview:**
|
|
61
|
+
|
|
62
|
+
::: collapsible open Important Notice
|
|
63
|
+
This content is visible immediately but can be collapsed if it takes up too much space.
|
|
64
|
+
:::
|
|
65
|
+
|
|
66
|
+
### FAQ Pattern
|
|
67
|
+
|
|
68
|
+
Collapsibles are ideal for Frequently Asked Questions.
|
|
69
|
+
|
|
70
|
+
**Code:**
|
|
71
|
+
```markdown
|
|
72
|
+
::: collapsible Is docmd free to use?
|
|
73
|
+
**Yes!** docmd is 100% open-source and free under the MIT license.
|
|
74
|
+
:::
|
|
75
|
+
|
|
76
|
+
::: collapsible Can I host it on GitHub Pages?
|
|
77
|
+
Absolutely. The `build` command generates static HTML files that work perfectly on GitHub Pages, Netlify, or Vercel.
|
|
78
|
+
:::
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Rendered Preview:**
|
|
82
|
+
|
|
83
|
+
::: collapsible Is docmd free to use?
|
|
84
|
+
**Yes!** docmd is 100% open-source and free under the MIT license.
|
|
85
|
+
:::
|
|
86
|
+
|
|
87
|
+
::: collapsible Can I host it on GitHub Pages?
|
|
88
|
+
Absolutely. The `build` command generates static HTML files that work perfectly on GitHub Pages, Netlify, or Vercel.
|
|
89
|
+
:::
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgks/docmd",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Generate beautiful, lightweight static documentation sites directly from your Markdown files. Zero clutter, just content.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/mgks/docmd#readme",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@mgks/docmd": "^0.2.5",
|
|
46
45
|
"chalk": "^4.1.2",
|
|
47
46
|
"chokidar": "^4.0.3",
|
|
48
47
|
"commander": "^14.0.0",
|