projview 0.8.3 → 1.0.0
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 +38 -33
- package/docs/how-to-set-up.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# projview
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
directory, get a soft-dark cartoonish localhost view of every `.md` / `.mmd`
|
|
5
|
-
under it, close it and nothing's left
|
|
3
|
+
a fast, zero-config local viewer for **markdown** + **mermaid** files. run it in
|
|
4
|
+
any directory, get a soft-dark cartoonish localhost view of every `.md` / `.mmd`
|
|
5
|
+
under it - rendered diagrams, search, live reload - close it and nothing's left
|
|
6
|
+
behind.
|
|
7
|
+
|
|
8
|
+
that's the product. point it at a docs folder, read comfortably, ctrl-c, gone.
|
|
6
9
|
|
|
7
10
|
## install
|
|
8
11
|
|
|
@@ -26,10 +29,28 @@ projview ./docs --port 5000
|
|
|
26
29
|
projview /path/to/notes --no-open
|
|
27
30
|
```
|
|
28
31
|
|
|
29
|
-
##
|
|
32
|
+
## what you get
|
|
33
|
+
|
|
34
|
+
| | |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| tree nav | every `.md` / `.mmd` under the root (skips `node_modules`, `dist`, dot-dirs) |
|
|
37
|
+
| rendering | markdown + syntax-highlighted code + **mermaid diagrams** (with pan/zoom) |
|
|
38
|
+
| search | `⌘K` palette - fuzzy filenames + full-text content with line snippets |
|
|
39
|
+
| live reload | edit a file, the browser updates |
|
|
40
|
+
| ephemeral | in-memory by default; nothing written to disk, nothing left behind |
|
|
41
|
+
|
|
42
|
+
see [samples/architecture.md](samples/architecture.md) for a mermaid demo.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## beyond viewing (optional)
|
|
47
|
+
|
|
48
|
+
the viewer is the point - everything below is opt-in and entirely ignorable.
|
|
30
49
|
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
### machine interface
|
|
51
|
+
|
|
52
|
+
subcommands that print JSON to stdout and exit (no server, no browser), if a
|
|
53
|
+
script or agent wants to query the same docs:
|
|
33
54
|
|
|
34
55
|
```bash
|
|
35
56
|
projview search "<query>" [path] # ranked: filename matches + in-content hits w/ line snippets
|
|
@@ -37,7 +58,6 @@ projview tree [path] # the file tree as JSON
|
|
|
37
58
|
projview comment add <file> "…" # leave a comment (--heading <id> to anchor a section)
|
|
38
59
|
projview comments [file] # list comments as JSON
|
|
39
60
|
projview usage [path] # views + searches recorded by the viewer
|
|
40
|
-
projview search "mermaid" --demo # quick test on the bundled docs
|
|
41
61
|
```
|
|
42
62
|
|
|
43
63
|
```jsonc
|
|
@@ -48,31 +68,18 @@ projview search "mermaid" --demo # quick test on the bundled docs
|
|
|
48
68
|
"snippets": [ { "line": 68, "text": "### live reload" } ] } ] }
|
|
49
69
|
```
|
|
50
70
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
| step | detail |
|
|
54
|
-
| --- | --- |
|
|
55
|
-
| walk | recursively finds `.md` / `.mmd`, skips `node_modules`, `dist`, dot-dirs |
|
|
56
|
-
| index | builds an in-memory tree (nothing written to disk by default) |
|
|
57
|
-
| serve | spawns a localhost site + opens your browser |
|
|
58
|
-
| live | edits to files reload in the browser automatically |
|
|
59
|
-
| comment | leave notes on a file, a section, or a text selection (browser or CLI) |
|
|
60
|
-
|
|
61
|
-
> ephemeral by default - ctrl-c and it's gone. opt into persistence below.
|
|
71
|
+
### comments
|
|
62
72
|
|
|
63
|
-
|
|
73
|
+
notes on a whole file, a heading, or a selected passage - from the viewer (the
|
|
74
|
+
💬 button) or the CLI / HTTP API. text comments **re-anchor** as the doc changes
|
|
75
|
+
and flag themselves *orphaned* only if the quoted text truly disappears. they
|
|
76
|
+
need a persistent store to survive a restart; writes are **localhost-only** (an
|
|
77
|
+
exposed instance is read-only).
|
|
64
78
|
|
|
65
|
-
|
|
66
|
-
viewer (the 💬 button, bottom-right) or via the CLI / HTTP API. Text comments
|
|
67
|
-
**re-anchor** as the doc changes and only flag themselves *orphaned* if the quoted
|
|
68
|
-
text truly disappears. Comments persist when you opt into a store
|
|
69
|
-
(`--persist` / `--store-url`); writes are **localhost-only** (an exposed instance
|
|
70
|
-
is read-only).
|
|
79
|
+
### persistence
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
By default the index is in-memory and nothing is written to disk. Opt in for a
|
|
75
|
-
faster warm start, or a queryable store an AI can read:
|
|
81
|
+
by default the index is in-memory. opt in for a faster warm start, persistent
|
|
82
|
+
comments, or a queryable store:
|
|
76
83
|
|
|
77
84
|
```bash
|
|
78
85
|
projview docs --persist # sqlite cache in ~/.projview/cache
|
|
@@ -87,7 +94,5 @@ projview docs --store-url "$DATABASE_URL" # your own postgres (need
|
|
|
87
94
|
| `superlite` (JSON) | `--store superlite --persist` |
|
|
88
95
|
| `custom` (sqlite/postgres URL) | `--store-url <url>` (or `DATABASE_URL`) |
|
|
89
96
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
see [samples/architecture.md](samples/architecture.md) for a mermaid demo.
|
|
97
|
+
on re-run it reloads the cache and only re-reads files whose mtime changed.
|
|
98
|
+
connection strings come from env/`~/.projview` - never commit credentials.
|
package/docs/how-to-set-up.md
CHANGED
|
@@ -67,7 +67,7 @@ npm install
|
|
|
67
67
|
npm run demo # preview the bundled docs/ (alias for --demo)
|
|
68
68
|
npm start # index the current directory
|
|
69
69
|
node bin/projview.js ./docs # or call the CLI directly
|
|
70
|
-
npm test # run the test suite (node:test,
|
|
70
|
+
npm test # run the test suite (node:test, 54 tests)
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
See the [project README](README.md) for the architecture and the
|