@choonkeat/md-serve 0.6.3 → 0.8.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 +15 -4
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ rendering isn't what you want:
|
|
|
43
43
|
| Append to a URL | What you get |
|
|
44
44
|
| --- | --- |
|
|
45
45
|
| `?listing=1` | The bare file listing for a directory — even when an `index.html` or `README.md` would otherwise take over. This is what the **Home** breadcrumb links to. |
|
|
46
|
-
| `?pretty=0` | The **raw source** of a file that normally renders — e.g. `README.md?pretty=0` or `index.html?pretty=0` returns the bytes as `text/plain` instead of the rendered page. |
|
|
46
|
+
| `?pretty=0` | The **raw source** of a file that normally renders — e.g. `README.md?pretty=0` or `index.html?pretty=0` returns the bytes as `text/plain` instead of the rendered page. On a *directory* URL it's a synonym for `?listing=1`: same rule, "give me the plain thing", applied to a directory. |
|
|
47
47
|
| `?pretty=1` | A **syntax-highlighted** view of a source file, with linkable line numbers (e.g. `main.go?pretty=1#L42`). |
|
|
48
48
|
|
|
49
49
|
## Install
|
|
@@ -84,8 +84,10 @@ md-serve -version
|
|
|
84
84
|
`Home / <file>` breadcrumb — the **Home** crumb (a link to
|
|
85
85
|
`?listing=1`) drops you to the bare file listing. Otherwise a plain
|
|
86
86
|
generated listing with **Name / Size / Modified** columns. Appending
|
|
87
|
-
`?listing=1` to any directory URL forces that listing,
|
|
88
|
-
`index.html` too.
|
|
87
|
+
`?listing=1` (or `?pretty=0`) to any directory URL forces that listing,
|
|
88
|
+
bypassing `index.html` too. Click any column header to sort by it (click again to
|
|
89
|
+
reverse); the choice is remembered across pages. Folders stay grouped
|
|
90
|
+
above files, and `Modified` is shown in your browser's own timezone.
|
|
89
91
|
- Everything else is served byte-for-byte. That means `.js`, `.css`,
|
|
90
92
|
`.wasm`, `.json`, images, fonts, and the rest all reach the browser
|
|
91
93
|
with their normal MIME types — ES module scripts load, fetch() works,
|
|
@@ -123,7 +125,8 @@ md-serve -version
|
|
|
123
125
|
## Develop
|
|
124
126
|
|
|
125
127
|
```sh
|
|
126
|
-
make build # cross-compile all 6 platform binaries → npm-platforms
|
|
128
|
+
make build # cross-compile all 6 platform binaries → npm-platforms/, then link
|
|
129
|
+
make link # just the link step: put this checkout's md-serve on PATH
|
|
127
130
|
make test # go vet
|
|
128
131
|
make publish-dry # rehearse the npm publish
|
|
129
132
|
make publish # ship to npm
|
|
@@ -135,6 +138,14 @@ right `@choonkeat/md-serve-<platform>-<arch>` optionalDependency at
|
|
|
135
138
|
runtime, falling back to a locally built binary in `npm-platforms/`
|
|
136
139
|
during development.
|
|
137
140
|
|
|
141
|
+
That fallback is what makes `make build` enough to run your own changes:
|
|
142
|
+
`npm link` symlinks the shim onto your PATH, and the shim prefers
|
|
143
|
+
`npm-platforms/` over the published package, so `md-serve` means "this
|
|
144
|
+
working tree". `make build` prints the resolved path and version banner
|
|
145
|
+
so you can see which build you're about to run. One thing it can't
|
|
146
|
+
reach: `npx @choonkeat/md-serve` resolves from the npx cache and keeps
|
|
147
|
+
running the last *published* release regardless.
|
|
148
|
+
|
|
138
149
|
## License
|
|
139
150
|
|
|
140
151
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@choonkeat/md-serve",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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.8.0",
|
|
23
|
+
"@choonkeat/md-serve-darwin-x64": "0.8.0",
|
|
24
|
+
"@choonkeat/md-serve-linux-arm64": "0.8.0",
|
|
25
|
+
"@choonkeat/md-serve-linux-x64": "0.8.0",
|
|
26
|
+
"@choonkeat/md-serve-win32-arm64": "0.8.0",
|
|
27
|
+
"@choonkeat/md-serve-win32-x64": "0.8.0"
|
|
28
28
|
}
|
|
29
29
|
}
|