@rivolink/leaf-linux-arm64 1.20.2 → 1.21.1
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 +63 -32
- package/leaf +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<sub>See more screenshots in the <a href="demo/README.md">features</a> demo</sub>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
|
-
## Install
|
|
14
|
+
## Install <img alt="GitHub Downloads (all assets, all releases)" src="https://img.shields.io/github/downloads/RivoLink/leaf/total?color=5fc894" >
|
|
15
15
|
|
|
16
16
|
Install the latest published binary.
|
|
17
17
|
|
|
@@ -67,34 +67,6 @@ npm:
|
|
|
67
67
|
npm update -g @rivolink/leaf
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
## Build
|
|
71
|
-
|
|
72
|
-
Clone the repository:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
git clone https://github.com/RivoLink/leaf.git
|
|
76
|
-
cd leaf
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Build the release binary locally:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
cargo build --release
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Create a local bin directory if needed and symlink `leaf` into it:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
mkdir -p ~/.local/bin
|
|
89
|
-
ln -sf "$(pwd)/target/release/leaf" ~/.local/bin/leaf
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
If `~/.local/bin` is not already on your `PATH`, add it to `~/.bashrc` or `~/.zshrc`:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
export PATH="$HOME/.local/bin:$PATH"
|
|
96
|
-
```
|
|
97
|
-
|
|
98
70
|
## Usage
|
|
99
71
|
|
|
100
72
|
```bash
|
|
@@ -125,7 +97,42 @@ claude "explain Rust lifetimes" | leaf
|
|
|
125
97
|
|
|
126
98
|
# Preview a local file through stdin
|
|
127
99
|
cat TESTING.md | leaf
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Vim Integration
|
|
103
|
+
Add the following to your `~/.vimrc` to preview the current Markdown file in a vertical split:
|
|
104
|
+
|
|
105
|
+
```vim
|
|
106
|
+
" Preview the current Markdown file in a vertical split using leaf
|
|
107
|
+
nnoremap <Leader>md :vertical botright terminal leaf -w %<CR>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Once added, use `\md` to open a live preview. To switch focus back to the Markdown buffer, press `Ctrl+w,h`.
|
|
128
111
|
|
|
112
|
+
## Inline Mode
|
|
113
|
+
|
|
114
|
+
Render Markdown directly to **stdout** without the interactive TUI:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Render to terminal with colors
|
|
118
|
+
leaf --inline README.md
|
|
119
|
+
|
|
120
|
+
# Force plain text, no ANSI codes (no colors)
|
|
121
|
+
leaf --inline plain README.md
|
|
122
|
+
|
|
123
|
+
# Force ANSI colors even when piping
|
|
124
|
+
leaf --inline ansi README.md
|
|
125
|
+
|
|
126
|
+
# Set a specific width
|
|
127
|
+
leaf --inline 60 README.md
|
|
128
|
+
leaf --inline ansi:60 README.md
|
|
129
|
+
|
|
130
|
+
# Pipe from stdin
|
|
131
|
+
cat README.md | leaf --inline
|
|
132
|
+
|
|
133
|
+
# Use as a fzf preview
|
|
134
|
+
find . -name '*.md' | fzf --preview 'leaf --inline ansi {}'
|
|
135
|
+
find . -name '*.md' | fzf --preview 'leaf --inline ansi:$FZF_PREVIEW_COLUMNS {}'
|
|
129
136
|
```
|
|
130
137
|
|
|
131
138
|
## Configuration
|
|
@@ -139,13 +146,36 @@ leaf --config
|
|
|
139
146
|
This opens the configuration file in your editor. If the file does not exist yet, leaf creates it with documented defaults.
|
|
140
147
|
|
|
141
148
|
```toml
|
|
142
|
-
theme = "ocean"
|
|
143
|
-
editor = "nano"
|
|
144
|
-
watch = false
|
|
149
|
+
theme = "ocean" # arctic, forest, ocean, solarized-dark, or a custom theme file
|
|
150
|
+
editor = "nano" # any editor in PATH
|
|
151
|
+
watch = false # auto-reload when opening a file
|
|
152
|
+
extras = ["txt", "rs"] # extra file types shown in the picker
|
|
145
153
|
```
|
|
146
154
|
|
|
147
155
|
All settings are optional. CLI arguments always take priority. See [`config.toml`](config.toml) for details.
|
|
148
156
|
|
|
157
|
+
## Extra Files
|
|
158
|
+
|
|
159
|
+
Non-Markdown files can be listed in the file picker by adding their extensions to `config.toml`:
|
|
160
|
+
|
|
161
|
+
```toml
|
|
162
|
+
extras = ["txt", "csv", "rs", "java", "json", "yaml"]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Code files get syntax highlighting; text files are rendered as plain Markdown.
|
|
166
|
+
|
|
167
|
+
Any file can also be opened directly from the command line, regardless of the `extras` setting:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
leaf main.rs
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Browse and preview code files with fzf:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
find . -name '*.rs' | fzf --preview 'leaf --inline ansi {}'
|
|
177
|
+
```
|
|
178
|
+
|
|
149
179
|
## Custom Themes
|
|
150
180
|
|
|
151
181
|
Create a `.toml` file that inherits from a built-in theme and overrides specific colors:
|
|
@@ -202,6 +232,7 @@ See [`gruvbox.toml`](gruvbox.toml) for a complete example with all available col
|
|
|
202
232
|
- **Editor integration** — Open the current file in your preferred editor.
|
|
203
233
|
- **Frontmatter support** — YAML frontmatter rendered as a table (horizontal or vertical based on key count).
|
|
204
234
|
- **Rich Markdown rendering** — Tables, lists, blockquotes, rules, bold, italic, and strikethrough.
|
|
235
|
+
- **Extra file types** — Open any file; code files get syntax highlighting, text files render as Markdown.
|
|
205
236
|
- **Syntax highlighting** — Common aliases like `py`, `cpp`, `json`, `toml`, `ps1`, `dockerfile`.
|
|
206
237
|
- **LaTeX support** — Inline, block, and `latex` / `tex` code blocks rendered as formulas.
|
|
207
238
|
- **Navigation** — TOC sidebar, active section tracking, heading jumps, and search.
|
package/leaf
CHANGED
|
Binary file
|