@mgks/docmd 0.2.8 → 0.2.9
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/config.js +11 -1
- package/docs/configuration.md +29 -1
- package/docs/content/markdown-syntax.md +32 -0
- package/docs/contributing.md +8 -0
- package/package.json +3 -1
- package/src/assets/css/docmd-main.css +427 -329
- package/src/assets/css/docmd-theme-retro.css +860 -1
- package/src/assets/css/docmd-theme-ruby.css +621 -1
- package/src/assets/css/docmd-theme-sky.css +606 -1
- package/src/assets/js/docmd-image-lightbox.js +13 -13
- package/src/assets/js/docmd-main.js +23 -23
- package/src/assets/js/docmd-mermaid.js +28 -29
- package/src/commands/build.js +79 -40
- package/src/commands/init.js +10 -0
- package/src/core/html-generator.js +23 -0
- package/src/core/markdown/setup.js +27 -11
- package/src/templates/layout.ejs +15 -0
package/config.js
CHANGED
|
@@ -19,6 +19,7 @@ module.exports = {
|
|
|
19
19
|
// Directory Configuration
|
|
20
20
|
srcDir: 'docs', // Source directory for Markdown files
|
|
21
21
|
outputDir: 'site', // Directory for generated static site
|
|
22
|
+
minify: true, // Enable/disable HTML/CSS/JS minification
|
|
22
23
|
|
|
23
24
|
// Sidebar Configuration
|
|
24
25
|
sidebar: {
|
|
@@ -88,6 +89,15 @@ module.exports = {
|
|
|
88
89
|
// Add other future plugin configurations here by their key
|
|
89
90
|
},
|
|
90
91
|
|
|
92
|
+
// "Edit this page" Link Configuration
|
|
93
|
+
editLink: {
|
|
94
|
+
enabled: true,
|
|
95
|
+
// The URL to the folder containing your docs in the git repo
|
|
96
|
+
// Note: It usually ends with /edit/main/docs or /blob/main/docs
|
|
97
|
+
baseUrl: 'https://github.com/mgks/docmd/edit/main/docs',
|
|
98
|
+
text: 'Edit this page on GitHub'
|
|
99
|
+
},
|
|
100
|
+
|
|
91
101
|
// Navigation Structure (Sidebar)
|
|
92
102
|
// Icons are kebab-case names from Lucide Icons (https://lucide.dev/)
|
|
93
103
|
navigation: [
|
|
@@ -103,6 +113,7 @@ module.exports = {
|
|
|
103
113
|
{ title: 'Basic Usage', path: '/getting-started/basic-usage', icon: 'play' },
|
|
104
114
|
],
|
|
105
115
|
},
|
|
116
|
+
{ title: 'Configuration', path: '/configuration', icon: 'settings' },
|
|
106
117
|
{
|
|
107
118
|
title: 'Content',
|
|
108
119
|
icon: 'layout-template',
|
|
@@ -133,7 +144,6 @@ module.exports = {
|
|
|
133
144
|
{ title: 'No-Style Example', path: '/content/no-style-example', icon: 'sparkles' },
|
|
134
145
|
],
|
|
135
146
|
},
|
|
136
|
-
{ title: 'Configuration', path: '/configuration', icon: 'settings' },
|
|
137
147
|
{
|
|
138
148
|
title: 'Theming',
|
|
139
149
|
icon: 'palette',
|
package/docs/configuration.md
CHANGED
|
@@ -125,6 +125,14 @@ module.exports = {
|
|
|
125
125
|
* **Default:** `'site'`
|
|
126
126
|
* **Description:** Directory where the static site will be generated.
|
|
127
127
|
|
|
128
|
+
## `minify`
|
|
129
|
+
* **Type:** `Boolean`
|
|
130
|
+
* **Optional**
|
|
131
|
+
* **Default:** `true` when running `docmd build`, `false` when running `docmd dev`.
|
|
132
|
+
* **Description:** Controls whether CSS and JavaScript assets are minified (compressed) during the build.
|
|
133
|
+
* **Usage:** You can force this to `false` if you need to debug production builds.
|
|
134
|
+
* **Example:** `minify: false`
|
|
135
|
+
|
|
128
136
|
### `autoTitleFromH1`
|
|
129
137
|
* **Type:** `Boolean`
|
|
130
138
|
* **Default:** `true`
|
|
@@ -145,7 +153,9 @@ module.exports = {
|
|
|
145
153
|
### `copyCode`
|
|
146
154
|
* **Type:** `Boolean`
|
|
147
155
|
* **Default:** `true`
|
|
148
|
-
* **Description:** If `true`, a "Copy" button will be added to the top-right corner of all code blocks, allowing users to easily copy the code to their clipboard with a single click.
|
|
156
|
+
* **Description:** If `true`, a "Copy" button will be added to the top-right corner of all code blocks, allowing users to easily copy the code to their clipboard with a single click.
|
|
157
|
+
|
|
158
|
+
**Note:** This setting only applies to regular pages. For noStyle pages, copy code functionality must be explicitly enabled via the `components.mainScripts: true` setting.
|
|
149
159
|
|
|
150
160
|
## `sidebar` (Object)
|
|
151
161
|
|
|
@@ -218,6 +228,24 @@ Configures the visual theme of your site.
|
|
|
218
228
|
* `sitemap: { defaultChangefreq: 'weekly', defaultPriority: 0.8 }`
|
|
219
229
|
* **See Also:** [Plugins](/plugins/)
|
|
220
230
|
|
|
231
|
+
## `editLink` (Object, Optional)
|
|
232
|
+
* **Type:** `Object`
|
|
233
|
+
* **Description:** Configures a link in the page footer that points to the source file on GitHub (or GitLab/Bitbucket), allowing users to propose changes.
|
|
234
|
+
* **Properties:**
|
|
235
|
+
* `enabled` (Boolean): Set to `true` to show the link.
|
|
236
|
+
* `baseUrl` (String): The base URL to your repository's documentation source folder.
|
|
237
|
+
* *GitHub Example:* `https://github.com/USERNAME/REPO/edit/main/docs`
|
|
238
|
+
* *Note:* Do not include a trailing slash. `docmd` appends the file path automatically.
|
|
239
|
+
* `text` (String, Optional): The text to display. Defaults to "Edit this page".
|
|
240
|
+
* **Example:**
|
|
241
|
+
```javascript
|
|
242
|
+
editLink: {
|
|
243
|
+
enabled: true,
|
|
244
|
+
baseUrl: 'https://github.com/mgks/docmd/edit/main/docs',
|
|
245
|
+
text: 'Edit on GitHub'
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
221
249
|
## `navigation` (Array of Objects)
|
|
222
250
|
* **Description:** Defines the sidebar navigation. (Content mostly same as before, but add the `icon` property explanation).
|
|
223
251
|
* **Navigation Item Properties:**
|
|
@@ -197,6 +197,38 @@ docmd supports GitHub Flavored Markdown extensions including:
|
|
|
197
197
|
|
|
198
198
|
Renders emoji symbols like: I ❤️ documentation! 🚀 😄
|
|
199
199
|
|
|
200
|
+
## Custom Attributes (IDs and Classes)
|
|
201
|
+
|
|
202
|
+
You can add custom IDs and CSS classes to headers, images, and links using curly braces `{}`.
|
|
203
|
+
|
|
204
|
+
### Custom IDs
|
|
205
|
+
By default, `docmd` generates IDs for headers automatically. You can override this:
|
|
206
|
+
|
|
207
|
+
```markdown
|
|
208
|
+
## My Header {#custom-id}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Custom Classes
|
|
212
|
+
Add styling classes to elements:
|
|
213
|
+
|
|
214
|
+
```markdown
|
|
215
|
+
## Styled Header {.text-center .text-red}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Links and Buttons
|
|
219
|
+
Create buttons using standard links and classes:
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
[Download Now](/download){.btn .btn-primary}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Images
|
|
226
|
+
Control image styling directly:
|
|
227
|
+
|
|
228
|
+
```markdown
|
|
229
|
+
{width="100%" .shadow-lg}
|
|
230
|
+
```
|
|
231
|
+
|
|
200
232
|
## Footnotes
|
|
201
233
|
|
|
202
234
|
You can add footnotes to your content for references or additional information[^1].
|
package/docs/contributing.md
CHANGED
|
@@ -65,6 +65,14 @@ To enable live change tracking for internal files during development, set the DO
|
|
|
65
65
|
- **Temporarily:** Run `export DOCMD_DEV=true` in your terminal before starting the dev server.
|
|
66
66
|
- **Permanently:** Add `export DOCMD_DEV=true` to your `~/.zshrc` file and run `source ~/.zshrc`.
|
|
67
67
|
|
|
68
|
+
### Debugging Build Issues
|
|
69
|
+
|
|
70
|
+
If you are working on the build process and need to see detailed logs about asset processing or minification, you can run:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
DOCMD_DEBUG=true docmd build
|
|
74
|
+
```
|
|
75
|
+
|
|
68
76
|
## Pull Request Process
|
|
69
77
|
|
|
70
78
|
Once you're satisfied with your changes:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgks/docmd",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
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": {
|
|
@@ -44,8 +44,10 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"chalk": "^4.1.2",
|
|
46
46
|
"chokidar": "^4.0.3",
|
|
47
|
+
"clean-css": "^5.3.3",
|
|
47
48
|
"commander": "^14.0.0",
|
|
48
49
|
"ejs": "^3.1.9",
|
|
50
|
+
"esbuild": "^0.27.0",
|
|
49
51
|
"express": "^5.1.0",
|
|
50
52
|
"fs-extra": "^11.2.0",
|
|
51
53
|
"gray-matter": "^4.0.3",
|