@choonkeat/md-serve 0.6.2 → 0.7.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 +41 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -4,6 +4,37 @@ Tiny static file server that renders Markdown (`.md`, `.markdown`) as
|
|
|
4
4
|
GitHub-styled HTML. Single Go binary, distributed via npm with native
|
|
5
5
|
binaries for Linux / macOS / Windows on x64 and arm64.
|
|
6
6
|
|
|
7
|
+
## Go to file
|
|
8
|
+
|
|
9
|
+
Every page carries a top bar: the current path on the left (each ancestor
|
|
10
|
+
segment is a link), a **🔍 Go to file** button on the right. It opens a
|
|
11
|
+
fuzzy file finder over everything under the served directory, the way
|
|
12
|
+
`t` does on GitHub and `⌘P` does in VS Code.
|
|
13
|
+
|
|
14
|
+
- Open it with the button, or press `t`, `/`, `⌘K` / `Ctrl-K`, or
|
|
15
|
+
`⌘P` / `Ctrl-P`. Keys are ignored while you're typing in a field.
|
|
16
|
+
- Type any subsequence of the path: `smg` finds `src/main.go`,
|
|
17
|
+
`pkgjson` finds `package.json`. A contiguous match ranks above a
|
|
18
|
+
scattered one, a tight match above a loose one, a short path above a
|
|
19
|
+
long one.
|
|
20
|
+
- `↑` `↓` to move, `↵` to open, `⌘↵` / `Ctrl-↵` for a new tab, `esc` to
|
|
21
|
+
close. On touch, rows are full-width tap targets showing the filename
|
|
22
|
+
above its directory, with a **Cancel** button instead of `esc`.
|
|
23
|
+
- Results link exactly where the directory listing would: `?pretty=1`
|
|
24
|
+
for source files, trailing `/` for directories.
|
|
25
|
+
|
|
26
|
+
The tree is walked per keystroke (debounced) rather than indexed at
|
|
27
|
+
startup, so a file you just created is findable immediately. The walk
|
|
28
|
+
stops after 500 matches or 20,000 entries — a truncated list says
|
|
29
|
+
`first 50` in its footer. `.git` is skipped; other dotfiles follow
|
|
30
|
+
`-hide-dotfiles`.
|
|
31
|
+
|
|
32
|
+
The endpoint behind it is plain JSON, if you want it directly:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
curl 'http://localhost:8080/_md-serve-search?q=pkgjson'
|
|
36
|
+
```
|
|
37
|
+
|
|
7
38
|
## Protip: query strings
|
|
8
39
|
|
|
9
40
|
A few query strings change how a URL is served — handy when the default
|
|
@@ -92,7 +123,8 @@ md-serve -version
|
|
|
92
123
|
## Develop
|
|
93
124
|
|
|
94
125
|
```sh
|
|
95
|
-
make build # cross-compile all 6 platform binaries → npm-platforms
|
|
126
|
+
make build # cross-compile all 6 platform binaries → npm-platforms/, then link
|
|
127
|
+
make link # just the link step: put this checkout's md-serve on PATH
|
|
96
128
|
make test # go vet
|
|
97
129
|
make publish-dry # rehearse the npm publish
|
|
98
130
|
make publish # ship to npm
|
|
@@ -104,6 +136,14 @@ right `@choonkeat/md-serve-<platform>-<arch>` optionalDependency at
|
|
|
104
136
|
runtime, falling back to a locally built binary in `npm-platforms/`
|
|
105
137
|
during development.
|
|
106
138
|
|
|
139
|
+
That fallback is what makes `make build` enough to run your own changes:
|
|
140
|
+
`npm link` symlinks the shim onto your PATH, and the shim prefers
|
|
141
|
+
`npm-platforms/` over the published package, so `md-serve` means "this
|
|
142
|
+
working tree". `make build` prints the resolved path and version banner
|
|
143
|
+
so you can see which build you're about to run. One thing it can't
|
|
144
|
+
reach: `npx @choonkeat/md-serve` resolves from the npx cache and keeps
|
|
145
|
+
running the last *published* release regardless.
|
|
146
|
+
|
|
107
147
|
## License
|
|
108
148
|
|
|
109
149
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@choonkeat/md-serve",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Tiny static file server that renders Markdown as GitHub-styled HTML",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"@choonkeat/md-serve-darwin-arm64": "0.
|
|
23
|
-
"@choonkeat/md-serve-darwin-x64": "0.
|
|
24
|
-
"@choonkeat/md-serve-linux-arm64": "0.
|
|
25
|
-
"@choonkeat/md-serve-linux-x64": "0.
|
|
26
|
-
"@choonkeat/md-serve-win32-arm64": "0.
|
|
27
|
-
"@choonkeat/md-serve-win32-x64": "0.
|
|
22
|
+
"@choonkeat/md-serve-darwin-arm64": "0.7.0",
|
|
23
|
+
"@choonkeat/md-serve-darwin-x64": "0.7.0",
|
|
24
|
+
"@choonkeat/md-serve-linux-arm64": "0.7.0",
|
|
25
|
+
"@choonkeat/md-serve-linux-x64": "0.7.0",
|
|
26
|
+
"@choonkeat/md-serve-win32-arm64": "0.7.0",
|
|
27
|
+
"@choonkeat/md-serve-win32-x64": "0.7.0"
|
|
28
28
|
}
|
|
29
29
|
}
|