@mgks/docmd 0.1.3 → 0.2.0
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/workflows/deploy-docmd.yml +2 -2
- package/README.md +2 -4
- package/assets/css/welcome.css +62 -358
- package/assets/images/preview-dark-1.webp +0 -0
- package/assets/images/preview-dark-2.webp +0 -0
- package/assets/images/preview-dark-3.webp +0 -0
- package/assets/images/preview-light-1.webp +0 -0
- package/assets/images/preview-light-2.webp +0 -0
- package/assets/images/preview-light-3.webp +0 -0
- package/config.js +35 -4
- package/docs/cli-commands.md +1 -2
- package/docs/configuration.md +104 -23
- package/docs/content/containers/buttons.md +88 -0
- package/docs/content/containers/callouts.md +154 -0
- package/docs/content/containers/cards.md +93 -0
- package/docs/content/containers/index.md +35 -0
- package/docs/content/containers/nested-containers.md +329 -0
- package/docs/content/containers/steps.md +175 -0
- package/docs/content/containers/tabs.md +228 -0
- package/docs/content/frontmatter.md +4 -4
- package/docs/content/index.md +5 -4
- package/docs/content/markdown-syntax.md +4 -4
- package/docs/content/no-style-example.md +1 -1
- package/docs/contributing.md +7 -0
- package/docs/deployment.md +22 -31
- package/docs/getting-started/basic-usage.md +3 -2
- package/docs/getting-started/index.md +3 -3
- package/docs/getting-started/installation.md +1 -1
- package/docs/index.md +14 -20
- package/docs/plugins/seo.md +2 -0
- package/docs/plugins/sitemap.md +1 -1
- package/docs/theming/assets-management.md +1 -1
- package/docs/theming/available-themes.md +45 -52
- package/docs/theming/light-dark-mode.md +12 -3
- package/package.json +9 -3
- package/src/assets/css/docmd-main.css +935 -573
- package/src/assets/css/docmd-theme-retro.css +812 -0
- package/src/assets/css/docmd-theme-ruby.css +619 -0
- package/src/assets/css/docmd-theme-sky.css +606 -605
- package/src/assets/js/docmd-image-lightbox.js +1 -3
- package/src/assets/js/docmd-main.js +97 -0
- package/src/commands/build.js +1 -1
- package/src/commands/dev.js +5 -2
- package/src/commands/init.js +21 -1
- package/src/core/file-processor.js +626 -363
- package/src/core/html-generator.js +20 -30
- package/src/plugins/seo.js +4 -0
- package/src/templates/layout.ejs +34 -8
- package/assets/images/preview-dark-1.png +0 -0
- package/assets/images/preview-dark-2.png +0 -0
- package/assets/images/preview-dark-3.png +0 -0
- package/assets/images/preview-light-1.png +0 -0
- package/assets/images/preview-light-2.png +0 -0
- package/assets/images/preview-light-3.png +0 -0
- package/docs/content/custom-containers.md +0 -129
- package/src/assets/js/docmd-theme-toggle.js +0 -59
|
@@ -26,7 +26,7 @@ tags:
|
|
|
26
26
|
* **`title`** (String, Required)
|
|
27
27
|
* **Purpose:** This is the primary title of the page.
|
|
28
28
|
* **Usage:**
|
|
29
|
-
* Used for the HTML `<title>` tag (e.g., `Page Title
|
|
29
|
+
* Used for the HTML `<title>` tag (e.g., `Page Title : Site Title`).
|
|
30
30
|
* Often used as the main heading (`<h1>`) on the page by default (though themes can customize this).
|
|
31
31
|
* Used as the display text for links in the navigation sidebar if the path matches.
|
|
32
32
|
* **Example:** `title: "Installation Guide"`
|
|
@@ -50,6 +50,7 @@ Examples of custom fields you *might* add (these are not built-in features):
|
|
|
50
50
|
* `order`: 2 (For custom sorting of pages within a section, if you implement logic for it)
|
|
51
51
|
* `draft`: true (To mark a page as a draft, if you implement logic to exclude drafts from builds)
|
|
52
52
|
* `tags`: ["tag1", "tag2"]
|
|
53
|
+
* `permalink`: "https://example.com/your-canonical-url/" (Sets the canonical URL for SEO purposes)
|
|
53
54
|
|
|
54
55
|
## Example Usage
|
|
55
56
|
|
|
@@ -68,9 +69,8 @@ This guide will walk you through installing our application...
|
|
|
68
69
|
```
|
|
69
70
|
|
|
70
71
|
In this example:
|
|
71
|
-
* The browser tab will show "Installation Steps
|
|
72
|
+
* The browser tab will show "Installation Steps : Your Site Title".
|
|
72
73
|
* The `<meta name="description">` will be set.
|
|
73
74
|
* The `order: 1` field is available if you later want to sort "guides" pages by this value.
|
|
74
75
|
|
|
75
|
-
Using frontmatter consistently ensures your pages are well-defined, SEO-friendly, and integrate smoothly with `docmd`'s navigation and theming systems.
|
|
76
|
-
```
|
|
76
|
+
Using frontmatter consistently ensures your pages are well-defined, SEO-friendly, and integrate smoothly with `docmd`'s navigation and theming systems.
|
package/docs/content/index.md
CHANGED
|
@@ -9,9 +9,10 @@ docmd uses Markdown files to create beautiful documentation. This section covers
|
|
|
9
9
|
|
|
10
10
|
## Available Guides
|
|
11
11
|
|
|
12
|
-
- [**Frontmatter**](/content/frontmatter) - Learn how to add metadata to your pages
|
|
13
|
-
- [**Markdown Syntax**](/content/markdown-syntax) - Basic and advanced Markdown features
|
|
14
|
-
- [**Images**](/content/images) - How to add and style images in your documentation
|
|
15
|
-
- [**Custom Containers**](/content/custom-containers) - Special content blocks like callouts and cards
|
|
12
|
+
- [**Frontmatter**](/content/frontmatter/) - Learn how to add metadata to your pages
|
|
13
|
+
- [**Markdown Syntax**](/content/markdown-syntax/) - Basic and advanced Markdown features
|
|
14
|
+
- [**Images**](/content/images/) - How to add and style images in your documentation
|
|
15
|
+
- [**Custom Containers**](/content/custom-containers/) - Special content blocks like callouts and cards
|
|
16
|
+
- [**noStyle Pages**](/content/no-style-pages/) - Create custom standalone pages with complete HTML control
|
|
16
17
|
|
|
17
18
|
Choose a topic from the sidebar to get started.
|
|
@@ -51,7 +51,7 @@ You can use all standard Markdown elements:
|
|
|
51
51
|
```markdown
|
|
52
52
|
[Link Text](https://www.example.com)
|
|
53
53
|
[Link with Title](https://www.example.com "Link Title")
|
|
54
|
-
[Relative Link to another page](../section/other-page
|
|
54
|
+
[Relative Link to another page](../section/other-page/)
|
|
55
55
|
```
|
|
56
56
|
*Note: For internal links to other documentation pages, use relative paths to the `.md` files. `docmd` will convert these to the correct HTML paths during the build.*
|
|
57
57
|
|
|
@@ -152,7 +152,7 @@ Because `markdown-it` is configured with `html: true`, you can embed raw HTML di
|
|
|
152
152
|
</div>
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
For most formatting needs, standard Markdown and `docmd`'s [Custom Containers](
|
|
155
|
+
For most formatting needs, standard Markdown and `docmd`'s [Custom Containers](/content/custom-containers/) should suffice.
|
|
156
156
|
|
|
157
157
|
# Advanced Markdown Capabilities
|
|
158
158
|
|
|
@@ -264,7 +264,7 @@ $$
|
|
|
264
264
|
## Container Extensions
|
|
265
265
|
|
|
266
266
|
Beyond standard Markdown, docmd provides custom containers for enhanced formatting.
|
|
267
|
-
These are detailed in the [Custom Containers](
|
|
267
|
+
These are detailed in the [Custom Containers](/content/custom-containers/) guide, and include:
|
|
268
268
|
|
|
269
269
|
::: callout info
|
|
270
270
|
Use containers for callouts, cards, and steps to structure your documentation.
|
|
@@ -274,4 +274,4 @@ Use containers for callouts, cards, and steps to structure your documentation.
|
|
|
274
274
|
|
|
275
275
|
Markdown provides a powerful yet simple way to write and format documentation. With docmd's extensions and customizations, you can create rich, beautiful documentation that's easy to maintain.
|
|
276
276
|
|
|
277
|
-
For more examples and practical applications, check the rest of the documentation or browse the source of this page by viewing its Markdown file.
|
|
277
|
+
For more examples and practical applications, check the rest of the documentation or browse the source of this page by viewing its Markdown file.
|
|
@@ -105,6 +105,6 @@ bodyClass: "no-style-example"
|
|
|
105
105
|
without affecting the rest of your site.
|
|
106
106
|
</p>
|
|
107
107
|
|
|
108
|
-
<a href="/content/no-style-pages" class="button">Get Back to No-Style Pages Documentation</a>
|
|
108
|
+
<a href="/content/no-style-pages/" class="button">Get Back to No-Style Pages Documentation</a>
|
|
109
109
|
</div>
|
|
110
110
|
</div>
|
package/docs/contributing.md
CHANGED
|
@@ -58,6 +58,13 @@ To set up `docmd` for local development:
|
|
|
58
58
|
* Follow the existing code style and formatting.
|
|
59
59
|
* Consider running `npm run lint` to check for style issues (if set up).
|
|
60
60
|
|
|
61
|
+
### Environment Setup
|
|
62
|
+
|
|
63
|
+
To enable live change tracking for internal files during development, set the DOCMD_DEV environment variable:
|
|
64
|
+
|
|
65
|
+
- **Temporarily:** Run `export DOCMD_DEV=true` in your terminal before starting the dev server.
|
|
66
|
+
- **Permanently:** Add `export DOCMD_DEV=true` to your `~/.zshrc` file and run `source ~/.zshrc`.
|
|
67
|
+
|
|
61
68
|
## Pull Request Process
|
|
62
69
|
|
|
63
70
|
Once you're satisfied with your changes:
|
package/docs/deployment.md
CHANGED
|
@@ -59,14 +59,12 @@ The most robust and automated way to deploy to GitHub Pages is using a GitHub Ac
|
|
|
59
59
|
Create a file at `.github/workflows/deploy-docs.yml` with the following content:
|
|
60
60
|
|
|
61
61
|
```yaml
|
|
62
|
-
name: Deploy docmd docs to Pages
|
|
62
|
+
name: Deploy docmd docs to GitHub Pages
|
|
63
63
|
|
|
64
64
|
on:
|
|
65
|
-
# Run on pushes to main branch
|
|
66
65
|
push:
|
|
67
|
-
branches: ["main"]
|
|
68
|
-
# Allows manual workflow trigger from Actions tab
|
|
69
|
-
workflow_dispatch:
|
|
66
|
+
branches: ["main"] # Your default branch
|
|
67
|
+
workflow_dispatch: # Allows manual workflow trigger from Actions tab
|
|
70
68
|
|
|
71
69
|
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
72
70
|
permissions:
|
|
@@ -74,46 +72,39 @@ permissions:
|
|
|
74
72
|
pages: write
|
|
75
73
|
id-token: write
|
|
76
74
|
|
|
77
|
-
# Allow only one concurrent deployment
|
|
78
|
-
concurrency:
|
|
79
|
-
group: "pages"
|
|
80
|
-
cancel-in-progress: false
|
|
81
|
-
|
|
82
75
|
jobs:
|
|
83
|
-
build:
|
|
76
|
+
build-and-deploy:
|
|
84
77
|
runs-on: ubuntu-latest
|
|
78
|
+
environment:
|
|
79
|
+
name: github-pages
|
|
80
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
85
81
|
steps:
|
|
86
82
|
- name: Checkout
|
|
87
|
-
uses: actions/checkout@
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
uses: actions/checkout@v4
|
|
84
|
+
|
|
85
|
+
- name: Set up Node.js
|
|
86
|
+
uses: actions/setup-node@v4
|
|
90
87
|
with:
|
|
91
|
-
node-version: '
|
|
88
|
+
node-version: '22'
|
|
92
89
|
cache: 'npm'
|
|
90
|
+
|
|
93
91
|
- name: Install docmd (globally or from devDependencies)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# If installing docmd globally for this action:
|
|
97
|
-
run: npm install -g docmd # Or your scoped package name e.g. @mgks/docmd
|
|
92
|
+
run: npm install -g @mgks/docmd
|
|
93
|
+
|
|
98
94
|
- name: Build site with docmd
|
|
99
95
|
run: docmd build # Assumes config.js is in the root and correctly points to srcDir/outputDir
|
|
96
|
+
|
|
100
97
|
- name: Setup Pages
|
|
101
|
-
uses: actions/configure-pages@
|
|
98
|
+
uses: actions/configure-pages@v5
|
|
99
|
+
|
|
102
100
|
- name: Upload artifact
|
|
103
|
-
uses: actions/upload-pages-artifact@
|
|
101
|
+
uses: actions/upload-pages-artifact@v3
|
|
104
102
|
with:
|
|
105
|
-
# This should be your outputDir path
|
|
106
|
-
|
|
107
|
-
deploy:
|
|
108
|
-
environment:
|
|
109
|
-
name: github-pages
|
|
110
|
-
url: ${{ steps.deployment.outputs.page_url }}
|
|
111
|
-
runs-on: ubuntu-latest
|
|
112
|
-
needs: build
|
|
113
|
-
steps:
|
|
103
|
+
path: ./site # This should be your outputDir path
|
|
104
|
+
|
|
114
105
|
- name: Deploy to GitHub Pages
|
|
115
106
|
id: deployment
|
|
116
|
-
uses: actions/deploy-pages@
|
|
107
|
+
uses: actions/deploy-pages@v4
|
|
117
108
|
```
|
|
118
109
|
|
|
119
110
|
Then:
|
|
@@ -36,6 +36,7 @@ Create your Markdown (`.md`) files inside the `docs/` directory. You can organiz
|
|
|
36
36
|
|
|
37
37
|
```
|
|
38
38
|
my-awesome-docs/
|
|
39
|
+
├── assets/
|
|
39
40
|
├── docs/
|
|
40
41
|
│ ├── index.md
|
|
41
42
|
│ └── api/
|
|
@@ -47,7 +48,7 @@ my-awesome-docs/
|
|
|
47
48
|
└── config.js
|
|
48
49
|
```
|
|
49
50
|
|
|
50
|
-
Each Markdown file should start with YAML frontmatter to define metadata like the page title. See [
|
|
51
|
+
Each Markdown file should start with YAML frontmatter to define metadata like the page title. See [Content > Frontmatter](/content/frontmatter/) for details.
|
|
51
52
|
|
|
52
53
|
## 3. Preview Your Site (`docmd dev`)
|
|
53
54
|
|
|
@@ -85,4 +86,4 @@ This command:
|
|
|
85
86
|
|
|
86
87
|
The contents of the `site/` directory are all you need to deploy your documentation. You can upload this folder to any static web hosting provider. See [Deployment](/deployment/) for more information.
|
|
87
88
|
|
|
88
|
-
This covers the fundamental workflow of using `docmd`. Next, you'll want to learn more about [
|
|
89
|
+
This covers the fundamental workflow of using `docmd`. Next, you'll want to learn more about [Content](/content/) and [Configuration](/configuration/).
|
|
@@ -11,11 +11,11 @@ Whether you're documenting a new open-source project, an internal tool, or just
|
|
|
11
11
|
|
|
12
12
|
## What You'll Learn:
|
|
13
13
|
|
|
14
|
-
* **[Installation](
|
|
15
|
-
* **[Basic Usage](
|
|
14
|
+
* **[Installation](/getting-started/installation/):** How to install `docmd` on your system using npm.
|
|
15
|
+
* **[Basic Usage](/getting-started/basic-usage/):**
|
|
16
16
|
* Initializing a new `docmd` project with `docmd init`.
|
|
17
17
|
* Adding and structuring your Markdown content.
|
|
18
18
|
* Building your static site with `docmd build`.
|
|
19
19
|
* Previewing your site with live reloading using `docmd dev`.
|
|
20
20
|
|
|
21
|
-
Ready to begin? Let's start with [Installation](
|
|
21
|
+
Ready to begin? Let's start with [Installation](/getting-started/installation/).
|
|
@@ -5,7 +5,7 @@ description: "Learn how to install docmd on your system globally or as a project
|
|
|
5
5
|
|
|
6
6
|
# Installation
|
|
7
7
|
|
|
8
|
-
You can install `docmd` using npm (Node Package Manager), which comes with Node.js. If you don't have Node.js and npm installed, please visit [nodejs.org](https://nodejs.org/) to download and install them first (Node.js version
|
|
8
|
+
You can install `docmd` using npm (Node Package Manager), which comes with Node.js. If you don't have Node.js and npm installed, please visit [nodejs.org](https://nodejs.org/) to download and install them first (Node.js version 22.x or higher is required for `docmd`).
|
|
9
9
|
|
|
10
10
|
## Global Installation (Recommended for CLI Use)
|
|
11
11
|
|
package/docs/index.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "Documentation. Zero Clutter. Just Content."
|
|
3
3
|
description: "A lightweight static documentation site generator that transforms Markdown into beautiful, responsive documentation websites."
|
|
4
4
|
noStyle: true
|
|
5
5
|
components:
|
|
@@ -7,13 +7,9 @@ components:
|
|
|
7
7
|
favicon: true
|
|
8
8
|
css: false
|
|
9
9
|
theme: false
|
|
10
|
-
scripts:
|
|
11
|
-
themeToggle: false
|
|
12
|
-
lightbox: false
|
|
10
|
+
scripts: false
|
|
13
11
|
customHead: |
|
|
14
|
-
<
|
|
15
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
16
|
-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=PT+Mono:wght@700&display=swap" rel="stylesheet">
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
17
13
|
<link rel="stylesheet" href="/assets/css/welcome.css">
|
|
18
14
|
<script>
|
|
19
15
|
// Initialize theme from localStorage or system preference
|
|
@@ -26,7 +22,7 @@ customHead: |
|
|
|
26
22
|
document.body.setAttribute('data-theme', prefersDark ? 'dark' : 'light');
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
|
-
|
|
25
|
+
|
|
30
26
|
// Toggle theme between light and dark
|
|
31
27
|
function toggleTheme() {
|
|
32
28
|
const currentTheme = document.body.getAttribute('data-theme');
|
|
@@ -34,7 +30,7 @@ customHead: |
|
|
|
34
30
|
document.body.setAttribute('data-theme', newTheme);
|
|
35
31
|
localStorage.setItem('docmd-theme', newTheme);
|
|
36
32
|
}
|
|
37
|
-
|
|
33
|
+
|
|
38
34
|
// Run on page load
|
|
39
35
|
document.addEventListener('DOMContentLoaded', initTheme);
|
|
40
36
|
</script>
|
|
@@ -101,8 +97,6 @@ customHead: |
|
|
|
101
97
|
</div>
|
|
102
98
|
</div>
|
|
103
99
|
|
|
104
|
-
<a href="https://www.producthunt.com/posts/docmd?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-docmd" target="_blank" style="margin-bottom: .5em;"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=963681&theme=dark&t=1747100482899" alt="docmd - Generate beautiful, light documentation sites from Markdown. | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54"></a>
|
|
105
|
-
|
|
106
100
|
<div class="buttons">
|
|
107
101
|
<a href="/getting-started/" class="btn btn-primary">
|
|
108
102
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-rocket-icon lucide-rocket"><path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"/><path d="m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"/><path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"/><path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"/></svg>
|
|
@@ -118,26 +112,26 @@ customHead: |
|
|
|
118
112
|
<a href="https://github.com/sponsors/mgks" target="_blank" rel="noopener" class="social-link" title="Buy me a Coffee – GitHub Sponsors">
|
|
119
113
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-heart-handshake-icon lucide-heart-handshake"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/><path d="M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66"/><path d="m18 15-2-2"/><path d="m15 18-2-2"/></svg>
|
|
120
114
|
</a>
|
|
121
|
-
|
|
115
|
+
<a href="https://twitter.com/share?url=https://docmd.mgks.dev" target="_blank" rel="noopener" class="social-link">
|
|
122
116
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4.5-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z"></path></svg>
|
|
123
|
-
</a
|
|
117
|
+
</a>
|
|
124
118
|
</div>
|
|
125
119
|
</div>
|
|
126
120
|
|
|
127
121
|
<div class="preview-side">
|
|
128
122
|
<div class="preview-stack">
|
|
129
123
|
<div class="preview-image top">
|
|
130
|
-
<img src="/assets/images/preview-light-1.
|
|
131
|
-
<img src="/assets/images/preview-dark-1.
|
|
124
|
+
<img src="/assets/images/preview-light-1.webp" alt="docmd documentation preview" class="light-img" loading="lazy">
|
|
125
|
+
<img src="/assets/images/preview-dark-1.webp" alt="docmd documentation preview" class="dark-img" loading="lazy">
|
|
132
126
|
</div>
|
|
133
127
|
<div class="preview-image middle">
|
|
134
|
-
<img src="/assets/images/preview-light-2.
|
|
135
|
-
<img src="/assets/images/preview-dark-2.
|
|
128
|
+
<img src="/assets/images/preview-light-2.webp" alt="docmd documentation preview" class="light-img" loading="lazy">
|
|
129
|
+
<img src="/assets/images/preview-dark-2.webp" alt="docmd documentation preview" class="dark-img" loading="lazy">
|
|
136
130
|
</div>
|
|
137
131
|
<div class="preview-image bottom">
|
|
138
|
-
<img src="/assets/images/preview-light-3.
|
|
139
|
-
<img src="/assets/images/preview-dark-3.
|
|
132
|
+
<img src="/assets/images/preview-light-3.webp" alt="docmd documentation preview" class="light-img" loading="lazy">
|
|
133
|
+
<img src="/assets/images/preview-dark-3.webp" alt="docmd documentation preview" class="dark-img" loading="lazy">
|
|
140
134
|
</div>
|
|
141
135
|
</div>
|
|
142
136
|
</div>
|
|
143
|
-
</div>
|
|
137
|
+
</div>
|
package/docs/plugins/seo.md
CHANGED
|
@@ -62,6 +62,7 @@ image: "/assets/images/widgets/super-widget-social.jpg" # Used for og:image and
|
|
|
62
62
|
ogType: "article" # Specify Open Graph type, e.g., article, website
|
|
63
63
|
twitterCreator: "@widgetMaster"
|
|
64
64
|
keywords: "widget, configuration, advanced, performance, security" # Optional, some argue keywords meta tag is less relevant now
|
|
65
|
+
permalink: "https://example.com/docs/widgets/advanced-configuration" # Canonical URL
|
|
65
66
|
---
|
|
66
67
|
|
|
67
68
|
# Advanced Widget Configuration
|
|
@@ -75,5 +76,6 @@ Supported frontmatter fields that the `seo` plugin may look for:
|
|
|
75
76
|
* `twitterCard` (Overrides `config.seo.twitter.cardType` for this page)
|
|
76
77
|
* `twitterCreator` (Overrides `config.seo.twitter.creatorUsername` for this page)
|
|
77
78
|
* `noindex` (Boolean): If `true`, adds `<meta name="robots" content="noindex">` to discourage search engines from indexing this specific page.
|
|
79
|
+
* `permalink` (String): If provided, sets a canonical URL for the page. This is useful when you have duplicate content across different URLs and want to indicate the preferred version. If not specified, the page's URL will be used as the canonical URL. (Note: `canonicalUrl` is also supported for backward compatibility)
|
|
78
80
|
|
|
79
81
|
By configuring the `seo` plugin and utilizing frontmatter effectively, you can significantly improve how your documentation is presented and discovered online.
|
package/docs/plugins/sitemap.md
CHANGED
|
@@ -85,4 +85,4 @@ sitemap: false
|
|
|
85
85
|
|
|
86
86
|
## Verifying Your Sitemap
|
|
87
87
|
|
|
88
|
-
After building your site, check the generated sitemap at `your-site/sitemap.xml`. You can also submit the sitemap URL to search engines like Google Search Console or Bing Webmaster Tools to help them discover and index your content more efficiently.
|
|
88
|
+
After building your site, check the generated sitemap at `your-site/sitemap.xml`. You can also submit the sitemap URL to search engines like Google Search Console or Bing Webmaster Tools to help them discover and index your content more efficiently.
|
|
@@ -123,4 +123,4 @@ For more information on deployment, see the [Deployment](/deployment/) documenta
|
|
|
123
123
|
## Related Topics
|
|
124
124
|
|
|
125
125
|
- [Custom CSS & JS](/theming/custom-css-js/) - Learn how to configure custom CSS and JavaScript
|
|
126
|
-
- [Theming](/theming/) - Explore other theming options for your documentation site
|
|
126
|
+
- [Theming](/theming/) - Explore other theming options for your documentation site
|
|
@@ -7,79 +7,72 @@ description: "An overview of the built-in themes provided by docmd."
|
|
|
7
7
|
|
|
8
8
|
`docmd` allows you to choose from a selection of built-in themes to quickly change the overall look and feel of your documentation site. You can specify the theme in your `config.js` file using the `theme.name` property.
|
|
9
9
|
|
|
10
|
-
## 1. `default` Theme
|
|
11
|
-
|
|
12
|
-
* **`theme.name: 'default'`** (This is the default if `theme.name` is not specified)
|
|
13
|
-
* **Description:** The standard `docmd` theme. It's designed to be clean, modern, responsive, and highly readable. It features:
|
|
14
|
-
* A collapsible sidebar for navigation.
|
|
15
|
-
* Support for light and dark color modes.
|
|
16
|
-
* Clear typography optimized for documentation.
|
|
17
|
-
* Well-styled custom containers (callouts, cards, steps).
|
|
18
|
-
* Effective syntax highlighting for code blocks.
|
|
19
|
-
* **When to use:** A great general-purpose theme suitable for most documentation projects.
|
|
20
|
-
|
|
21
10
|
```javascript
|
|
22
11
|
// config.js
|
|
23
12
|
module.exports = {
|
|
24
13
|
// ...
|
|
25
14
|
theme: {
|
|
26
|
-
name: 'default',
|
|
27
|
-
defaultMode: 'light',
|
|
15
|
+
name: 'theme-name', // Options: 'default', 'sky', 'ruby', 'retro'
|
|
16
|
+
defaultMode: 'light', // or 'dark' to set as landing mode
|
|
28
17
|
// ...
|
|
29
18
|
},
|
|
30
19
|
// ...
|
|
31
20
|
};
|
|
32
21
|
```
|
|
33
22
|
|
|
23
|
+
## 1. `default` Theme
|
|
24
|
+
|
|
25
|
+
* **`theme.name: 'default'`**
|
|
26
|
+
* **Description:** The foundation of all docmd themes. This is not a separate theme but the base styling that's always included regardless of which theme you select. It provides:
|
|
27
|
+
* Basic layout structure with sidebar and content area
|
|
28
|
+
* Essential typography and spacing
|
|
29
|
+
* Core styling for documentation elements like code blocks, tables, and custom containers
|
|
30
|
+
* Light and dark mode foundation
|
|
31
|
+
* **When to use:** When you want a minimalist, clean interface without additional styling layers. This is the most lightweight option.
|
|
32
|
+
|
|
34
33
|
## 2. `sky` Theme
|
|
35
34
|
|
|
36
|
-
* **`theme.name: 'sky'`**
|
|
35
|
+
* **`theme.name: 'sky'`** (This is the default if `theme.name` is not specified)
|
|
37
36
|
* **Description:** A modern theme inspired by popular documentation platforms, with a fresh and airy design. It features:
|
|
38
|
-
* A clean, minimalist interface with subtle shadows and rounded corners
|
|
39
|
-
* Custom typography with improved readability
|
|
40
|
-
* Refined color palette for both light and dark modes
|
|
41
|
-
* Enhanced callout and container styles
|
|
42
|
-
* Premium documentation feel with careful attention to spacing and contrast
|
|
37
|
+
* A clean, minimalist interface with subtle shadows and rounded corners
|
|
38
|
+
* Custom typography with improved readability
|
|
39
|
+
* Refined color palette for both light and dark modes
|
|
40
|
+
* Enhanced callout and container styles
|
|
41
|
+
* Premium documentation feel with careful attention to spacing and contrast
|
|
43
42
|
* **When to use:** When you want a premium, polished look for your documentation site.
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
enableModeToggle: true, // Show a toggle button in the sidebar
|
|
70
|
-
// ...
|
|
71
|
-
},
|
|
72
|
-
// ...
|
|
73
|
-
};
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Users can switch between modes using the toggle button in the sidebar, and their preference will be saved in localStorage for future visits.
|
|
44
|
+
## 3. `ruby` Theme
|
|
45
|
+
|
|
46
|
+
* **`theme.name: 'ruby'`**
|
|
47
|
+
* **Description:** An elegant, vibrant theme inspired by the precious gemstone. It features:
|
|
48
|
+
* Rich, jewel-toned color palette centered around ruby reds and complementary colors
|
|
49
|
+
* Sophisticated typography with serif headings and sans-serif body text
|
|
50
|
+
* Distinctive card and callout designs with gem-like faceted styling
|
|
51
|
+
* Subtle gradients and depth effects that evoke the brilliance of gemstones
|
|
52
|
+
* Luxurious dark mode with deep, rich backgrounds and vibrant accent colors
|
|
53
|
+
* **When to use:** When you want your documentation to have a distinctive, premium feel with rich colors and elegant typography.
|
|
54
|
+
|
|
55
|
+
## 4. `retro` Theme
|
|
56
|
+
|
|
57
|
+
* **`theme.name: 'retro'`**
|
|
58
|
+
* **Description:** A nostalgic theme inspired by 1980s-90s computing aesthetics. It features:
|
|
59
|
+
* Terminal-style black backgrounds with phosphor green text in dark mode
|
|
60
|
+
* Light mode with dark green text on light gray backgrounds
|
|
61
|
+
* Monospace typography (Fira Code) for authentic retro feel
|
|
62
|
+
* Neon accent colors (cyan, pink, amber) with glow effects
|
|
63
|
+
* Animated scanlines and CRT flicker effects
|
|
64
|
+
* Terminal-style code blocks with `[TERMINAL]` labels
|
|
65
|
+
* Retro-styled containers with pixel-art inspired elements
|
|
66
|
+
* Blinking cursor effects on links and active elements
|
|
67
|
+
* **When to use:** Perfect for developer tools, gaming documentation, tech blogs with vintage computing focus, or anyone wanting a unique, eye-catching retro aesthetic.
|
|
77
68
|
|
|
78
69
|
## How Themes Work
|
|
79
70
|
|
|
80
71
|
Each theme consists of CSS files located within `docmd`'s internal assets. When you select a theme name, `docmd` links the corresponding stylesheet in your site's HTML:
|
|
81
72
|
|
|
82
73
|
- `default` theme uses the base CSS with no additional theme stylesheet
|
|
83
|
-
- `sky` theme loads `theme-sky.css` with its custom styling
|
|
74
|
+
- `sky` theme loads `docmd-theme-sky.css` with its custom styling on top of the default CSS
|
|
75
|
+
- `ruby` theme loads `docmd-theme-ruby.css` with its custom styling on top of the default CSS
|
|
76
|
+
- `retro` theme loads `docmd-theme-retro.css` with its custom styling on top of the default CSS
|
|
84
77
|
|
|
85
78
|
You can further customize any chosen theme using the `theme.customCss` option in your `config.js` to add your own overrides or additional styles. See [Custom CSS & JS](/theming/custom-css-js/) for details.
|
|
@@ -16,9 +16,10 @@ You can set the default theme for your site in the `config.js` file:
|
|
|
16
16
|
module.exports = {
|
|
17
17
|
// ... other config ...
|
|
18
18
|
theme: {
|
|
19
|
-
name: 'default', // or 'sky'
|
|
19
|
+
name: 'default', // or 'sky', 'ruby', 'retro'
|
|
20
20
|
defaultMode: 'dark', // Can be 'light' or 'dark'
|
|
21
21
|
enableModeToggle: true, // Enable the toggle button in the UI
|
|
22
|
+
positionMode: 'bottom', // 'top' or 'bottom' - where to show the toggle
|
|
22
23
|
},
|
|
23
24
|
// ...
|
|
24
25
|
};
|
|
@@ -26,7 +27,9 @@ module.exports = {
|
|
|
26
27
|
|
|
27
28
|
* `defaultMode: 'light'`: The site will initially render with the light color scheme.
|
|
28
29
|
* `defaultMode: 'dark'`: The site will initially render with the dark color scheme.
|
|
29
|
-
* `enableModeToggle: true`: Shows a toggle button
|
|
30
|
+
* `enableModeToggle: true`: Shows a toggle button for users to switch modes.
|
|
31
|
+
* `positionMode: 'bottom'`: Places the toggle button at the bottom of the sidebar (default).
|
|
32
|
+
* `positionMode: 'top'`: Places the toggle button in the page header (top right).
|
|
30
33
|
|
|
31
34
|
If `defaultMode` is not specified, it defaults to `'light'`.
|
|
32
35
|
|
|
@@ -62,16 +65,22 @@ body {
|
|
|
62
65
|
|
|
63
66
|
## User Preference Toggle
|
|
64
67
|
|
|
65
|
-
When `enableModeToggle` is set to `true`, a toggle button appears
|
|
68
|
+
When `enableModeToggle` is set to `true`, a toggle button appears that allows users to switch between light and dark modes. The position of this button is controlled by the `positionMode` setting:
|
|
66
69
|
|
|
67
70
|
```javascript
|
|
68
71
|
// config.js
|
|
69
72
|
theme: {
|
|
70
73
|
defaultMode: 'light',
|
|
71
74
|
enableModeToggle: true, // Shows the toggle button
|
|
75
|
+
positionMode: 'bottom', // 'bottom' (sidebar) or 'top' (header)
|
|
72
76
|
},
|
|
73
77
|
```
|
|
74
78
|
|
|
79
|
+
### Toggle Button Positions
|
|
80
|
+
|
|
81
|
+
- **`positionMode: 'bottom'`** (default): The toggle button appears at the bottom of the sidebar
|
|
82
|
+
- **`positionMode: 'top'`**: The toggle button appears in the page header (top right corner)
|
|
83
|
+
|
|
75
84
|
The toggle button uses Lucide icons (`sun` and `moon`) to indicate the current mode and what will happen when clicked.
|
|
76
85
|
|
|
77
86
|
### User Preference Persistence
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgks/docmd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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
|
"bin": {
|
|
7
|
-
"docmd": "
|
|
7
|
+
"docmd": "bin/docmd.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "node ./bin/docmd.js dev",
|
|
@@ -43,9 +43,12 @@
|
|
|
43
43
|
"gray-matter": "^4.0.3",
|
|
44
44
|
"highlight.js": "^11.11.1",
|
|
45
45
|
"lucide-static": "^0.508.0",
|
|
46
|
-
"markdown-it": "^
|
|
46
|
+
"markdown-it-abbr": "^2.0.0",
|
|
47
47
|
"markdown-it-attrs": "^4.3.1",
|
|
48
48
|
"markdown-it-container": "^4.0.0",
|
|
49
|
+
"markdown-it-deflist": "^3.0.0",
|
|
50
|
+
"markdown-it-footnote": "^4.0.0",
|
|
51
|
+
"markdown-it-task-lists": "^2.1.1",
|
|
49
52
|
"ws": "^8.17.0"
|
|
50
53
|
},
|
|
51
54
|
"devDependencies": {
|
|
@@ -53,5 +56,8 @@
|
|
|
53
56
|
"eslint-config-prettier": "^9.1.0",
|
|
54
57
|
"eslint-plugin-node": "^11.1.0",
|
|
55
58
|
"prettier": "^3.2.5"
|
|
59
|
+
},
|
|
60
|
+
"directories": {
|
|
61
|
+
"doc": "docs"
|
|
56
62
|
}
|
|
57
63
|
}
|