mdzilla 0.0.0 → 0.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Pooya Parsa <pooya@pi0.io>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ <p align="center">
2
+ <img src=".assets/logo.svg" alt="mdzilla" width="200" height="200">
3
+ </p>
4
+
5
+ <h1 align="center">mdzilla</h1>
6
+
7
+ <p align="center">
8
+ Markdown browser for humans and agents.
9
+ </p>
10
+
11
+ <p align="center">
12
+
13
+ </p>
14
+
15
+ > Browse docs from local directories, GitHub repos, and remote websites — all from your terminal. Built on [md4x](https://github.com/unjs/md4x), [mdream](https://github.com/harlan-zw/mdream), [giget](https://github.com/unjs/giget) and [speed-highlight](https://github.com/speed-highlight/core).
16
+
17
+ Supports any website with [`/llms.txt`](https://llmstxt.org/) or markdown content negotiation.
18
+
19
+ Works best with [Docus](https://docus.dev)/[Undocs](https://undocs.pages.dev/) docs sources.
20
+
21
+ ## Quick Start
22
+
23
+ ```sh
24
+ npx mdzilla <dir> # Browse local docs directory
25
+ npx mdzilla <file.md> # Render a single markdown file
26
+ npx mdzilla gh:owner/repo # Browse GitHub repo docs
27
+ npx mdzilla npm:package-name # Browse npm package docs
28
+ npx mdzilla https://example.com # Browse remote docs via HTTP
29
+ ```
30
+
31
+ ## Agent Skill
32
+
33
+ Install the mdzilla skill for AI agents using:
34
+
35
+ ```sh
36
+ npx skills install pi0/mdzilla
37
+ ```
38
+
39
+ ## Features
40
+
41
+ ### Multiple Sources
42
+
43
+ | Source | Syntax | Description |
44
+ | :-------------- | :--------------------------- | :-------------------------------- |
45
+ | **Local** | `mdzilla ./docs` | Scan a local docs directory |
46
+ | **Single file** | `mdzilla README.md` | Render a single markdown file |
47
+ | **GitHub** | `mdzilla gh:unjs/h3` | Download and browse a GitHub repo |
48
+ | **npm** | `mdzilla npm:h3` | Browse an npm package's docs |
49
+ | **HTTP** | `mdzilla https://h3.unjs.io` | Browse remote docs via HTTP |
50
+
51
+ ### Export
52
+
53
+ Flatten any docs source into plain `.md` files:
54
+
55
+ ```sh
56
+ npx mdzilla <source> --export <outdir>
57
+ ```
58
+
59
+ ### Headless Mode
60
+
61
+ Use `--plain` for non-interactive output — auto-enabled when called by AI agents or when stdout is not a TTY.
62
+
63
+ ### Keyboard Controls
64
+
65
+ <details>
66
+ <summary><strong>Browse mode</strong></summary>
67
+
68
+ | Key | Action |
69
+ | :-------------------- | :------------------- |
70
+ | `↑` `↓` / `j` `k` | Navigate entries |
71
+ | `Enter` / `Tab` / `→` | Focus content |
72
+ | `Space` / `PgDn` | Page down |
73
+ | `b` / `PgUp` | Page up |
74
+ | `g` / `G` | Jump to first / last |
75
+ | `/` | Search |
76
+ | `t` | Toggle sidebar |
77
+ | `q` | Quit |
78
+
79
+ </details>
80
+
81
+ <details>
82
+ <summary><strong>Content mode</strong></summary>
83
+
84
+ | Key | Action |
85
+ | :------------------ | :-------------------- |
86
+ | `↑` `↓` / `j` `k` | Scroll |
87
+ | `Space` / `PgDn` | Page down |
88
+ | `b` / `PgUp` | Page up |
89
+ | `g` / `G` | Jump to top / bottom |
90
+ | `/` | Search in page |
91
+ | `n` / `N` | Next / previous match |
92
+ | `Tab` / `Shift+Tab` | Cycle links |
93
+ | `Enter` | Open link |
94
+ | `Backspace` / `Esc` | Back to nav |
95
+ | `q` | Quit |
96
+
97
+ </details>
98
+
99
+ <details>
100
+ <summary><strong>Search mode</strong></summary>
101
+
102
+ | Key | Action |
103
+ | :------ | :--------------- |
104
+ | _Type_ | Filter results |
105
+ | `↑` `↓` | Navigate results |
106
+ | `Enter` | Confirm |
107
+ | `Esc` | Cancel |
108
+
109
+ </details>
110
+
111
+ ## Programmatic API
112
+
113
+ ```js
114
+ import { DocsManager, DocsSourceFS } from "mdzilla";
115
+
116
+ const docs = new DocsManager(new DocsSourceFS("./docs"));
117
+ await docs.load();
118
+
119
+ // Browse the navigation tree
120
+ console.log(docs.tree);
121
+
122
+ // Get page content
123
+ const content = await docs.getContent(docs.flat[0]);
124
+ ```
125
+
126
+ ## Development
127
+
128
+ <details>
129
+
130
+ <summary>Local development</summary>
131
+
132
+ - Clone this repository
133
+ - Install latest LTS version of [Node.js](https://nodejs.org/en/)
134
+ - Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
135
+ - Install dependencies using `pnpm install`
136
+ - Run interactive tests using `pnpm dev`
137
+
138
+ </details>
139
+
140
+ ## License
141
+
142
+ Published under the [MIT](https://github.com/pi0/mdzilla/blob/main/LICENSE) license.