hongdown 0.1.0-dev.9 → 0.1.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.
- package/README.md +55 -13
- package/package.json +35 -35
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@ Hongdown
|
|
|
5
5
|
[![npm][npm badge]][npm]
|
|
6
6
|
[![GitHub Actions][GitHub Actions badge]][GitHub Actions]
|
|
7
7
|
|
|
8
|
-
Hongdown is a Markdown formatter that enforces [Hong Minhee's Markdown
|
|
9
|
-
conventions. The formatter is implemented in Rust using
|
|
10
|
-
for parsing. It produces consistently formatted Markdown
|
|
11
|
-
a distinctive style used across multiple projects including
|
|
12
|
-
and [Optique].
|
|
8
|
+
Hongdown is a Markdown formatter that enforces [Hong Minhee's Markdown
|
|
9
|
+
style](./STYLE.md) conventions. The formatter is implemented in Rust using
|
|
10
|
+
the [Comrak] library for parsing. It produces consistently formatted Markdown
|
|
11
|
+
output following a distinctive style used across multiple projects including
|
|
12
|
+
[Fedify], [LogTape], and [Optique].
|
|
13
13
|
|
|
14
14
|
[crates.io badge]: https://img.shields.io/crates/v/hongdown?logo=rust
|
|
15
15
|
[crates.io]: https://crates.io/crates/hongdown
|
|
@@ -17,7 +17,6 @@ and [Optique].
|
|
|
17
17
|
[npm]: https://www.npmjs.com/package/hongdown
|
|
18
18
|
[GitHub Actions badge]: https://github.com/dahlia/hongdown/actions/workflows/main.yaml/badge.svg
|
|
19
19
|
[GitHub Actions]: https://github.com/dahlia/hongdown/actions/workflows/main.yaml
|
|
20
|
-
[Hong Minhee's Markdown style]: ./AGENTS.md#markdown-style-guide
|
|
21
20
|
[Comrak]: https://comrak.ee/
|
|
22
21
|
[Fedify]: https://fedify.dev/
|
|
23
22
|
[LogTape]: https://logtape.org/
|
|
@@ -36,7 +35,7 @@ npm install -g hongdown
|
|
|
36
35
|
### mise
|
|
37
36
|
|
|
38
37
|
~~~~ bash
|
|
39
|
-
mise use github:dahlia/hongdown
|
|
38
|
+
mise use -g github:dahlia/hongdown
|
|
40
39
|
~~~~
|
|
41
40
|
|
|
42
41
|
### Cargo
|
|
@@ -77,9 +76,11 @@ hongdown -c input.md
|
|
|
77
76
|
hongdown --diff input.md
|
|
78
77
|
hongdown -d input.md
|
|
79
78
|
|
|
80
|
-
# Read from stdin
|
|
81
|
-
echo "# Hello" | hongdown
|
|
79
|
+
# Read from stdin (use --stdin flag or - as filename)
|
|
80
|
+
echo "# Hello" | hongdown --stdin
|
|
81
|
+
echo "# Hello" | hongdown -
|
|
82
82
|
hongdown --stdin < input.md
|
|
83
|
+
hongdown - < input.md
|
|
83
84
|
|
|
84
85
|
# Custom line width
|
|
85
86
|
hongdown --line-width 100 input.md
|
|
@@ -122,7 +123,7 @@ This section is formatted again.
|
|
|
122
123
|
|
|
123
124
|
### Configuration file
|
|
124
125
|
|
|
125
|
-
Hongdown looks for a
|
|
126
|
+
Hongdown looks for a *.hongdown.toml* file in the current directory and
|
|
126
127
|
parent directories. You can also specify a configuration file explicitly
|
|
127
128
|
with the `--config` option.
|
|
128
129
|
|
|
@@ -157,6 +158,11 @@ indent_width = 4 # Indentation for nested items (default: 4)
|
|
|
157
158
|
fence_char = "~" # "~" or "`" (default: "~")
|
|
158
159
|
min_fence_length = 4 # Minimum fence length (default: 4)
|
|
159
160
|
space_after_fence = true # Space between fence and language (default: true)
|
|
161
|
+
default_language = "" # Default language for code blocks (default: "")
|
|
162
|
+
|
|
163
|
+
[thematic_break]
|
|
164
|
+
style = "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
|
|
165
|
+
leading_spaces = 3 # Leading spaces (0-3, default: 3)
|
|
160
166
|
~~~~
|
|
161
167
|
|
|
162
168
|
When `include` patterns are configured, you can run Hongdown without
|
|
@@ -249,9 +255,8 @@ See the [documentation] for more details.
|
|
|
249
255
|
- Pipes are aligned accounting for East Asian wide characters
|
|
250
256
|
- Minimum column width is maintained
|
|
251
257
|
|
|
252
|
-
See
|
|
253
|
-
|
|
254
|
-
[*Markdown style guide*]: ./AGENTS.md#markdown-style-guide
|
|
258
|
+
See *[STYLE.md](./STYLE.md)* for the complete style specification, including
|
|
259
|
+
the philosophy behind these conventions and detailed formatting rules.
|
|
255
260
|
|
|
256
261
|
|
|
257
262
|
Library usage
|
|
@@ -269,6 +274,43 @@ println!("{}", output);
|
|
|
269
274
|
~~~~
|
|
270
275
|
|
|
271
276
|
|
|
277
|
+
Development
|
|
278
|
+
-----------
|
|
279
|
+
|
|
280
|
+
This project uses [mise] for task management.
|
|
281
|
+
|
|
282
|
+
[mise]: https://mise.jdx.dev/
|
|
283
|
+
|
|
284
|
+
### Initial setup
|
|
285
|
+
|
|
286
|
+
After cloning the repository, set up the Git pre-commit hook to automatically
|
|
287
|
+
run quality checks before each commit:
|
|
288
|
+
|
|
289
|
+
~~~~ bash
|
|
290
|
+
mise generate git-pre-commit --task=check --write
|
|
291
|
+
~~~~
|
|
292
|
+
|
|
293
|
+
### Quality checks
|
|
294
|
+
|
|
295
|
+
The following tasks are available:
|
|
296
|
+
|
|
297
|
+
~~~~ bash
|
|
298
|
+
# Run all quality checks
|
|
299
|
+
mise run check
|
|
300
|
+
|
|
301
|
+
# Individual checks
|
|
302
|
+
mise run check:clippy # Run clippy linter
|
|
303
|
+
mise run check:fmt # Check code formatting
|
|
304
|
+
mise run check:type # Run Rust type checking
|
|
305
|
+
mise run check:markdown # Check Markdown formatting
|
|
306
|
+
~~~~
|
|
307
|
+
|
|
308
|
+
See *[AGENTS.md]* for detailed development guidelines including TDD
|
|
309
|
+
practices, code style conventions, and commit message guidelines.
|
|
310
|
+
|
|
311
|
+
[AGENTS.md]: ./AGENTS.md
|
|
312
|
+
|
|
313
|
+
|
|
272
314
|
Etymology
|
|
273
315
|
---------
|
|
274
316
|
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
"name": "hongdown",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A Markdown formatter that enforces Hong Minhee's Markdown style conventions",
|
|
6
|
+
"license": "GPL-3.0-or-later",
|
|
7
|
+
"author": "Hong Minhee \u003chong@minhee.org\u003e",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/dahlia/hongdown.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/dahlia/hongdown",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"markdown",
|
|
15
|
+
"formatter",
|
|
16
|
+
"linter",
|
|
17
|
+
"style"
|
|
18
|
+
],
|
|
19
|
+
"bin": {
|
|
20
|
+
"hongdown": "bin/hongdown.js"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"bin/",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": "\u003e=18"
|
|
28
|
+
},
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"@hongdown/darwin-arm64": "0.1.0",
|
|
31
|
+
"@hongdown/darwin-x64": "0.1.0",
|
|
32
|
+
"@hongdown/linux-arm64": "0.1.0",
|
|
33
|
+
"@hongdown/linux-x64": "0.1.0",
|
|
34
|
+
"@hongdown/win32-arm64": "0.1.0",
|
|
35
|
+
"@hongdown/win32-x64": "0.1.0"
|
|
36
|
+
}
|
|
37
37
|
}
|