glow.md(файл создан)
@@ -0,0 +1,207 @@ | |||
1 | + | # Glow | |
2 | + | ||
3 | + | Render markdown on the CLI, with _pizzazz_! | |
4 | + | ||
5 | + | <p align="center"> | |
6 | + | <img src="https://stuff.charm.sh/glow/glow-banner-github.gif" alt="Glow Logo"> | |
7 | + | <a href="https://github.com/charmbracelet/glow/releases"><img src="https://img.shields.io/github/release/charmbracelet/glow.svg" alt="Latest Release"></a> | |
8 | + | <a href="https://pkg.go.dev/github.com/charmbracelet/glow?tab=doc"><img src="https://godoc.org/github.com/golang/gddo?status.svg" alt="GoDoc"></a> | |
9 | + | <a href="https://github.com/charmbracelet/glow/actions"><img src="https://github.com/charmbracelet/glow/workflows/build/badge.svg" alt="Build Status"></a> | |
10 | + | <a href="https://goreportcard.com/report/github.com/charmbracelet/glow"><img src="https://goreportcard.com/badge/charmbracelet/glow" alt="Go ReportCard"></a> | |
11 | + | </p> | |
12 | + | ||
13 | + | <p align="center"> | |
14 | + | <img src="https://github.com/user-attachments/assets/c2246366-f84b-4847-b431-32a61ca07b74" width="800" alt="Glow UI Demo"> | |
15 | + | </p> | |
16 | + | ||
17 | + | ## What is it? | |
18 | + | ||
19 | + | Glow is a terminal based markdown reader designed from the ground up to bring | |
20 | + | out the beauty—and power—of the CLI. | |
21 | + | ||
22 | + | Use it to discover markdown files, read documentation directly on the command | |
23 | + | line. Glow will find local markdown files in subdirectories or a local | |
24 | + | Git repository. | |
25 | + | ||
26 | + | ## Installation | |
27 | + | ||
28 | + | ### Package Manager | |
29 | + | ||
30 | + | ```bash | |
31 | + | # macOS or Linux | |
32 | + | brew install glow | |
33 | + | ||
34 | + | # macOS (with MacPorts) | |
35 | + | sudo port install glow | |
36 | + | ||
37 | + | # Arch Linux (btw) | |
38 | + | pacman -S glow | |
39 | + | ||
40 | + | # Void Linux | |
41 | + | xbps-install -S glow | |
42 | + | ||
43 | + | # Nix shell | |
44 | + | nix-shell -p glow --command glow | |
45 | + | ||
46 | + | # FreeBSD | |
47 | + | pkg install glow | |
48 | + | ||
49 | + | # Solus | |
50 | + | eopkg install glow | |
51 | + | ||
52 | + | # Windows (with Chocolatey, Scoop, or Winget) | |
53 | + | choco install glow | |
54 | + | scoop install glow | |
55 | + | winget install charmbracelet.glow | |
56 | + | ||
57 | + | # Android (with termux) | |
58 | + | pkg install glow | |
59 | + | ||
60 | + | # Debian/Ubuntu | |
61 | + | sudo mkdir -p /etc/apt/keyrings | |
62 | + | curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg | |
63 | + | echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list | |
64 | + | sudo apt update && sudo apt install glow | |
65 | + | ||
66 | + | # Fedora/RHEL | |
67 | + | echo '[charm] | |
68 | + | name=Charm | |
69 | + | baseurl=https://repo.charm.sh/yum/ | |
70 | + | enabled=1 | |
71 | + | gpgcheck=1 | |
72 | + | gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo | |
73 | + | sudo yum install glow | |
74 | + | ``` | |
75 | + | ||
76 | + | Or download a binary from the [releases][releases] page. MacOS, Linux, Windows, | |
77 | + | FreeBSD and OpenBSD binaries are available, as well as Debian, RPM, and Alpine | |
78 | + | packages. ARM builds are also available for macOS, Linux, FreeBSD and OpenBSD. | |
79 | + | ||
80 | + | ### Go | |
81 | + | ||
82 | + | Or just install it with `go`: | |
83 | + | ||
84 | + | ```bash | |
85 | + | go install github.com/charmbracelet/glow@latest | |
86 | + | ``` | |
87 | + | ||
88 | + | ### Build (requires Go 1.21+) | |
89 | + | ||
90 | + | ```bash | |
91 | + | git clone https://github.com/charmbracelet/glow.git | |
92 | + | cd glow | |
93 | + | go build | |
94 | + | ``` | |
95 | + | ||
96 | + | [releases]: https://github.com/charmbracelet/glow/releases | |
97 | + | ||
98 | + | ## The TUI | |
99 | + | ||
100 | + | Simply run `glow` without arguments to start the textual user interface and | |
101 | + | browse local. Glow will find local markdown files in the | |
102 | + | current directory and below or, if you’re in a Git repository, Glow will search | |
103 | + | the repo. | |
104 | + | ||
105 | + | Markdown files can be read with Glow's high-performance pager. Most of the | |
106 | + | keystrokes you know from `less` are the same, but you can press `?` to list | |
107 | + | the hotkeys. | |
108 | + | ||
109 | + | ## The CLI | |
110 | + | ||
111 | + | In addition to a TUI, Glow has a CLI for working with Markdown. To format a | |
112 | + | document use a markdown source as the primary argument: | |
113 | + | ||
114 | + | ```bash | |
115 | + | # Read from file | |
116 | + | glow README.md | |
117 | + | ||
118 | + | # Read from stdin | |
119 | + | echo "[Glow](https://github.com/charmbracelet/glow)" | glow - | |
120 | + | ||
121 | + | # Fetch README from GitHub / GitLab | |
122 | + | glow github.com/charmbracelet/glow | |
123 | + | ||
124 | + | # Fetch markdown from HTTP | |
125 | + | glow https://host.tld/file.md | |
126 | + | ``` | |
127 | + | ||
128 | + | ### Word Wrapping | |
129 | + | ||
130 | + | The `-w` flag lets you set a maximum width at which the output will be wrapped: | |
131 | + | ||
132 | + | ```bash | |
133 | + | glow -w 60 | |
134 | + | ``` | |
135 | + | ||
136 | + | ### Paging | |
137 | + | ||
138 | + | CLI output can be displayed in your preferred pager with the `-p` flag. This defaults | |
139 | + | to the ANSI-aware `less -r` if `$PAGER` is not explicitly set. | |
140 | + | ||
141 | + | ### Styles | |
142 | + | ||
143 | + | You can choose a style with the `-s` flag. When no flag is provided `glow` tries | |
144 | + | to detect your terminal's current background color and automatically picks | |
145 | + | either the `dark` or the `light` style for you. | |
146 | + | ||
147 | + | ```bash | |
148 | + | glow -s [dark|light] | |
149 | + | ``` | |
150 | + | ||
151 | + | Alternatively you can also supply a custom JSON stylesheet: | |
152 | + | ||
153 | + | ```bash | |
154 | + | glow -s mystyle.json | |
155 | + | ``` | |
156 | + | ||
157 | + | For additional usage details see: | |
158 | + | ||
159 | + | ```bash | |
160 | + | glow --help | |
161 | + | ``` | |
162 | + | ||
163 | + | Check out the [Glamour Style Section](https://github.com/charmbracelet/glamour/blob/master/styles/gallery/README.md) | |
164 | + | to find more styles. Or [make your own](https://github.com/charmbracelet/glamour/tree/master/styles)! | |
165 | + | ||
166 | + | ## The Config File | |
167 | + | ||
168 | + | If you find yourself supplying the same flags to `glow` all the time, it's | |
169 | + | probably a good idea to create a config file. Run `glow config`, which will open | |
170 | + | it in your favorite $EDITOR. Alternatively you can manually put a file named | |
171 | + | `glow.yml` in the default config path of you platform. If you're not sure where | |
172 | + | that is, please refer to `glow --help`. | |
173 | + | ||
174 | + | Here's an example config: | |
175 | + | ||
176 | + | ```yaml | |
177 | + | # style name or JSON path (default "auto") | |
178 | + | style: "light" | |
179 | + | # mouse wheel support (TUI-mode only) | |
180 | + | mouse: true | |
181 | + | # use pager to display markdown | |
182 | + | pager: true | |
183 | + | # at which column should we word wrap? | |
184 | + | width: 80 | |
185 | + | # show all files, including hidden and ignored. | |
186 | + | all: true | |
187 | + | ``` | |
188 | + | ||
189 | + | ## Feedback | |
190 | + | ||
191 | + | We’d love to hear your thoughts on this project. Feel free to drop us a note! | |
192 | + | ||
193 | + | - [Twitter](https://twitter.com/charmcli) | |
194 | + | - [The Fediverse](https://mastodon.social/@charmcli) | |
195 | + | - [Discord](https://charm.sh/chat) | |
196 | + | ||
197 | + | ## License | |
198 | + | ||
199 | + | [MIT](https://github.com/charmbracelet/glow/raw/master/LICENSE) | |
200 | + | ||
201 | + | --- | |
202 | + | ||
203 | + | Part of [Charm](https://charm.sh). | |
204 | + | ||
205 | + | <a href="https://charm.sh/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a> | |
206 | + | ||
207 | + | Charm热爱开源 • Charm loves open source |
Новее
Позже