blodemd 0.0.3 → 0.0.5
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/README.md +115 -0
- package/dist/cli.mjs +827 -91
- package/dist/cli.mjs.map +1 -1
- package/package.json +8 -4
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<h1 align="center">Blode.md</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">Deploy and manage documentation sites from the command line.</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/blodemd"><img src="https://img.shields.io/npm/v/blodemd.svg" alt="npm version"></a>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
- **One-command deploy:** Push your entire docs folder to Blode.md with `blodemd push`.
|
|
10
|
+
- **Scaffold in seconds:** Generate a ready-to-edit docs folder with `blodemd init`.
|
|
11
|
+
- **Config validation:** Catch `docs.json` errors before deploying.
|
|
12
|
+
- **CI-friendly:** Authenticate via environment variables and use the GitHub Action for automated deploys.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g blodemd
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Or run without installing:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx blodemd
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Requires Node.js 18+.
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Scaffold a new docs folder
|
|
32
|
+
blodemd init
|
|
33
|
+
|
|
34
|
+
# Preview locally
|
|
35
|
+
blodemd dev
|
|
36
|
+
|
|
37
|
+
# Authenticate
|
|
38
|
+
blodemd login
|
|
39
|
+
|
|
40
|
+
# Deploy your docs
|
|
41
|
+
blodemd push
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
blodemd init [dir] Scaffold a docs folder (default: docs)
|
|
48
|
+
blodemd login Authenticate with your API key
|
|
49
|
+
blodemd logout Remove stored credentials
|
|
50
|
+
blodemd whoami Show current authentication
|
|
51
|
+
blodemd validate [dir] Validate docs.json
|
|
52
|
+
blodemd push [dir] Deploy docs
|
|
53
|
+
blodemd dev [dir] Start the local docs preview server
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### `push` Options
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
--project <slug> Project slug (env: BLODEMD_PROJECT)
|
|
60
|
+
--api-url <url> API URL (env: BLODEMD_API_URL)
|
|
61
|
+
--api-key <token> API key (env: BLODEMD_API_KEY)
|
|
62
|
+
--branch <name> Git branch (env: BLODEMD_BRANCH)
|
|
63
|
+
--message <msg> Deploy message (env: BLODEMD_COMMIT_MESSAGE)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The CLI reads the project slug from the `name` field in `docs.json` when `--project` is not set.
|
|
67
|
+
|
|
68
|
+
### `dev` Options
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
--dir <dir> Docs directory
|
|
72
|
+
--port <port> Local preview port (default: 3030)
|
|
73
|
+
--no-open Don't open the browser automatically
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## CI / GitHub Actions
|
|
77
|
+
|
|
78
|
+
Use the `mblode/blodemd/packages/deploy-action` composite action to deploy on every push:
|
|
79
|
+
|
|
80
|
+
```yaml
|
|
81
|
+
- uses: mblode/blodemd/packages/deploy-action@main
|
|
82
|
+
with:
|
|
83
|
+
api-key: ${{ secrets.BLODEMD_API_KEY }}
|
|
84
|
+
directory: docs
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
The CLI looks for a `docs.json` file in the docs directory. Minimal example:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"$schema": "https://mintlify.com/docs.json",
|
|
94
|
+
"name": "my-project",
|
|
95
|
+
"theme": "mint",
|
|
96
|
+
"colors": { "primary": "#0D9373" },
|
|
97
|
+
"navigation": {
|
|
98
|
+
"groups": [{ "group": "Getting Started", "pages": ["index"] }]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The CLI searches for `docs.json` in the current directory, then `docs/`, then `apps/docs/`.
|
|
104
|
+
|
|
105
|
+
## Programmatic API
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import type { DeploymentResponse } from "blodemd";
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The package exports the `DeploymentResponse` type for use in custom deployment scripts.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
[MIT](../../LICENSE)
|