@mgks/docmd 0.2.5 → 0.2.7
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/CODE_OF_CONDUCT.md +48 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +58 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +27 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +16 -0
- package/.github/SECURITY.md +18 -0
- package/.github/workflows/publish.yml +19 -56
- package/README.md +82 -44
- package/bin/docmd.js +7 -2
- package/bin/postinstall.js +14 -0
- package/config.js +13 -1
- package/docs/comparison.md +51 -0
- package/docs/overview.md +7 -1
- package/docs/recipes/custom-fonts.md +43 -0
- package/docs/recipes/favicon.md +38 -0
- package/docs/recipes/index.md +12 -0
- package/docs/recipes/landing-page.md +46 -0
- package/package.json +4 -1
- package/src/assets/css/docmd-main.css +1151 -3
- package/src/assets/js/docmd-main.js +17 -1
- package/src/commands/build.js +15 -64
- package/src/core/config-loader.js +9 -3
- package/src/core/config-validator.js +79 -0
- package/src/core/file-processor.js +9 -1
- package/src/core/html-generator.js +1 -1
- package/src/core/logger.js +21 -0
- package/src/core/navigation-helper.js +62 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
## Enforcement Responsibilities
|
|
29
|
+
|
|
30
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
31
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
32
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
33
|
+
or harmful.
|
|
34
|
+
|
|
35
|
+
## Enforcement
|
|
36
|
+
|
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
38
|
+
reported to the community leaders responsible for enforcement at hello@mgks.dev.
|
|
39
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
40
|
+
|
|
41
|
+
## Attribution
|
|
42
|
+
|
|
43
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
44
|
+
version 2.1, available at
|
|
45
|
+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
46
|
+
|
|
47
|
+
[homepage]: https://www.contributor-covenant.org
|
|
48
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: 🐞 Bug Report
|
|
2
|
+
description: Create a report to help us improve docmd
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug", "triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for taking the time to fill out this bug report!
|
|
10
|
+
- type: input
|
|
11
|
+
id: version
|
|
12
|
+
attributes:
|
|
13
|
+
label: docmd version
|
|
14
|
+
description: What version of docmd are you using? (e.g. 0.2.6)
|
|
15
|
+
placeholder: 0.2.6
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: input
|
|
19
|
+
id: node-version
|
|
20
|
+
attributes:
|
|
21
|
+
label: Node.js version
|
|
22
|
+
placeholder: v20.x
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: dropdown
|
|
26
|
+
id: os
|
|
27
|
+
attributes:
|
|
28
|
+
label: OS
|
|
29
|
+
options:
|
|
30
|
+
- macOS
|
|
31
|
+
- Windows
|
|
32
|
+
- Linux
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
- type: textarea
|
|
36
|
+
id: description
|
|
37
|
+
attributes:
|
|
38
|
+
label: Description
|
|
39
|
+
description: A clear and concise description of what the bug is.
|
|
40
|
+
validations:
|
|
41
|
+
required: true
|
|
42
|
+
- type: textarea
|
|
43
|
+
id: reproduction
|
|
44
|
+
attributes:
|
|
45
|
+
label: Steps to Reproduce
|
|
46
|
+
description: Please provide the steps to reproduce the behavior.
|
|
47
|
+
placeholder: |
|
|
48
|
+
1. Run 'docmd init'
|
|
49
|
+
2. Add configuration...
|
|
50
|
+
3. Run 'docmd build'
|
|
51
|
+
4. See error...
|
|
52
|
+
validations:
|
|
53
|
+
required: true
|
|
54
|
+
- type: textarea
|
|
55
|
+
id: expected
|
|
56
|
+
attributes:
|
|
57
|
+
label: Expected Behavior
|
|
58
|
+
description: A clear and concise description of what you expected to happen.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: 💡 Feature Request
|
|
2
|
+
description: Suggest an idea for this project
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for suggesting a new feature!
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: Is your feature request related to a problem?
|
|
14
|
+
description: A clear and concise description of what the problem is.
|
|
15
|
+
placeholder: I'm always frustrated when...
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: solution
|
|
18
|
+
attributes:
|
|
19
|
+
label: Describe the solution you'd like
|
|
20
|
+
description: A clear and concise description of what you want to happen.
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: textarea
|
|
24
|
+
id: alternatives
|
|
25
|
+
attributes:
|
|
26
|
+
label: Describe alternatives you've considered
|
|
27
|
+
description: A clear and concise description of any alternative solutions or features you've considered.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
<!-- Please include a summary of the change and which issue is fixed. -->
|
|
3
|
+
|
|
4
|
+
Fixes # (issue)
|
|
5
|
+
|
|
6
|
+
## Type of change
|
|
7
|
+
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
|
|
8
|
+
- [ ] ✨ New feature (non-breaking change which adds functionality)
|
|
9
|
+
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
10
|
+
- [ ] 📝 Documentation update
|
|
11
|
+
|
|
12
|
+
## Checklist:
|
|
13
|
+
- [ ] I have performed a self-review of my own code
|
|
14
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
15
|
+
- [ ] I have made corresponding changes to the documentation
|
|
16
|
+
- [ ] My changes generate no new warnings
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------- | ------------------ |
|
|
7
|
+
| 0.2.x | :white_check_mark: |
|
|
8
|
+
| 0.1.x | :x: |
|
|
9
|
+
|
|
10
|
+
## Reporting a Vulnerability
|
|
11
|
+
|
|
12
|
+
Use this section to tell people how to report a vulnerability.
|
|
13
|
+
|
|
14
|
+
Please do not report security vulnerabilities through public GitHub issues.
|
|
15
|
+
|
|
16
|
+
If you have discovered a security vulnerability in `docmd`, please email hello@mgks.dev.
|
|
17
|
+
|
|
18
|
+
We will do our best to respond within 48 hours.
|
|
@@ -2,83 +2,46 @@ name: Publish Package to NPM and GitHub Packages
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
release:
|
|
5
|
-
types: [
|
|
6
|
-
workflow_dispatch:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
publish:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
permissions:
|
|
12
12
|
contents: read
|
|
13
|
-
packages: write
|
|
13
|
+
packages: write
|
|
14
14
|
steps:
|
|
15
15
|
- name: Checkout repository
|
|
16
16
|
uses: actions/checkout@v4
|
|
17
|
-
# Your package.json in the workspace should now have name: "@mgks/docmd"
|
|
18
17
|
|
|
19
|
-
- name: Set up Node.js
|
|
18
|
+
- name: Set up Node.js v22
|
|
20
19
|
uses: actions/setup-node@v4
|
|
21
20
|
with:
|
|
22
21
|
node-version: '22'
|
|
23
|
-
cache: 'npm'
|
|
22
|
+
cache: 'npm'
|
|
24
23
|
|
|
25
24
|
- name: Install dependencies
|
|
26
25
|
run: npm ci
|
|
27
26
|
|
|
28
|
-
#
|
|
29
|
-
# - name: Build package
|
|
30
|
-
# run: npm run build
|
|
31
|
-
|
|
32
|
-
# Optional: Run tests
|
|
33
|
-
# - name: Test package
|
|
34
|
-
# run: npm test
|
|
35
|
-
|
|
27
|
+
# ------------------------------------------
|
|
36
28
|
# --- Publish to NPM Registry (npmjs.com) ---
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
node-version: '22' # Redundant if already set, but harmless
|
|
41
|
-
registry-url: 'https://registry.npmjs.org/'
|
|
42
|
-
env:
|
|
43
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Configures .npmrc for npmjs.com
|
|
29
|
+
# ------------------------------------------
|
|
30
|
+
- name: Configure NPM for public registry
|
|
31
|
+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
# Just ensure no GPR-specific publishConfig is present
|
|
47
|
-
- name: Prepare package.json for npmjs.com
|
|
48
|
-
run: |
|
|
49
|
-
echo "package.json for npmjs.com publishing (should be @mgks/docmd):"
|
|
50
|
-
cat package.json
|
|
51
|
-
# Remove publishConfig if it exists, just in case
|
|
52
|
-
if jq -e '.publishConfig' package.json > /dev/null; then
|
|
53
|
-
echo "Removing publishConfig for npmjs.com publish"
|
|
54
|
-
jq 'del(.publishConfig)' package.json > package_temp.json && mv package_temp.json package.json
|
|
55
|
-
else
|
|
56
|
-
echo "No publishConfig found, package.json is ready for npmjs.com."
|
|
57
|
-
fi
|
|
58
|
-
cat package.json
|
|
59
|
-
|
|
60
|
-
- name: Publish to NPM Registry (npmjs.com)
|
|
61
|
-
# For scoped packages on npmjs.com, --access=public is needed for the first publish
|
|
62
|
-
# and if it's intended to be a public package.
|
|
33
|
+
- name: Publish to NPM Registry
|
|
63
34
|
run: npm publish --access=public
|
|
64
|
-
|
|
65
|
-
# --- Publish to GitHub Packages ---
|
|
66
|
-
- name: Set up Node.js for GitHub Packages
|
|
67
|
-
uses: actions/setup-node@v4
|
|
68
|
-
with:
|
|
69
|
-
node-version: '22' # Redundant if already set, but harmless
|
|
70
|
-
registry-url: 'https://npm.pkg.github.com'
|
|
71
|
-
# scope: '@mgks' # Not strictly needed here if package.json name is already @mgks/docmd
|
|
72
|
-
# but good for ensuring .npmrc is correctly configured for the @mgks scope.
|
|
73
35
|
env:
|
|
74
|
-
NODE_AUTH_TOKEN: ${{ secrets.
|
|
36
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
75
37
|
|
|
76
|
-
#
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
cat package.json
|
|
38
|
+
# ----------------------------------------
|
|
39
|
+
# --- Publish to GitHub Packages (GPR) ---
|
|
40
|
+
# ----------------------------------------
|
|
41
|
+
- name: Configure NPM for GitHub Packages registry
|
|
42
|
+
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
|
|
82
43
|
|
|
83
44
|
- name: Publish to GitHub Packages
|
|
84
|
-
run: npm publish
|
|
45
|
+
run: npm publish
|
|
46
|
+
env:
|
|
47
|
+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/README.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<b>Generate beautiful, lightweight static documentation sites from Markdown files.</b
|
|
9
|
-
Zero clutter, just content.
|
|
8
|
+
<b>Generate beautiful, lightweight static documentation sites from Markdown files.</b>
|
|
9
|
+
<br>Zero clutter, just content.
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
@@ -15,71 +15,109 @@
|
|
|
15
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
16
|
</p>
|
|
17
17
|
|
|
18
|
-
Docmd
|
|
18
|
+
Docmd is a Node.js command-line tool for generating fast, beautiful, and lightweight static documentation sites from standard Markdown files. It champions the philosophy of "zero clutter, just content," prioritizing a simple authoring experience and a clean, performant result for readers.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
**:rocket: [Live Preview](https://docmd.mgks.dev): Official documentation site powered by `docmd`.**
|
|
21
21
|
|
|
22
|
-
## Features
|
|
22
|
+
## Key Features
|
|
23
23
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
24
|
+
- **Markdown First:** Write your content in standard Markdown with simple YAML frontmatter.
|
|
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.).
|
|
33
33
|
|
|
34
|
-
## Installation
|
|
34
|
+
## Installation and Usage
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
**Prerequisites:** [Node.js](https://nodejs.org/) (version 22.x or higher) is required.
|
|
37
37
|
|
|
38
|
+
### Global Installation (Recommended)
|
|
39
|
+
|
|
40
|
+
This is the recommended approach for developers who will use `docmd` across multiple projects. It makes the `docmd` command available system-wide.
|
|
41
|
+
|
|
42
|
+
**1. Install Globally:**
|
|
38
43
|
```bash
|
|
39
|
-
# Global installation (recommended)
|
|
40
44
|
npm install -g @mgks/docmd
|
|
41
|
-
|
|
42
|
-
# Local project installation
|
|
43
|
-
npm install --save-dev @mgks/docmd
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
**2. Basic Workflow:**
|
|
48
|
+
Once installed, you can use the `docmd` command directly in any project folder.
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
docmd
|
|
50
|
+
* **Initialize a Project:**
|
|
51
|
+
```bash
|
|
52
|
+
# This creates docs/, docmd.config.js, and a sample index.md
|
|
53
|
+
docmd init
|
|
54
|
+
```
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
* **Start the Dev Server:**
|
|
57
|
+
```bash
|
|
58
|
+
# Starts a live-reloading server at http://localhost:3000
|
|
59
|
+
docmd dev
|
|
60
|
+
```
|
|
54
61
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
* **Build for Production:**
|
|
63
|
+
```bash
|
|
64
|
+
# Generates the static site into the `site/` directory
|
|
65
|
+
docmd build
|
|
66
|
+
```
|
|
58
67
|
|
|
59
|
-
###
|
|
68
|
+
### Quick Start (Alternative)
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
If you prefer not to install packages globally, you can use `npx` to run `docmd` on-demand. This is a great way to try it out or use it in a single project.
|
|
62
71
|
|
|
63
|
-
|
|
72
|
+
1. **Create and Initialize Your Project:**
|
|
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
|
+
```
|
|
64
77
|
|
|
65
|
-
|
|
78
|
+
2. **Start the Development Server:**
|
|
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
|
+
```
|
|
66
84
|
|
|
67
|
-
|
|
68
|
-
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/docmd.git`
|
|
69
|
-
3. Install dependencies: `npm install`
|
|
70
|
-
4. Make your changes and test them
|
|
71
|
-
5. Submit a pull request
|
|
85
|
+
Your new documentation site is now running at `http://localhost:3000`.
|
|
72
86
|
|
|
73
|
-
##
|
|
87
|
+
## Documentation
|
|
88
|
+
|
|
89
|
+
For a complete guide, visit the official documentation: **[docmd.mgks.dev](https://docmd.mgks.dev)**.
|
|
74
90
|
|
|
75
|
-
|
|
91
|
+
### Essential Topics
|
|
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.
|
|
98
|
+
|
|
99
|
+
## Contributing
|
|
100
|
+
|
|
101
|
+
We welcome contributions of all kinds! Whether it's reporting a bug, suggesting a feature, or submitting a pull request, your help is appreciated.
|
|
102
|
+
|
|
103
|
+
1. Fork the repository.
|
|
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.
|
|
108
|
+
|
|
109
|
+
Please check our [contributing guidelines](https://docmd.mgks.dev/contributing/) for more detailed information.
|
|
76
110
|
|
|
77
111
|
## Support the Project
|
|
78
112
|
|
|
79
113
|
If you find `docmd` useful, please consider:
|
|
80
114
|
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
115
|
+
- Starring the repository on GitHub.
|
|
116
|
+
- Sharing it with others who might benefit.
|
|
117
|
+
- Reporting issues or submitting pull requests.
|
|
118
|
+
|
|
119
|
+
❤️ **[GitHub Sponsors](https://github.com/sponsors/mgks): Become a sponsor to support the ongoing development of `docmd`.**
|
|
120
|
+
|
|
121
|
+
## License
|
|
84
122
|
|
|
85
|
-
|
|
123
|
+
Docmd is licensed under the [MIT License](https://github.com/mgks/docmd/blob/main/LICENSE).
|
package/bin/docmd.js
CHANGED
|
@@ -7,6 +7,7 @@ const { version } = require('../package.json');
|
|
|
7
7
|
const { initProject } = require('../src/commands/init');
|
|
8
8
|
const { buildSite } = require('../src/commands/build');
|
|
9
9
|
const { startDevServer } = require('../src/commands/dev');
|
|
10
|
+
const { printBanner } = require('../src/core/logger');
|
|
10
11
|
|
|
11
12
|
// Helper function to find the config file
|
|
12
13
|
const findConfigFile = () => {
|
|
@@ -52,6 +53,8 @@ program
|
|
|
52
53
|
.option('--silent', 'Suppress log output')
|
|
53
54
|
.action(async (options) => {
|
|
54
55
|
try {
|
|
56
|
+
if (!options.silent) { printBanner(); }
|
|
57
|
+
|
|
55
58
|
const originalLog = console.log;
|
|
56
59
|
if (options.silent) { console.log = () => {}; }
|
|
57
60
|
|
|
@@ -68,7 +71,7 @@ program
|
|
|
68
71
|
|
|
69
72
|
} catch (error) {
|
|
70
73
|
console.error('❌ Build failed:', error.message);
|
|
71
|
-
console.error(error.stack);
|
|
74
|
+
// console.error(error.stack);
|
|
72
75
|
process.exit(1);
|
|
73
76
|
}
|
|
74
77
|
});
|
|
@@ -83,6 +86,8 @@ program
|
|
|
83
86
|
.option('--silent', 'Suppress log output')
|
|
84
87
|
.action(async (options) => {
|
|
85
88
|
try {
|
|
89
|
+
if (!options.silent) { printBanner(); }
|
|
90
|
+
|
|
86
91
|
if (options.silent) {
|
|
87
92
|
const originalLog = console.log;
|
|
88
93
|
console.log = (message) => {
|
|
@@ -96,7 +101,7 @@ program
|
|
|
96
101
|
|
|
97
102
|
} catch (error) {
|
|
98
103
|
console.error('❌ Dev server failed:', error.message);
|
|
99
|
-
console.error(error.stack);
|
|
104
|
+
// console.error(error.stack);
|
|
100
105
|
process.exit(1);
|
|
101
106
|
}
|
|
102
107
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// bin/postinstall.js
|
|
2
|
+
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
// This script runs after 'npm install', runs only when the user installs it globally and not in a CI environment
|
|
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.mgks.dev');
|
|
14
|
+
}
|
package/config.js
CHANGED
|
@@ -155,9 +155,21 @@ module.exports = {
|
|
|
155
155
|
{ title: 'Sitemap', path: '/plugins/sitemap', icon: 'map' },
|
|
156
156
|
],
|
|
157
157
|
},
|
|
158
|
+
{
|
|
159
|
+
title: 'Recipes',
|
|
160
|
+
icon: 'chef-hat',
|
|
161
|
+
path: '/recipes/',
|
|
162
|
+
collapsible: true,
|
|
163
|
+
children: [
|
|
164
|
+
{ title: 'Landing Page', path: '/recipes/landing-page', icon: 'panel-top' },
|
|
165
|
+
{ title: 'Custom Fonts', path: '/recipes/custom-fonts', icon: 'type-outline' },
|
|
166
|
+
{ title: 'Favicon', path: '/recipes/favicon', icon: 'circle-dashed' },
|
|
167
|
+
],
|
|
168
|
+
},
|
|
158
169
|
{ title: 'CLI Commands', path: '/cli-commands', icon: 'terminal' },
|
|
159
170
|
{ title: 'Deployment', path: '/deployment', icon: 'upload-cloud' },
|
|
160
171
|
{ title: 'Contributing', path: '/contributing', icon: 'users-2' },
|
|
172
|
+
{ title: 'Comparison', path: '/comparison', icon: 'shapes' },
|
|
161
173
|
|
|
162
174
|
{ title: 'GitHub', path: 'https://github.com/mgks/docmd', icon: 'github', external: true },
|
|
163
175
|
{ title: 'Discussions', path: 'https://github.com/mgks/docmd/discussions', icon: 'message-square', external: true },
|
|
@@ -169,7 +181,7 @@ module.exports = {
|
|
|
169
181
|
// Sponsor Ribbon Configuration
|
|
170
182
|
sponsor: {
|
|
171
183
|
enabled: true, // Enable/disable the sponsor ribbon
|
|
172
|
-
title: '
|
|
184
|
+
title: 'Sponsor', // Text to display on the ribbon
|
|
173
185
|
link: 'https://github.com/sponsors/mgks', // URL for the sponsor link
|
|
174
186
|
},
|
|
175
187
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Comparison between docmd, Docusaurus, MkDocs, Mintlify and more"
|
|
3
|
+
description: "A detailed comparison of docmd against Docusaurus, MkDocs, Mintlify, and Docsify."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Comparing Documentation Tools
|
|
7
|
+
|
|
8
|
+
Choosing the right tool depends on your specific needs. `docmd` was built to fill the gap between "too simple" (basic parsers) and "too heavy" (full application frameworks).
|
|
9
|
+
|
|
10
|
+
## Feature Matrix
|
|
11
|
+
|
|
12
|
+
| Feature | docmd | Docusaurus | MkDocs (Material) | Mintlify | Docsify |
|
|
13
|
+
| :--- | :--- | :--- | :--- | :--- | :--- |
|
|
14
|
+
| **Core Tech** | Node.js (Native) | React.js | Python | Proprietary | JS (Runtime) |
|
|
15
|
+
| **Output** | Static HTML | React SPA (Hydrated) | Static HTML | Hosted / Next.js | None (Runtime SPA) |
|
|
16
|
+
| **Setup Time** | ~2 minutes | ~15 minutes | ~10 mins (Python env) | Instant (SaaS) | Instant |
|
|
17
|
+
| **Client JS Size** | **Tiny (< 15kb)** | Heavy (React Bundle) | Minimal | Medium | Medium |
|
|
18
|
+
| **Customization** | Standard CSS/JS | React Components | Python/Jinja2 | JSON Config | Vue/Plugins |
|
|
19
|
+
| **SEO** | **Excellent** | Excellent | Excellent | Excellent | **Poor** |
|
|
20
|
+
| **Hosting** | **Anywhere** | Anywhere | Anywhere | **Vendor Locked** | Anywhere |
|
|
21
|
+
| **Cost** | **100% Free OSS** | 100% Free OSS | 100% Free OSS | Freemium | 100% Free OSS |
|
|
22
|
+
|
|
23
|
+
## Detailed Breakdown
|
|
24
|
+
|
|
25
|
+
### vs. Docusaurus
|
|
26
|
+
**Docusaurus** is the gold standard for large-scale React projects (like Meta's own docs).
|
|
27
|
+
* **Choose Docusaurus if:** You need to embed complex React components inside your markdown, need versioning *today*, or are building a massive site with thousands of pages.
|
|
28
|
+
* **Choose docmd if:** You want a fast, lightweight site that is just HTML/CSS. You don't want to maintain a React dependency tree just to display documentation.
|
|
29
|
+
|
|
30
|
+
### vs. MkDocs (Material)
|
|
31
|
+
**MkDocs** is widely loved but requires a Python environment.
|
|
32
|
+
* **Choose MkDocs if:** You are already in the Python ecosystem or need its mature plugin ecosystem immediately.
|
|
33
|
+
* **Choose docmd if:** You are a JavaScript/Node.js developer. You want to run `npm install` and go, without dealing with `pip`, `requirements.txt`, or Python version conflicts.
|
|
34
|
+
|
|
35
|
+
### vs. Mintlify
|
|
36
|
+
**Mintlify** is a modern, hosted documentation platform focused on design.
|
|
37
|
+
* **Choose Mintlify if:** You have a budget and don't want to touch *any* code or configuration. You just want to upload markdown and pay someone to host and style it.
|
|
38
|
+
* **Choose docmd if:** You want full control over your HTML/CSS and want to host your docs for **free** on GitHub Pages, Vercel, or Netlify without branding watermarks or custom domain fees.
|
|
39
|
+
|
|
40
|
+
### vs. Docsify
|
|
41
|
+
**Docsify** is a "magical" generator that parses Markdown on the fly in the browser.
|
|
42
|
+
* **Choose Docsify if:** You absolutely cannot run a build step (e.g., you are hosting on a legacy server that only serves static files and you can't run CI/CD).
|
|
43
|
+
* **Choose docmd if:** You care about **SEO** and **Performance**. Docsify requires the user's browser to download the Markdown parser and the content before rendering anything, which is bad for search engines and users on slow connections. `docmd` builds real HTML files that load instantly.
|
|
44
|
+
|
|
45
|
+
## The docmd Philosophy
|
|
46
|
+
|
|
47
|
+
We believe documentation tools shouldn't be heavy. `docmd` generates **zero-clutter** websites. We don't ship a heavy JavaScript framework to the client just to render text. This results in:
|
|
48
|
+
|
|
49
|
+
1. **Better SEO:** Search engines love clean, semantic HTML.
|
|
50
|
+
2. **Faster Load Times:** No "hydration" delay or runtime parsing.
|
|
51
|
+
3. **Easier Maintenance:** Standard web technologies (CSS/JS), no framework knowledge required.
|
package/docs/overview.md
CHANGED
|
@@ -3,7 +3,13 @@ title: "Minimalist Markdown Docs Generator"
|
|
|
3
3
|
description: "Generate beautiful, lightweight static documentation sites directly from your Markdown files with docmd. Zero clutter, just content."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
```
|
|
7
|
+
_ _
|
|
8
|
+
_| |___ ___ _____ _| |
|
|
9
|
+
| . | . | _| | . |
|
|
10
|
+
|___|___|___|_|_|_|___|
|
|
11
|
+
|
|
12
|
+
```
|
|
7
13
|
|
|
8
14
|
**Generate beautiful, lightweight static documentation sites directly from your Markdown files. Zero clutter, just content.**
|
|
9
15
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Recipe: Custom Fonts"
|
|
3
|
+
description: "How to add Google Fonts or custom typefaces to your documentation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Adding Custom Fonts
|
|
7
|
+
|
|
8
|
+
You can easily change the typography of your `docmd` site using CSS variables and a custom stylesheet.
|
|
9
|
+
|
|
10
|
+
## 1. Select a Font
|
|
11
|
+
Go to [Google Fonts](https://fonts.google.com) and select the font you want (e.g., "Poppins"). Copy the `@import` URL.
|
|
12
|
+
|
|
13
|
+
## 2. Create a Custom CSS File
|
|
14
|
+
Create a file in your project at `assets/css/typography.css`.
|
|
15
|
+
|
|
16
|
+
```css
|
|
17
|
+
/* assets/css/typography.css */
|
|
18
|
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
|
|
19
|
+
|
|
20
|
+
:root {
|
|
21
|
+
/* Override the default sans-serif font variable */
|
|
22
|
+
--font-family-sans: 'Poppins', system-ui, -apple-system, sans-serif;
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 3. Register in Config
|
|
27
|
+
Add the file to your `docmd.config.js`:
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
module.exports = {
|
|
31
|
+
// ...
|
|
32
|
+
theme: {
|
|
33
|
+
name: 'default',
|
|
34
|
+
customCss: [
|
|
35
|
+
'/assets/css/typography.css' // Points to your new file
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
// ...
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 4. Restart
|
|
43
|
+
Run `docmd dev`. Your site will now use Poppins!
|