@seanmozeik/markdown-display 0.3.5

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -0
  3. package/dist/index.js +194 -0
  4. package/package.json +50 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License Copyright (c) 2026 Sean Lees, Mozeik Ltd.
2
+
3
+ Permission is hereby granted, free of
4
+ charge, to any person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice
12
+ (including the next paragraph) shall be included in all copies or substantial
13
+ portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
18
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,150 @@
1
+ # md (markdown-display)
2
+
3
+ <p align="center">
4
+ <a href="https://docnative.app">
5
+ <img src="https://github.com/seanmozeik/markdown-display/releases/download/v0.3.4/md.gif" alt="md - view markdown in terminal" width="400">
6
+ </a>
7
+ </p>
8
+
9
+ A markdown viewer for the terminal.
10
+
11
+ ## Features
12
+
13
+ **Syntax highlighting** — Shiki, the same engine VS Code uses. 100+ languages. Long lines wrap without breaking ANSI color state.
14
+
15
+ **33 themes** — Catppuccin, Dracula, GitHub, Gruvbox, Material, Nord, One Dark, Rose Pine, Solarized, Tokyo Night. Default is Catppuccin Frappé.
16
+
17
+ **Clickable links** — OSC 8 hyperlinks. Works in iTerm, WezTerm, VS Code terminal, kitty, Alacritty, Hyper.
18
+
19
+ **Paging** — Pipes to `less` when content exceeds terminal height. Short files print directly. Honors `$MD_PAGER` and `$PAGER`.
20
+
21
+ **Layout** — Width adapts to terminal, capped at 120 characters. Optional centering with `maxWidth`.
22
+
23
+ **Typography** — Soft hyphenation at syllable boundaries. Unicode box-drawing for tables. Nested blockquotes. Multi-level lists.
24
+
25
+ **Nerd Fonts** — Language icons in code block headers when available.
26
+
27
+ **Fast** — Bun. Standalone binary. No runtime dependencies.
28
+
29
+ **File picker** — Run with no arguments for interactive fuzzy search. Type to filter, Enter to open.
30
+
31
+ **Truecolor** — 24-bit RGB when supported, degrades to 256-color on older terminals. Auto-detected.
32
+
33
+ **Standards** — Respects `NO_COLOR` and `--no-color`. Runs on macOS, Linux, Windows.
34
+
35
+ ```bash
36
+ md README.md
37
+ md README.md CHANGELOG.md
38
+ cat file.md | md
39
+ curl -s https://example.com/doc.md | md
40
+ ```
41
+
42
+ ## Install
43
+
44
+ **Homebrew**
45
+
46
+ ```bash
47
+ brew install seanmozeik/tap/md
48
+ ```
49
+
50
+ **From source** (requires [Bun](https://bun.sh))
51
+
52
+ ```bash
53
+ git clone https://github.com/mozeik/markdown-display.git
54
+ cd markdown-display
55
+ bun install
56
+ bun run build
57
+ ```
58
+
59
+ Produces a standalone binary. Move it to your PATH.
60
+
61
+ **Windows** — Binary is `mdown` to avoid conflict with the built-in `md` command.
62
+
63
+ ```powershell
64
+ Set-Alias -Name md -Value mdown -Option AllScope
65
+ ```
66
+
67
+ ## Usage
68
+
69
+ ```bash
70
+ md README.md
71
+ md README.md CHANGELOG.md
72
+ md docs/guide.md --width 80
73
+ ```
74
+
75
+ Multiple files are concatenated with filename headers.
76
+
77
+ **Interactive file picker** — Run `md` with no arguments to fuzzy-search and select a markdown file. Type to filter, arrow keys to navigate, Enter to open. Files are sorted by modification time (most recent first).
78
+
79
+ ```
80
+ -w, --width <n> Output width (default: auto)
81
+ -t, --theme <name> Color theme
82
+ --list-themes Show available themes
83
+ -p, --plain No colors
84
+ -r, --raw Pass through unrendered
85
+ --no-color Disable colors (same as NO_COLOR=1)
86
+ --no-pager Print directly, skip pager
87
+ --scroll Horizontal scroll for code
88
+ --wrap Wrap code (default)
89
+ ```
90
+
91
+ ## Configuration
92
+
93
+ `~/.config/md/config.toml`
94
+
95
+ ```toml
96
+ theme = "frappe"
97
+ width = "auto"
98
+ truecolor = "auto"
99
+ nerd_fonts = "auto"
100
+
101
+ [display]
102
+ padding = true
103
+ maxWidth = 0
104
+
105
+ [code]
106
+ wrap = true
107
+ continuation = "→"
108
+
109
+ [text]
110
+ hyphenation = true
111
+ locale = "en-us"
112
+
113
+ [links]
114
+ osc8 = "auto"
115
+ show_urls = false
116
+
117
+ [pager]
118
+ command = ""
119
+ args = ["-r", "-F", "-K", "-X"]
120
+ ```
121
+
122
+ | Setting | Description |
123
+ |---------|-------------|
124
+ | `theme` | Color scheme. `md --list-themes` for options. |
125
+ | `width` | Output width. `"auto"` uses terminal (max 120). |
126
+ | `truecolor` | 24-bit color. `"auto"` detects, `true` forces, `false` uses 256-color. |
127
+ | `nerd_fonts` | Icon support. `"auto"` detects. |
128
+ | `display.padding` | Margins based on terminal width. |
129
+ | `display.maxWidth` | Content width limit. 0 for full width. |
130
+ | `code.wrap` | Wrap long lines. `false` for horizontal scroll. |
131
+ | `code.continuation` | Character at line breaks. |
132
+ | `text.hyphenation` | Break words at syllables. |
133
+ | `text.locale` | Hyphenation language. |
134
+ | `links.osc8` | Clickable hyperlinks. |
135
+ | `links.show_urls` | Print URL after link text. |
136
+ | `pager.command` | Custom pager. Empty uses `$MD_PAGER`, `$PAGER`, or `less`. |
137
+ | `pager.args` | Pager arguments. |
138
+
139
+ ## Build
140
+
141
+ ```bash
142
+ bun run build # standalone binary
143
+ bun run dev # development
144
+ bun test # tests
145
+ bun run check # lint + format
146
+ ```
147
+
148
+ ## License
149
+
150
+ MIT