@mgks/docmd 0.1.4 → 0.2.1

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.
Files changed (52) hide show
  1. package/README.md +2 -4
  2. package/assets/css/welcome.css +5 -377
  3. package/assets/images/preview-dark-1.webp +0 -0
  4. package/assets/images/preview-dark-2.webp +0 -0
  5. package/assets/images/preview-dark-3.webp +0 -0
  6. package/assets/images/preview-light-1.webp +0 -0
  7. package/assets/images/preview-light-2.webp +0 -0
  8. package/assets/images/preview-light-3.webp +0 -0
  9. package/config.js +40 -6
  10. package/docs/configuration.md +82 -7
  11. package/docs/content/containers/buttons.md +88 -0
  12. package/docs/content/containers/callouts.md +154 -0
  13. package/docs/content/containers/cards.md +93 -0
  14. package/docs/content/containers/index.md +35 -0
  15. package/docs/content/containers/nested-containers.md +329 -0
  16. package/docs/content/containers/steps.md +175 -0
  17. package/docs/content/containers/tabs.md +228 -0
  18. package/docs/content/custom-containers.md +19 -124
  19. package/docs/content/frontmatter.md +2 -2
  20. package/docs/content/no-style-example.md +2 -0
  21. package/docs/content/no-style-pages.md +52 -28
  22. package/docs/index.md +55 -27
  23. package/docs/plugins/seo.md +80 -31
  24. package/docs/theming/available-themes.md +17 -2
  25. package/docs/theming/light-dark-mode.md +12 -3
  26. package/package.json +21 -9
  27. package/src/assets/css/docmd-main.css +5 -806
  28. package/src/assets/css/docmd-theme-retro.css +9 -0
  29. package/src/assets/css/docmd-theme-ruby.css +7 -604
  30. package/src/assets/css/docmd-theme-sky.css +7 -649
  31. package/src/assets/js/docmd-image-lightbox.js +4 -2
  32. package/src/assets/js/docmd-main.js +157 -0
  33. package/src/commands/build.js +62 -120
  34. package/src/commands/dev.js +2 -1
  35. package/src/commands/init.js +23 -1
  36. package/src/core/config-loader.js +2 -0
  37. package/src/core/file-processor.js +669 -373
  38. package/src/core/html-generator.js +49 -40
  39. package/src/core/icon-renderer.js +3 -2
  40. package/src/plugins/analytics.js +5 -1
  41. package/src/plugins/seo.js +114 -62
  42. package/src/plugins/sitemap.js +6 -0
  43. package/src/templates/layout.ejs +40 -8
  44. package/src/templates/no-style.ejs +23 -6
  45. package/src/templates/partials/theme-init.js +26 -0
  46. package/assets/images/preview-dark-1.png +0 -0
  47. package/assets/images/preview-dark-2.png +0 -0
  48. package/assets/images/preview-dark-3.png +0 -0
  49. package/assets/images/preview-light-1.png +0 -0
  50. package/assets/images/preview-light-2.png +0 -0
  51. package/assets/images/preview-light-3.png +0 -0
  52. package/src/assets/js/docmd-theme-toggle.js +0 -59
package/README.md CHANGED
@@ -70,7 +70,7 @@ Contributions are welcome! Please check our [contributing guidelines](https://do
70
70
 
71
71
  ## License
72
72
 
73
- `docmd` is licensed under the [MIT License](LICENSE).
73
+ `docmd` is licensed under the [MIT License](https://github.com/mgks/docmd/blob/main/LICENSE).
74
74
 
75
75
  ## Support the Project
76
76
 
@@ -80,6 +80,4 @@ If you find `docmd` useful, please consider:
80
80
  - Sharing it with others who might benefit
81
81
  - Reporting issues or submitting pull requests
82
82
 
83
- **[GitHub Sponsors](https://github.com/sponsors/mgks): Become a monthly or one-time GitHub sponsor to support docmd & other projects developed by [me](https://mgks.dev).**
84
-
85
- <br /><img src="https://forthebadge.com/images/badges/built-with-love.svg" alt="Built with Love">
83
+ **[GitHub Sponsors](https://github.com/sponsors/mgks): Become a monthly or one-time GitHub sponsor to support docmd & other projects developed by [me](https://mgks.dev).**
@@ -1,378 +1,6 @@
1
- :root {
2
- --primary-color: #047bf1;
3
- --primary-hover: #026ed9;
4
- --text-color: #333;
5
- --text-light: #666;
6
- --bg-color: #fff;
7
- --bg-secondary: #f8f9fa;
8
- --border-color: #eaeaea;
9
- --shadow-color: rgba(0, 0, 0, 0.08);
10
- --container-padding: 5rem;
11
- }
12
-
13
- @media (prefers-color-scheme: dark) {
14
- :root {
15
- --primary-color: #047bf1;
16
- --primary-hover: #026ed9;
17
- --text-color: #e0e0e0;
18
- --text-light: #aaa;
19
- --bg-color: #121212;
20
- --bg-secondary: #1e1e1e;
21
- --border-color: #333;
22
- --shadow-color: rgba(0, 0, 0, 0.3);
23
- }
24
- }
25
-
26
- [data-theme="light"] {
27
- --primary-color: #047bf1;
28
- --primary-hover: #026ed9;
29
- --text-color: #333;
30
- --text-light: #666;
31
- --bg-color: #fff;
32
- --bg-secondary: #f8f9fa;
33
- --border-color: #eaeaea;
34
- --shadow-color: rgba(0, 0, 0, 0.35);
1
+ /*
2
+ * Source file from the docmd project — https://github.com/mgks/docmd
3
+ * Configuration for the docmd project's own documentation
4
+ */
35
5
 
36
- }
37
-
38
- [data-theme="dark"] {
39
- --primary-color: #1955b6;
40
- --primary-hover: #084dbd;
41
- --text-color: #e0e0e0;
42
- --text-light: #aaa;
43
- --bg-color: #121212;
44
- --bg-secondary: #1e1e1e;
45
- --border-color: #333;
46
- --shadow-color: rgba(0, 0, 0, 0.87);
47
-
48
- }
49
-
50
- * {
51
- margin: 0;
52
- padding: 0;
53
- box-sizing: border-box;
54
- }
55
-
56
- body {
57
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
58
- line-height: 1.5;
59
- color: var(--text-color);
60
- background-color: var(--bg-color);
61
- height: 100vh;
62
- display: flex;
63
- overflow: hidden;
64
- }
65
-
66
- .landing-container {
67
- display: flex;
68
- width: 100%;
69
- height: 100%;
70
- padding: 0 var(--container-padding);
71
- max-width: 1600px;
72
- margin: 0 auto;
73
- }
74
-
75
- .content-side {
76
- flex: 1;
77
- padding: 3rem 2rem 3rem 0;
78
- display: flex;
79
- flex-direction: column;
80
- justify-content: center;
81
-
82
- }
83
-
84
- .preview-side {
85
- flex: 1;
86
- display: flex;
87
- align-items: center;
88
- justify-content: flex-start;
89
- position: relative;
90
- overflow: visible;
91
- }
92
-
93
- .header-top {
94
- position: absolute;
95
- top: 2rem;
96
- right: 3rem;
97
- z-index: 100;
98
-
99
- }
100
-
101
- .theme-toggle {
102
- background: var(--bg-secondary);
103
- border: 1px solid var(--border-color);
104
- color: var(--text-color);
105
- width: 40px;
106
- height: 40px;
107
- border-radius: 50%;
108
- display: flex;
109
- align-items: center;
110
- justify-content: center;
111
- cursor: pointer;
112
- transition: all 0.2s ease;
113
- }
114
-
115
- .theme-toggle:hover {
116
- background: var(--border-color);
117
- }
118
-
119
- .logo {
120
- margin-bottom: 1.5rem;
121
- display: flex;
122
- align-items: center;
123
- }
124
-
125
- .logo svg {
126
- height: 48px;
127
- width: auto;
128
- }
129
-
130
- .logo-text {
131
- font-family: 'PT Mono', monospace;
132
- font-weight: 700;
133
- font-size: 2em;
134
- margin-left: .25em;
135
-
136
- }
137
-
138
- h1 {
139
- font-size: 3rem;
140
- font-weight: 700;
141
- margin-bottom: 1rem;
142
- letter-spacing: -0.02em;
143
- }
144
-
145
- .tagline {
146
- font-size: 1.25rem;
147
- color: var(--text-light);
148
- margin-bottom: 2rem;
149
- font-weight: 400;
150
- }
151
-
152
- .features {
153
- display: grid;
154
- grid-template-columns: repeat(2, 1fr);
155
- gap: 1.5rem;
156
- margin-bottom: 2rem;
157
- }
158
-
159
- .feature {
160
- display: flex;
161
- align-items: flex-start;
162
- gap: 0.75rem;
163
- }
164
-
165
- .feature-icon {
166
- background-color: var(--primary-color);
167
- color: white;
168
- width: 32px;
169
- height: 32px;
170
- border-radius: 6px;
171
- display: flex;
172
- align-items: center;
173
- justify-content: center;
174
- flex-shrink: 0;
175
- }
176
-
177
- .feature-text {
178
- font-size: 0.9rem;
179
- }
180
-
181
- .feature-text strong {
182
- display: block;
183
- margin-bottom: 0.25rem;
184
- }
185
-
186
- .buttons {
187
- display: flex;
188
- gap: 1rem;
189
- margin-bottom: 2rem;
190
- }
191
-
192
- .btn {
193
- display: inline-flex;
194
- align-items: center;
195
- gap: 0.5rem;
196
- padding: 0.75rem 1.5rem;
197
- border-radius: 8px;
198
- font-weight: 600;
199
- font-size: 1rem;
200
- text-decoration: none;
201
- transition: all 0.2s ease;
202
- }
203
-
204
- .btn-primary {
205
- background-color: var(--primary-color);
206
- color: white;
207
- border: none;
208
- }
209
-
210
- .btn-primary:hover {
211
- background-color: var(--primary-hover);
212
- }
213
-
214
- .btn-secondary {
215
- background-color: var(--bg-secondary);
216
- color: var(--text-color);
217
- border: 1px solid var(--border-color);
218
- }
219
-
220
- .btn-secondary:hover {
221
- background-color: var(--border-color);
222
- }
223
-
224
- .social-links {
225
- display: flex;
226
- gap: 1rem;
227
- padding: 0 .25em;
228
-
229
- }
230
-
231
- .social-link {
232
- color: var(--text-light);
233
- transition: color 0.2s ease;
234
- }
235
-
236
- .social-link:hover {
237
- color: var(--primary-color);
238
- }
239
-
240
- .preview-stack {
241
- position: relative;
242
- width: 100%;
243
- height: 400px;
244
- transform: translateX(15%);
245
- perspective: 1000px;
246
-
247
- }
248
-
249
- .preview-image {
250
- position: absolute;
251
- width: 100%;
252
- max-width: 700px;
253
- height: 400px;
254
- border-radius: 20px;
255
- box-shadow: 0 25px 50px -12px var(--shadow-color);
256
- transition: all 0.3s ease;
257
- overflow: hidden;
258
-
259
- }
260
-
261
- .preview-image img {
262
- width: 100%;
263
- height: 100%;
264
- object-fit: cover;
265
- object-position: left top;
266
- border-radius: 8px;
267
- pointer-events: none;
268
- }
269
-
270
- .preview-image.top {
271
- z-index: 3;
272
- transform: rotate(3deg) translateY(-10%) translateX(7%);
273
-
274
- }
275
-
276
- .preview-image.middle {
277
- z-index: 2;
278
- transform: rotate(-3deg) translateY(1%) translateX(-2%);
279
-
280
- }
281
-
282
- .preview-image.bottom {
283
- z-index: 1;
284
- transform: rotate(-8deg) translateY(10%) translateX(-10%);
285
-
286
- }
287
-
288
- body[data-theme="light"] .preview-image .light-img {
289
- display: block;
290
- }
291
-
292
- body[data-theme="light"] .preview-image .dark-img {
293
- display: none;
294
- }
295
-
296
- body[data-theme="dark"] .preview-image .light-img {
297
- display: none;
298
-
299
- }
300
-
301
- body[data-theme="dark"] .preview-image .dark-img {
302
- display: block;
303
- }
304
-
305
- @media (max-width: 1400px) {
306
- :root {
307
- --container-padding: 3rem;
308
- }
309
-
310
- .preview-stack {
311
- transform: translateX(15%);
312
- }
313
- }
314
-
315
- @media (max-width: 1200px) {
316
- :root {
317
- --container-padding: 2rem;
318
- }
319
-
320
- .preview-side {
321
- display: none;
322
- }
323
-
324
- .content-side {
325
- max-width: 100%;
326
- padding: 3rem 0;
327
- }
328
-
329
- .header-top {
330
- right: 2rem;
331
- }
332
- }
333
-
334
- @media (max-width: 768px) {
335
- :root {
336
- --container-padding: 1.5rem;
337
- }
338
- body {
339
- overflow: auto;
340
- }
341
-
342
- .content-side {
343
- padding: 2rem 0;
344
- }
345
-
346
- h1 {
347
- font-size: 2.5rem;
348
- }
349
-
350
- .features {
351
- grid-template-columns: 1fr;
352
- }
353
-
354
- .buttons {
355
- flex-direction: column;
356
- }
357
-
358
- .header-top {
359
- padding: 1rem 0;
360
- text-align: center;
361
- right: 1rem;
362
- }
363
- h1 {
364
- font-size: 2.5rem;
365
- }
366
- .tagline{
367
- font-size: 1em;
368
- font-weight: 500;
369
- }
370
- .landing-container {
371
- padding: 1rem;
372
- flex-direction: column;
373
- }
374
- }
375
- .social-links .lucide-heart-handshake {
376
- color: rgb(205, 39, 39);
377
-
378
- }
6
+ :root,html[data-theme=light]{--primary-color:#047bf1;--primary-hover:#026ed9;--text-color:#333;--text-light:#666;--bg-color:#fff;--bg-secondary:#f8f9fa;--border-color:#eaeaea}.theme-toggle,body{color:var(--text-color);display:flex}.logo-text,h1{font-weight:700}.install-code pre,.logo-text{font-family:'PT Mono',monospace}:root{--shadow-color:#00000014;--container-padding:5rem}@media (prefers-color-scheme:dark){:root{--primary-color:#047bf1;--primary-hover:#026ed9;--text-color:#e0e0e0;--text-light:#aaa;--bg-color:#121212;--bg-secondary:#1e1e1e;--border-color:#333;--shadow-color:#0000004d}}[data-theme=light]{--shadow-color:#00000059}[data-theme=dark]{--primary-color:#1955b6;--primary-hover:#084dbd;--text-color:#e0e0e0;--text-light:#aaa;--bg-color:#121212;--bg-secondary:#1e1e1e;--border-color:#333;--shadow-color:#000000de}*{margin:0;padding:0;box-sizing:border-box}body{font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;line-height:1.5;background-color:var(--bg-color);height:100vh;overflow:hidden}.landing-container{display:flex;width:100%;height:100%;padding:0 var(--container-padding);max-width:1600px;margin:0 auto}.content-side{flex:1;padding:3rem 2rem 3rem 0;display:flex;flex-direction:column;justify-content:center}.preview-side{flex:1;display:flex;align-items:center;justify-content:flex-start;position:relative;overflow:visible}.header-top{position:absolute;top:2rem;right:3rem;z-index:100}.theme-toggle{background:var(--bg-secondary);border:1px solid var(--border-color);width:40px;height:40px;border-radius:50%;align-items:center;justify-content:center;cursor:pointer;transition:.2s}.theme-toggle:hover{background:var(--border-color)}.logo{margin-bottom:1.5rem;display:flex;align-items:center}.buttons,.features,.install-section,.tagline{margin-bottom:2rem}.logo svg{height:48px;width:auto}.logo-text{font-size:2em;margin-left:.25em}h1{font-size:3rem;margin-bottom:1rem;letter-spacing:-.02em}.tagline{font-size:1.25rem;color:var(--text-light);font-weight:400}.btn-primary,.feature-icon{background-color:var(--primary-color);color:#fff}.features{display:grid;grid-template-columns:repeat(2,1fr);gap:1.5rem}.feature{display:flex;align-items:flex-start;gap:.75rem}.feature-icon{width:32px;height:32px;border-radius:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.feature-text{font-size:.9rem}.feature-text strong{display:block;margin-bottom:.25rem}.buttons{display:flex;gap:1rem}.btn{display:inline-flex;align-items:center;gap:.5rem;padding:.75rem 1.5rem;border-radius:8px;font-weight:600;font-size:1rem;text-decoration:none;transition:.2s}.btn-primary{border:none}.btn-secondary,.install-code pre{background-color:var(--bg-secondary);border:1px solid var(--border-color)}.btn-primary:hover{background-color:var(--primary-hover)}.btn-secondary{color:var(--text-color)}.btn-secondary:hover{background-color:var(--border-color)}.social-links{display:flex;gap:1rem;padding:0 .25em}.social-link{color:var(--text-light);transition:color .2s}.social-link:hover{color:var(--primary-color)}.preview-stack{position:relative;width:100%;height:400px;transform:translateX(15%);perspective:1000px}.preview-image{position:absolute;width:100%;max-width:700px;height:400px;border-radius:20px;box-shadow:0 25px 50px -12px var(--shadow-color);transition:.3s;overflow:hidden}.preview-image img{width:100%;height:100%;object-fit:cover;object-position:left top;border-radius:8px;pointer-events:none}.preview-image.top{z-index:3;transform:rotate(3deg) translateY(-10%) translateX(7%)}.preview-image.middle{z-index:2;transform:rotate(-3deg) translateY(1%) translateX(-2%)}.preview-image.bottom{z-index:1;transform:rotate(-8deg) translateY(10%) translateX(-10%)}[data-theme=dark] .preview-image .dark-img,[data-theme=light] .preview-image .light-img{display:block}[data-theme=dark] .preview-image .light-img,[data-theme=light] .preview-image .dark-img{display:none}@media (max-width:1400px){:root{--container-padding:3rem}.preview-stack{transform:translateX(15%)}}@media (max-width:1200px){:root{--container-padding:2rem}.preview-side{display:none}.content-side{max-width:100%;padding:3rem 0}.header-top{right:2rem}}@media (max-width:768px){:root{--container-padding:1.5rem}body{overflow:auto}.content-side{padding:2rem 0}.features{grid-template-columns:1fr}.buttons{flex-direction:column}.header-top{padding:1rem 0;text-align:center;right:1rem}h1{font-size:2.5rem}.tagline{font-size:1em;font-weight:500}.landing-container{padding:1rem;flex-direction:column}}.social-links .lucide-heart-handshake{color:#cd2727}.install-code{position:relative;display:inline-block}.install-code pre{border-radius:8px;padding:1rem 3.5rem 1rem 1rem;margin:0;font-size:.9rem;color:var(--text-color)}.install-code code{background:0 0;padding:0;color:inherit}.copy-button{position:absolute;top:.5rem;right:.5rem;background:var(--bg-color);border:1px solid var(--border-color);border-radius:4px;padding:.5rem;cursor:pointer;transition:.2s;color:var(--text-light)}.copy-button:hover{background:var(--border-color);color:var(--text-color)}
package/config.js CHANGED
@@ -1,4 +1,6 @@
1
- // config.js (for docmd's own documentation)
1
+ // Source file from the docmd project — https://github.com/mgks/docmd
2
+
3
+ // Configuration for the docmd project's own documentation
2
4
  module.exports = {
3
5
  // Core Site Metadata
4
6
  siteTitle: 'docmd',
@@ -18,15 +20,22 @@ module.exports = {
18
20
  srcDir: 'docs', // Source directory for Markdown files
19
21
  outputDir: 'site', // Directory for generated static site
20
22
 
23
+ // Sidebar Configuration
24
+ sidebar: {
25
+ collapsible: true, // or false to disable
26
+ defaultCollapsed: false, // or true to start collapsed
27
+ },
28
+
21
29
  // Theme Configuration
22
30
  theme: {
23
- name: 'sky', // Themes: 'default', 'sky'
31
+ name: 'sky', // Themes: 'default', 'sky', 'retro', 'ruby'
24
32
  defaultMode: 'light', // Initial color mode: 'light' or 'dark'
25
33
  enableModeToggle: true, // Show UI button to toggle light/dark modes
34
+ positionMode: 'top', // 'top' or 'bottom' for the theme toggle
35
+ codeHighlight: true, // Enable/disable codeblock highlighting and import of highlight.js
26
36
  customCss: [ // Array of paths to custom CSS files
27
37
  // '/assets/css/custom.css', // Custom TOC styles
28
38
  ],
29
- // options: { /* Future: theme-specific options */ }
30
39
  },
31
40
 
32
41
  // Custom JavaScript Files
@@ -34,12 +43,17 @@ module.exports = {
34
43
  '/assets/js/docmd-image-lightbox.js', // Image lightbox functionality
35
44
  ],
36
45
 
46
+ // Content Processing
47
+ autoTitleFromH1: true, // Set to true to automatically use the first H1 as page title
48
+ copyCode: true, // Enable/disable the copy code button on code blocks
49
+
37
50
  // Plugins Configuration (Object format)
38
51
  // Plugins are configured here. docmd will look for these keys.
39
52
  plugins: {
40
53
  // SEO Plugin Configuration
41
- // Most SEO data is pulled from page frontmatter (title, description, image, etc.)
42
- // These are fallbacks or site-wide settings.
54
+ // These are site-wide fallbacks. For detailed per-page SEO controls,
55
+ // including structured data (LD+JSON), use the `seo` key in your page's frontmatter.
56
+ // See the SEO plugin documentation for all available frontmatter options.
43
57
  seo: {
44
58
  // Default meta description if a page doesn't have one in its frontmatter
45
59
  defaultDescription: 'docmd is a Node.js command-line tool for generating beautiful, lightweight static documentation sites from Markdown files.',
@@ -79,6 +93,7 @@ module.exports = {
79
93
  navigation: [
80
94
  { title: 'Welcome', path: '/', icon: 'feather' },
81
95
  { title: 'Overview', path: '/overview', icon: 'home' },
96
+ // { title: 'Support the Project', path: 'https://github.com/sponsors/mgks', icon: 'heart', external: true },
82
97
  {
83
98
  title: 'Getting Started',
84
99
  icon: 'rocket',
@@ -96,7 +111,19 @@ module.exports = {
96
111
  { title: 'Frontmatter', path: '/content/frontmatter', icon: 'file-text' },
97
112
  { title: 'Markdown Syntax', path: '/content/markdown-syntax', icon: 'code-2' },
98
113
  { title: 'Images', path: '/content/images', icon: 'image' },
99
- { title: 'Custom Containers', path: '/content/custom-containers', icon: 'box' },
114
+ {
115
+ title: 'Custom Containers',
116
+ path: '/content/containers/',
117
+ icon: 'box',
118
+ children: [
119
+ { title: 'Callouts', path: '/content/containers/callouts', icon: 'megaphone' },
120
+ { title: 'Cards', path: '/content/containers/cards', icon: 'panel-top' },
121
+ { title: 'Steps', path: '/content/containers/steps', icon: 'list-ordered' },
122
+ { title: 'Tabs', path: '/content/containers/tabs', icon: 'columns-3' },
123
+ { title: 'Buttons', path: '/content/containers/buttons', icon: 'mouse-pointer-click' },
124
+ { title: 'Nested Containers', path: '/content/containers/nested-containers', icon: 'folder-tree' },
125
+ ]
126
+ },
100
127
  { title: 'No-Style Pages', path: '/content/no-style-pages', icon: 'layout' },
101
128
  { title: 'No-Style Example', path: '/content/no-style-example', icon: 'sparkles' },
102
129
  ],
@@ -132,6 +159,13 @@ module.exports = {
132
159
  { title: 'Issues', path: 'https://github.com/mgks/docmd/issues', icon: 'badge-alert', external: true }
133
160
  ],
134
161
 
162
+ // Sponsor Ribbon Configuration
163
+ sponsor: {
164
+ enabled: true, // Enable/disable the sponsor ribbon
165
+ title: 'Support docmd', // Text to display on the ribbon
166
+ link: 'https://github.com/sponsors/mgks', // URL for the sponsor link
167
+ },
168
+
135
169
  // Footer Configuration
136
170
  // Markdown is supported here.
137
171
  footer: '© ' + new Date().getFullYear() + ' Project docmd.',
@@ -23,10 +23,16 @@ module.exports = {
23
23
  srcDir: 'docs',
24
24
  outputDir: 'site',
25
25
 
26
+ sidebar: {
27
+ collapsible: true,
28
+ defaultCollapsed: false,
29
+ },
30
+
26
31
  theme: {
27
- name: 'sky', // Name of the built-in theme to use (e.g., 'sky', 'default')
28
- defaultMode: 'light', // 'light' or 'dark'
29
- enableModeToggle: true, // Show UI button to toggle light/dark modes
32
+ name: 'sky',
33
+ defaultMode: 'light',
34
+ enableModeToggle: true,
35
+ positionMode: 'bottom', // 'top' or 'bottom'
30
36
  customCss: [ // Array of paths to your custom CSS files
31
37
  // '/css/override-styles.css', // Paths are relative to the outputDir root
32
38
  ],
@@ -37,6 +43,15 @@ module.exports = {
37
43
  // '/js/extra-functionality.js', // Loaded at the end of the body
38
44
  ],
39
45
 
46
+ autoTitleFromH1: true,
47
+ copyCode: true,
48
+
49
+ sponsor: {
50
+ enabled: true,
51
+ title: 'Sponsor the Project',
52
+ link: 'https://github.com/sponsors/mgks',
53
+ },
54
+
40
55
  plugins: {
41
56
  // SEO Plugin Configuration
42
57
  seo: {
@@ -110,6 +125,42 @@ module.exports = {
110
125
  * **Default:** `'site'`
111
126
  * **Description:** Directory where the static site will be generated.
112
127
 
128
+ ### `autoTitleFromH1`
129
+ * **Type:** `Boolean`
130
+ * **Default:** `true`
131
+ * **Description:** If `true`, `docmd` will automatically use the content of the first H1 tag (`# Title`) as the page title if no `title` is specified in the frontmatter. If set to `false` and a page has no `title` in its frontmatter, the page header will be hidden.
132
+ * **Example:**
133
+ ```javascript
134
+ // With autoTitleFromH1: true (default)
135
+ // Markdown file with: # My Page Title
136
+ // Will automatically set the page title to "My Page Title"
137
+
138
+ // With autoTitleFromH1: false
139
+ // You must explicitly set title in frontmatter:
140
+ // ---
141
+ // title: "My Page Title"
142
+ // ---
143
+ ```
144
+
145
+ ### `copyCode`
146
+ * **Type:** `Boolean`
147
+ * **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. **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
+
150
+ ## `sidebar` (Object)
151
+
152
+ Configures the behavior of the sidebar.
153
+
154
+ ### `sidebar.collapsible`
155
+ * **Type:** `Boolean`
156
+ * **Default:** `false`
157
+ * **Description:** If `true`, a toggle button is added to the header, allowing users to show or hide the sidebar. The user's preference is saved in `localStorage`.
158
+
159
+ ### `sidebar.defaultCollapsed`
160
+ * **Type:** `Boolean`
161
+ * **Default:** `false`
162
+ * **Description:** If `sidebar.collapsible` is `true`, this option sets the default state of the sidebar to collapsed. A user's saved preference will override this.
163
+
113
164
  ## `theme` (Object)
114
165
 
115
166
  Configures the visual theme of your site.
@@ -131,10 +182,17 @@ Configures the visual theme of your site.
131
182
  * **Default:** `true` (assuming it's now a core feature)
132
183
  * **Description:** If `true`, a UI toggle button will be displayed allowing users to switch between light and dark modes. Their preference is typically saved in `localStorage`.
133
184
 
185
+ ### `theme.positionMode`
186
+ * **Type:** `String`
187
+ * **Default:** `'bottom'`
188
+ * **Values:** `'top'` or `'bottom'`
189
+ * **Description:** Sets the position of the light/dark mode toggle button. `'top'` places it in the page header (top right), while `'bottom'` places it at the bottom of the sidebar.
190
+ * **Example:** `positionMode: 'top'` - Useful for sites where you want the theme toggle to be more prominent and easily accessible.
191
+
134
192
  ### `theme.customCss`
135
193
  * **Type:** `Array` of `String`
136
194
  * **Default:** `[]` (empty array)
137
- * **Description:** An array of paths to your custom CSS files. These files will be linked in the `<head>` of every page *after* the main theme CSS, allowing you to override or extend styles.
195
+ * **Description:** An array of paths to your custom CSS files. These files will be linked in the `<head>` of every regular page *after* the main theme CSS, allowing you to override or extend styles. **Note:** For noStyle pages, custom CSS must be explicitly enabled via `components.customCss: true`.
138
196
  * **Paths:** Should be relative to the `outputDir` root (e.g., `'/css/my-styles.css'`). You are responsible for ensuring these files exist at the specified location in your final `site/` output (e.g., by placing them in an assets folder that `docmd` copies, or in your project's static assets if your `srcDir` is part of a larger project).
139
197
  * **Example:** `customCss: ['/assets/css/custom-branding.css']`
140
198
 
@@ -145,7 +203,7 @@ Configures the visual theme of your site.
145
203
  ## `customJs` (Array of String)
146
204
  * **Type:** `Array` of `String`
147
205
  * **Default:** `[]`
148
- * **Description:** An array of paths to your custom JavaScript files. These files will be included as `<script>` tags just before the closing `</body>` tag on every page.
206
+ * **Description:** An array of paths to your custom JavaScript files. These files will be included as `<script>` tags just before the closing `</body>` tag on every regular page. **Note:** For noStyle pages, custom JavaScript must be explicitly enabled via `components.customJs: true`.
149
207
  * **Paths:** Should be relative to the `outputDir` root (e.g., `'/js/my-analytics-alternative.js'`).
150
208
  * **Example:** `customJs: ['/assets/js/interactive-component.js']`
151
209
 
@@ -170,9 +228,26 @@ Configures the visual theme of your site.
170
228
  * `external` (Boolean, Optional): If set to `true`, the `path` is treated as an absolute external URL and the link will open in a new tab (`target="_blank"`). Defaults to `false`.
171
229
 
172
230
  ## `footer` (String, Optional)
173
- * **Description:** Custom footer text (Markdown supported).
231
+ * **Description:** Custom footer text (Markdown supported). **Note:** For noStyle pages, the footer must be explicitly enabled via `components.footer: true`.
232
+
233
+ ## `sponsor` (Object, Optional)
234
+ * **Type:** `Object`
235
+ * **Description:** Configures a sponsor ribbon that appears in the bottom-right corner of every regular page. **Note:** For noStyle pages, the sponsor ribbon must be explicitly enabled via `components.branding: true`.
236
+ * **Properties:**
237
+ * `enabled` (Boolean, Optional): Whether to show the sponsor ribbon. Defaults to `true` if the sponsor object is provided.
238
+ * `title` (String, Optional): Text to display on the ribbon. Defaults to `'Sponsor the Project'`.
239
+ * `link` (String, Required if enabled): URL for the sponsor link. Should open in a new tab.
240
+ * **Example:**
241
+ ```javascript
242
+ sponsor: {
243
+ enabled: true,
244
+ title: 'Sponsor the Project',
245
+ link: 'https://github.com/sponsors/mgks'
246
+ }
247
+ ```
248
+ * **Note:** The ribbon is positioned fixed in the bottom-right corner and includes a heart icon with a subtle animation.
174
249
 
175
250
  ## `favicon` (String, Optional)
176
- * **Description:** Path to your favicon file, relative to `outputDir` root.
251
+ * **Description:** Path to your favicon file, relative to `outputDir` root. **Note:** For noStyle pages, the favicon must be explicitly enabled via `components.favicon: true`.
177
252
 
178
253
  This file needs significant detail for each new option, explaining its purpose, type, default value, and how to use it with examples.