@makuja/peek 1.6.3
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 +21 -0
- package/README.md +75 -0
- package/dist/index.mjs +1473 -0
- package/package.json +85 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Hikaru Otabe
|
|
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,75 @@
|
|
|
1
|
+
# @makuja/peek
|
|
2
|
+
|
|
3
|
+
Markdown and HTML preview CLI with live reload. Spins up a local web server and renders Markdown and HTML files in the browser with real-time updates via Server-Sent Events.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Markdown & HTML preview** - Renders Markdown with GitHub-flavored styles and previews HTML files in an isolated iframe
|
|
8
|
+
- **Live reload** - Automatically refreshes the browser when you save a file
|
|
9
|
+
- **Directory browsing** - Specify a directory to browse and preview Markdown and HTML files from a file tree
|
|
10
|
+
- **Syntax highlighting** - Code blocks are highlighted with Shiki
|
|
11
|
+
- **Custom CSS** - Customize Markdown styles via `--css` flag or `~/.config/peek/style.css`
|
|
12
|
+
- **Dark / Light theme** - Built-in theme toggle
|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
|
|
16
|
+
- Node.js >= 22.0.0
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g @makuja/peek
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Preview a Markdown file
|
|
28
|
+
peek README.md
|
|
29
|
+
|
|
30
|
+
# Preview an HTML file
|
|
31
|
+
peek index.html
|
|
32
|
+
|
|
33
|
+
# Browse a directory (Markdown and HTML files)
|
|
34
|
+
peek docs/
|
|
35
|
+
|
|
36
|
+
# Preview current directory
|
|
37
|
+
peek
|
|
38
|
+
|
|
39
|
+
# Specify port and host
|
|
40
|
+
peek . --port 8080 --host 0.0.0.0
|
|
41
|
+
|
|
42
|
+
# Use custom CSS (Markdown only)
|
|
43
|
+
peek README.md --css ./custom.css
|
|
44
|
+
|
|
45
|
+
# Disable auto-open browser
|
|
46
|
+
peek README.md --no-open
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Options
|
|
50
|
+
|
|
51
|
+
| Option | Short | Default | Description |
|
|
52
|
+
|---|---|---|---|
|
|
53
|
+
| `path` | - | `.` | File (`.md`, `.html`, `.htm`) or directory path to preview |
|
|
54
|
+
| `--port` | `-p` | `3000` | Server port |
|
|
55
|
+
| `--host` | `-H` | `localhost` | Bind hostname (`0.0.0.0` for external access) |
|
|
56
|
+
| `--css` | `-c` | - | Path to a custom CSS file (Markdown only) |
|
|
57
|
+
| `--open` / `--no-open` | - | `true` | Auto-open browser on start |
|
|
58
|
+
|
|
59
|
+
## Custom CSS
|
|
60
|
+
|
|
61
|
+
Content styles for Markdown files can be customized in three ways (in priority order):
|
|
62
|
+
|
|
63
|
+
1. **`--css` flag** - Pass a CSS file path directly
|
|
64
|
+
2. **XDG config** - Place a `style.css` at `$XDG_CONFIG_HOME/peek/style.css` or `~/.config/peek/style.css`
|
|
65
|
+
3. **Built-in styles** - GitHub-flavored Markdown styles (default)
|
|
66
|
+
|
|
67
|
+
Custom CSS only affects the `.markdown-body` content area, not the layout chrome.
|
|
68
|
+
|
|
69
|
+
You can override design tokens (CSS custom properties) for full theme customization. See [`docs/design-token-example.css`](docs/design-token-example.css) for reference.
|
|
70
|
+
|
|
71
|
+
> **Note:** Custom CSS is not applied to HTML file previews. HTML files are rendered as-is in an isolated iframe with their own styles.
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
MIT
|