@mgks/docmd 0.3.11 → 0.4.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 (47) hide show
  1. package/README.md +15 -160
  2. package/bin/docmd.js +6 -69
  3. package/package.json +17 -57
  4. package/bin/postinstall.js +0 -14
  5. package/src/assets/css/docmd-highlight-dark.css +0 -86
  6. package/src/assets/css/docmd-highlight-light.css +0 -86
  7. package/src/assets/css/docmd-main.css +0 -1757
  8. package/src/assets/css/docmd-theme-retro.css +0 -867
  9. package/src/assets/css/docmd-theme-ruby.css +0 -629
  10. package/src/assets/css/docmd-theme-sky.css +0 -617
  11. package/src/assets/favicon.ico +0 -0
  12. package/src/assets/images/docmd-logo-dark.png +0 -0
  13. package/src/assets/images/docmd-logo-light.png +0 -0
  14. package/src/assets/js/docmd-image-lightbox.js +0 -74
  15. package/src/assets/js/docmd-main.js +0 -260
  16. package/src/assets/js/docmd-mermaid.js +0 -205
  17. package/src/assets/js/docmd-search.js +0 -218
  18. package/src/commands/build.js +0 -237
  19. package/src/commands/dev.js +0 -352
  20. package/src/commands/init.js +0 -277
  21. package/src/commands/live.js +0 -145
  22. package/src/core/asset-manager.js +0 -72
  23. package/src/core/config-loader.js +0 -58
  24. package/src/core/config-validator.js +0 -80
  25. package/src/core/file-processor.js +0 -103
  26. package/src/core/fs-utils.js +0 -40
  27. package/src/core/html-generator.js +0 -185
  28. package/src/core/icon-renderer.js +0 -106
  29. package/src/core/logger.js +0 -21
  30. package/src/core/markdown/containers.js +0 -94
  31. package/src/core/markdown/renderers.js +0 -90
  32. package/src/core/markdown/rules.js +0 -402
  33. package/src/core/markdown/setup.js +0 -113
  34. package/src/core/navigation-helper.js +0 -74
  35. package/src/index.js +0 -12
  36. package/src/live/core.js +0 -67
  37. package/src/live/index.html +0 -216
  38. package/src/live/live.css +0 -256
  39. package/src/live/shims.js +0 -1
  40. package/src/plugins/analytics.js +0 -48
  41. package/src/plugins/seo.js +0 -107
  42. package/src/plugins/sitemap.js +0 -127
  43. package/src/templates/layout.ejs +0 -187
  44. package/src/templates/navigation.ejs +0 -97
  45. package/src/templates/no-style.ejs +0 -166
  46. package/src/templates/partials/theme-init.js +0 -36
  47. package/src/templates/toc.ejs +0 -38
package/README.md CHANGED
@@ -1,167 +1,22 @@
1
- <div align="center">
1
+ ## ⚠️ @mgks/docmd [DEPRECATED]
2
2
 
3
- <!-- PROJECT TITLE -->
4
- <h1>
5
- <img src="https://github.com/docmd-io/docmd/blob/main/src/assets/images/docmd-logo-dark.png?raw=true" alt="docmd logo" width="200" />
6
- <!-- docmd -->
7
- </h1>
8
-
9
- <!-- ONE LINE SUMMARY -->
10
- <p>
11
- <b>The minimalist, zero-config documentation generator.</b>
12
- </p>
13
-
14
- <!-- BADGES -->
15
- <p>
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=d25353" alt="npm version"></a>
17
- <a href="https://github.com/docmd-io/docmd/commits/main/"><img src="https://img.shields.io/github/commit-activity/m/docmd-io/docmd?style=flat-square&color=38bd24" alt="commits"></a>
18
- <a href="https://www.npmjs.com/package/@mgks/docmd?activeTab=versions"><img src="https://img.shields.io/npm/dt/@mgks/docmd.svg?style=flat-square&color=38bd24" alt="downloads"></a>
19
- <a href="https://github.com/docmd-io/docmd/stargazers"><img src="https://img.shields.io/github/stars/docmd-io/docmd?style=flat-square&logo=github" alt="stars"></a>
20
- <a href="https://github.com/docmd-io/docmd/blob/main/LICENSE"><img src="https://img.shields.io/github/license/docmd-io/docmd.svg?style=flat-square&color=blue" alt="license"></a>
21
- </p>
3
+ ⚠️ **THIS PACKAGE HAS BEEN RENAMED.** ⚠️
22
4
 
23
- <!-- MENU -->
24
- <p>
25
- <h4>
26
- <a href="https://docmd.io">View Demo</a> •
27
- <a href="https://docs.docmd.io/getting-started/installation/">Documentation</a> •
28
- <a href="https://live.docmd.io">Live Editor</a> •
29
- <a href="https://github.com/docmd-io/docmd/issues">Report Bug</a>
30
- </h4>
31
- </p>
5
+ We have moved! Please use **[@docmd/core](https://www.npmjs.com/package/@docmd/core)** for all future updates.
32
6
 
33
- <!-- PREVIEW -->
34
- <p>
35
- <img width="800" alt="docmd preview" src="https://github.com/user-attachments/assets/1a74d6f7-10f9-41fa-be8a-faeee278dbb9" />
36
- <br/>
37
- <sup><i>docmd noStyle page preview in light mode</i></sup>
38
- </p>
7
+ ## 🚨 Migration Guide
39
8
 
40
- </div>
9
+ 1. **Uninstall** the old package:
10
+ ```bash
11
+ npm uninstall -g @mgks/docmd
12
+ ```
41
13
 
42
- ## Features
14
+ 2. **Install** the new core:
15
+ ```bash
16
+ npm install -g @docmd/core
17
+ ```
43
18
 
44
- - **Zero Config**: Works out of the box with sensible defaults. Just `init` and go.
45
- - **Blazing Fast**: Generates **pure, static HTML**. No React hydration lag, no heavy bundles.
46
- - **Smart Search**: Built-in, **offline-capable** full-text search with fuzzy matching. No API keys required.
47
- - **Isomorphic Core**: Runs anywhere, Node.js CLI, CI/CD pipelines, or **directly in the browser**.
48
- - **Rich Content**: Built-in support for Callouts, Cards, Tabs, Steps, Changelogs, and Mermaid diagrams.
49
- - **Theming**: Beautiful light/dark modes and multiple pre-built themes (`sky`, `ruby`, `retro`).
19
+ ## What is this?
20
+ This package is a legacy wrapper. It currently forwards all commands to the new `@docmd/core` engine to prevent breaking existing CI/CD pipelines, but **it will not receive new features**.
50
21
 
51
- ## Installation
52
-
53
- ```bash
54
- npm install -g @mgks/docmd
55
- ```
56
-
57
- ## Usage
58
-
59
- ### CLI
60
-
61
- The Command Line Interface is the primary way to interact with `docmd`.
62
-
63
- ```bash
64
- docmd init # Initialize a new project with config and assets
65
- docmd dev # Start a local development server with hot-reload
66
- docmd build # Generate a production-ready static site in ./site
67
- docmd live # Launch the browser-based Live Editor locally
68
- ```
69
-
70
- ### API
71
-
72
- `docmd` exports its core engine, allowing you to build documentation programmatically within your own Node.js scripts or build tools.
73
-
74
- ```javascript
75
- const { build, buildLive } = require('@mgks/docmd');
76
-
77
- // Trigger a standard documentation build
78
- await build('./docmd.config.js', {
79
- isDev: false,
80
- preserve: true
81
- });
82
-
83
- // Trigger a Live Editor bundle build
84
- await buildLive();
85
- ```
86
-
87
- ### Live Editor
88
-
89
- `docmd` features a modular architecture that allows the core engine to run client-side.
90
-
91
- Running `docmd live` builds a standalone web application where you can write Markdown and see the preview instantly without any server-side processing. You can embed the generated `docmd-live.js` bundle to add Markdown capabilities to your own applications.
92
-
93
- ## Project Structure
94
-
95
- `docmd` keeps it simple. Your content lives in `docs/`, your config in `docmd.config.js`.
96
-
97
- ```bash
98
- my-docs/
99
- ├── docs/ # Your Markdown files
100
- │ ├── index.md # Homepage
101
- │ └── guide.md # Content page
102
- ├── assets/ # Images and custom CSS
103
- ├── docmd.config.js # Configuration
104
- └── package.json
105
- ```
106
-
107
- ## Configuration
108
-
109
- Customize your site in seconds via `docmd.config.js`:
110
-
111
- ```javascript
112
- module.exports = {
113
- siteTitle: 'My Project',
114
- siteUrl: 'https://mysite.com',
115
- srcDir: 'docs',
116
- outputDir: 'site',
117
-
118
- // Theme Settings
119
- theme: {
120
- name: 'sky', // 'default', 'sky', 'ruby', 'retro'
121
- defaultMode: 'system', // 'light', 'dark', or 'system'
122
- enableModeToggle: true
123
- },
124
-
125
- // Sidebar Navigation
126
- navigation: [
127
- { title: 'Home', path: '/', icon: 'home' },
128
- {
129
- title: 'Guide',
130
- icon: 'book',
131
- children: [
132
- { title: 'Installation', path: '/guide/install' }
133
- ]
134
- }
135
- ],
136
-
137
- // Plugins
138
- plugins: {
139
- seo: { /* ... */ },
140
- sitemap: { /* ... */ }
141
- }
142
- }
143
- ```
144
-
145
- ## Comparison
146
-
147
- | Feature | docmd | Docusaurus | MkDocs | Mintlify |
148
- | :--- | :--- | :--- | :--- | :--- |
149
- | **Language** | **Node.js** | React.js | Python | Proprietary |
150
- | **Output** | **Static HTML** | React SPA | Static HTML | Hosted |
151
- | **JS Payload** | **Tiny (< 15kb)** | Heavy | Minimal | Medium |
152
- | **Search** | **Built-in (Offline)** | Algolia (Ext) | Built-in | Built-in |
153
- | **Setup** | **~1 min** | ~15 mins | ~10 mins | Instant |
154
- | **Cost** | **Free OSS** | Free OSS | Free OSS | Freemium |
155
-
156
- ## Community & Support
157
-
158
- - **Contributing**: We welcome PRs! See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
159
- - **Support**: If you find `docmd` useful, please consider [sponsoring the project](https://github.com/sponsors/mgks) or giving it a star ⭐.
160
-
161
- ## License
162
-
163
- Distributed under the MIT License. See `LICENSE` for more information.
164
-
165
- > **{ github.com/mgks }**
166
- >
167
- > ![Website Badge](https://img.shields.io/badge/Visit-mgks.dev-blue?style=flat&link=https%3A%2F%2Fmgks.dev) ![Sponsor Badge](https://img.shields.io/badge/%20%20Become%20a%20Sponsor%20%20-red?style=flat&logo=github&link=https%3A%2F%2Fgithub.com%2Fsponsors%2Fmgks)
22
+ Please update your scripts to use `@docmd/core`.
package/bin/docmd.js CHANGED
@@ -1,72 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { program } = require('commander');
4
- const { startDevServer } = require('../src/commands/dev');
5
- const { buildSite } = require('../src/commands/build');
6
- const { initProject } = require('../src/commands/init');
7
- const { build: buildLive } = require('../src/commands/live');
8
- const { version } = require('../package.json');
9
- const { printBanner } = require('../src/core/logger');
10
- const path = require('path');
11
- const { spawn } = require('child_process');
3
+ console.error('\x1b[33m%s\x1b[0m', '⚠️ DEPRECATION NOTICE:');
4
+ console.error('\x1b[33m%s\x1b[0m', ' You are using the legacy package "@mgks/docmd".');
5
+ console.error('\x1b[33m%s\x1b[0m', ' Please uninstall it and install "@docmd/core" for future updates.');
6
+ console.error('\x1b[33m%s\x1b[0m', ' Redirecting to new engine...\n');
12
7
 
13
- program
14
- .name('docmd')
15
- .description('The minimalist, zero-config documentation generator')
16
- .version(version, '-v, --version', 'Output the current version')
17
- .helpOption('-h, --help', 'Display help for command');
18
-
19
- program
20
- .command('init')
21
- .description('Initialize a new documentation project')
22
- .action(() => {
23
- printBanner();
24
- initProject();
25
- });
26
-
27
- program
28
- .command('dev')
29
- .description('Start the development server with live reload')
30
- .option('-c, --config <path>', 'Path to configuration file', 'docmd.config.js')
31
- .option('-p, --port <number>', 'Port to run the server on')
32
- .option('--preserve', 'Preserve existing assets', false)
33
- .action((options) => {
34
- printBanner();
35
- startDevServer(options.config, options);
36
- });
37
-
38
- program
39
- .command('build')
40
- .description('Build the static documentation site')
41
- .option('-c, --config <path>', 'Path to configuration file', 'docmd.config.js')
42
- .option('--preserve', 'Preserve existing assets', false)
43
- .action((options) => {
44
- buildSite(options.config, { isDev: false, preserve: options.preserve });
45
- })
46
- .option('--offline', 'Generate a build optimized for file:// viewing (appends index.html)', false)
47
- .action((options) => {
48
- buildSite(options.config, { isDev: false, preserve: options.preserve, offline: options.offline });
49
- });
50
-
51
- program
52
- .command('live')
53
- .description('Build and serve the browser-based live editor')
54
- .action(async () => {
55
- try {
56
- await buildLive();
57
-
58
- console.log('\n🌍 Launching server...');
59
- console.log(' Press Ctrl+C to stop.\n');
60
-
61
- const distPath = path.resolve(__dirname, '../dist');
62
- const serveCmd = `npx serve "${distPath}"`;
63
-
64
- spawn(serveCmd, { stdio: 'inherit', shell: true });
65
-
66
- } catch (e) {
67
- console.error('Live build failed:', e);
68
- process.exit(1);
69
- }
70
- });
71
-
72
- program.parse();
8
+ // Pass control to the core binary
9
+ require('@docmd/core/bin/docmd.js');
package/package.json CHANGED
@@ -1,72 +1,32 @@
1
1
  {
2
2
  "name": "@mgks/docmd",
3
- "version": "0.3.11",
4
- "description": "Generate beautiful, lightweight static documentation sites directly from your Markdown files. Zero clutter, just content.",
5
- "main": "src/index.js",
6
- "exports": {
7
- ".": {
8
- "import": "./src/index.js",
9
- "require": "./src/index.js"
10
- }
11
- },
12
- "files": [
13
- "bin",
14
- "src",
15
- "LICENSE",
16
- "README.md"
17
- ],
3
+ "version": "0.4.1",
4
+ "description": "Legacy wrapper for docmd. Please use @docmd/core.",
18
5
  "bin": {
19
6
  "docmd": "bin/docmd.js"
20
7
  },
21
- "scripts": {
22
- "test": "node scripts/failsafe.js",
23
- "prepublishOnly": "npm test",
24
- "start": "node bin/docmd.js dev",
25
- "build": "node bin/docmd.js build",
26
- "live": "node bin/docmd.js live",
27
- "postinstall": "node bin/postinstall.js",
28
- "lint": "eslint .",
29
- "format": "prettier --write ."
30
- },
31
8
  "dependencies": {
32
- "buffer": "^6.0.3",
33
- "chalk": "^4.1.2",
34
- "chokidar": "^5.0.0",
35
- "commander": "^14.0.2",
36
- "ejs": "^3.1.10",
37
- "esbuild": "^0.27.2",
38
- "gray-matter": "^4.0.3",
39
- "highlight.js": "^11.11.1",
40
- "lucide-static": "^0.563.0",
41
- "markdown-it": "^14.1.0",
42
- "markdown-it-abbr": "^2.0.0",
43
- "markdown-it-attrs": "^4.3.1",
44
- "markdown-it-container": "^4.0.0",
45
- "markdown-it-deflist": "^3.0.0",
46
- "markdown-it-footnote": "^4.0.0",
47
- "markdown-it-task-lists": "^2.1.1",
48
- "minisearch": "^7.2.0",
49
- "ws": "^8.19.0"
50
- },
51
- "devDependencies": {
52
- "buffer": "^6.0.3",
53
- "eslint": "^9.39.2",
54
- "prettier": "^3.7.4"
55
- },
56
- "directories": {
57
- "doc": "docs"
9
+ "@docmd/core": "workspace:*"
58
10
  },
59
11
  "keywords": [
12
+ "docmd",
60
13
  "markdown",
14
+ "minimalist",
15
+ "zero-config",
16
+ "site-generator",
61
17
  "static-site-generator",
62
18
  "documentation",
19
+ "typescript",
20
+ "javascript",
21
+ "nodejs",
22
+ "browser",
23
+ "website",
24
+ "generator",
25
+ "hosted",
26
+ "cli",
63
27
  "ssg",
64
- "docs",
65
- "generator"
28
+ "docs"
66
29
  ],
67
- "engines": {
68
- "node": ">=18.0.0"
69
- },
70
30
  "author": {
71
31
  "name": "Ghazi",
72
32
  "url": "https://mgks.dev"
@@ -81,4 +41,4 @@
81
41
  "homepage": "https://docmd.io",
82
42
  "funding": "https://github.com/sponsors/mgks",
83
43
  "license": "MIT"
84
- }
44
+ }
@@ -1,14 +0,0 @@
1
- // Source file from the docmd project — https://github.com/docmd-io/docmd
2
-
3
- // This script runs after 'npm install', runs only when the user installs it globally and not in a CI environment
4
-
5
- const chalk = require('chalk');
6
-
7
- if (process.env.npm_config_global && !process.env.CI) {
8
- console.log(chalk.green('\n🎉 Thank you for installing docmd!'));
9
- console.log('\nTo get started, run the following commands:');
10
- console.log(`\n ${chalk.cyan('docmd init my-awesome-docs')}`);
11
- console.log(` ${chalk.cyan('cd my-awesome-docs')}`);
12
- console.log(` ${chalk.cyan('npm start')}`);
13
- console.log('\nFor complete documentation, visit: https://docmd.io');
14
- }
@@ -1,86 +0,0 @@
1
- /* Source file from the docmd project — https://github.com/docmd-io/docmd */
2
-
3
- pre code.hljs {
4
- display: block;
5
- overflow-x: auto;
6
- padding: 1em
7
- }
8
-
9
- code.hljs {
10
- padding: 3px 5px
11
- }
12
-
13
- .hljs {
14
- color: #abb2bf;
15
- background: #282c34
16
- }
17
-
18
- .hljs-comment,
19
- .hljs-quote {
20
- color: #5c6370;
21
- font-style: italic
22
- }
23
-
24
- .hljs-doctag,
25
- .hljs-formula,
26
- .hljs-keyword {
27
- color: #c678dd
28
- }
29
-
30
- .hljs-deletion,
31
- .hljs-name,
32
- .hljs-section,
33
- .hljs-selector-tag,
34
- .hljs-subst {
35
- color: #e06c75
36
- }
37
-
38
- .hljs-literal {
39
- color: #56b6c2
40
- }
41
-
42
- .hljs-addition,
43
- .hljs-attribute,
44
- .hljs-meta .hljs-string,
45
- .hljs-regexp,
46
- .hljs-string {
47
- color: #98c379
48
- }
49
-
50
- .hljs-attr,
51
- .hljs-number,
52
- .hljs-selector-attr,
53
- .hljs-selector-class,
54
- .hljs-selector-pseudo,
55
- .hljs-template-variable,
56
- .hljs-type,
57
- .hljs-variable {
58
- color: #d19a66
59
- }
60
-
61
- .hljs-bullet,
62
- .hljs-link,
63
- .hljs-meta,
64
- .hljs-selector-id,
65
- .hljs-symbol,
66
- .hljs-title {
67
- color: #61aeee
68
- }
69
-
70
- .hljs-built_in,
71
- .hljs-class .hljs-title,
72
- .hljs-title.class_ {
73
- color: #e6c07b
74
- }
75
-
76
- .hljs-emphasis {
77
- font-style: italic
78
- }
79
-
80
- .hljs-strong {
81
- font-weight: 700
82
- }
83
-
84
- .hljs-link {
85
- text-decoration: underline
86
- }
@@ -1,86 +0,0 @@
1
- /* Source file from the docmd project — https://github.com/docmd-io/docmd */
2
-
3
- pre code.hljs {
4
- display: block;
5
- overflow-x: auto;
6
- padding: 1em
7
- }
8
-
9
- code.hljs {
10
- padding: 3px 5px
11
- }
12
-
13
- .hljs {
14
- color: #383a42;
15
- background: #fafafa
16
- }
17
-
18
- .hljs-comment,
19
- .hljs-quote {
20
- color: #a0a1a7;
21
- font-style: italic
22
- }
23
-
24
- .hljs-doctag,
25
- .hljs-formula,
26
- .hljs-keyword {
27
- color: #a626a4
28
- }
29
-
30
- .hljs-deletion,
31
- .hljs-name,
32
- .hljs-section,
33
- .hljs-selector-tag,
34
- .hljs-subst {
35
- color: #e45649
36
- }
37
-
38
- .hljs-literal {
39
- color: #0184bb
40
- }
41
-
42
- .hljs-addition,
43
- .hljs-attribute,
44
- .hljs-meta .hljs-string,
45
- .hljs-regexp,
46
- .hljs-string {
47
- color: #50a14f
48
- }
49
-
50
- .hljs-attr,
51
- .hljs-number,
52
- .hljs-selector-attr,
53
- .hljs-selector-class,
54
- .hljs-selector-pseudo,
55
- .hljs-template-variable,
56
- .hljs-type,
57
- .hljs-variable {
58
- color: #986801
59
- }
60
-
61
- .hljs-bullet,
62
- .hljs-link,
63
- .hljs-meta,
64
- .hljs-selector-id,
65
- .hljs-symbol,
66
- .hljs-title {
67
- color: #4078f2
68
- }
69
-
70
- .hljs-built_in,
71
- .hljs-class .hljs-title,
72
- .hljs-title.class_ {
73
- color: #c18401
74
- }
75
-
76
- .hljs-emphasis {
77
- font-style: italic
78
- }
79
-
80
- .hljs-strong {
81
- font-weight: 700
82
- }
83
-
84
- .hljs-link {
85
- text-decoration: underline
86
- }