@choonkeat/md-serve 0.3.0 → 0.5.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.
Files changed (2) hide show
  1. package/README.md +10 -1
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -23,6 +23,7 @@ md-serve # serve $PWD on :$PORT (or :8080), live-reload on
23
23
  md-serve -dir ./docs # serve a specific directory
24
24
  md-serve -addr :3000 # bind to a specific address
25
25
  md-serve -no-live # disable the live-reload poller
26
+ md-serve -hide-dotfiles # hide dotfiles (omit from listings, 404 direct requests)
26
27
  md-serve -version
27
28
  ```
28
29
 
@@ -51,7 +52,15 @@ md-serve -version
51
52
  URLs / `curl` / `<script src>` get the raw bytes. Files larger than
52
53
  1 MiB, files that look binary, or files chroma can't lex stay raw
53
54
  even with `?pretty=1`.
54
- - Dotfiles are hidden from listings.
55
+ - Pretty rendering also gates on the `Accept` header: a client whose
56
+ Accept doesn't include `text/html` (e.g. `curl -H 'Accept:
57
+ application/json'`, `fetch()` with an explicit Accept) gets raw
58
+ bytes regardless of `?pretty=1` or the extension's default. So an
59
+ API consumer asking for `/README.md` with `Accept: application/json`
60
+ gets the source, not an HTML wrapper.
61
+ - Dotfiles are served and shown in listings by default. Pass
62
+ `-hide-dotfiles` to omit them from listings and return `404` for
63
+ direct requests to any dotfile (or path under a dotfile directory).
55
64
  - Path traversal is blocked: requests are rejected if they resolve
56
65
  outside the served root.
57
66
  - Live-reload is on by default: rendered pages poll a tiny endpoint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choonkeat/md-serve",
3
- "version": "0.3.0",
3
+ "version": "0.5.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.3.0",
23
- "@choonkeat/md-serve-darwin-x64": "0.3.0",
24
- "@choonkeat/md-serve-linux-arm64": "0.3.0",
25
- "@choonkeat/md-serve-linux-x64": "0.3.0",
26
- "@choonkeat/md-serve-win32-arm64": "0.3.0",
27
- "@choonkeat/md-serve-win32-x64": "0.3.0"
22
+ "@choonkeat/md-serve-darwin-arm64": "0.5.0",
23
+ "@choonkeat/md-serve-darwin-x64": "0.5.0",
24
+ "@choonkeat/md-serve-linux-arm64": "0.5.0",
25
+ "@choonkeat/md-serve-linux-x64": "0.5.0",
26
+ "@choonkeat/md-serve-win32-arm64": "0.5.0",
27
+ "@choonkeat/md-serve-win32-x64": "0.5.0"
28
28
  }
29
29
  }