hongdown 0.2.5 → 0.3.0-dev.110
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 +32 -8
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -174,7 +174,7 @@ include = [] # Files to format (default: none, specify on CLI)
|
|
|
174
174
|
exclude = [] # Files to skip (default: none)
|
|
175
175
|
|
|
176
176
|
# Formatting options
|
|
177
|
-
line_width = 80 # Maximum line width (default: 80)
|
|
177
|
+
line_width = 80 # Maximum line width (min: 8, default: 80)
|
|
178
178
|
|
|
179
179
|
[heading]
|
|
180
180
|
setext_h1 = true # Use === underline for h1 (default: true)
|
|
@@ -183,21 +183,21 @@ sentence_case = false # Convert headings to sentence case (default: false)
|
|
|
183
183
|
proper_nouns = [] # Additional proper nouns to preserve (default: [])
|
|
184
184
|
common_nouns = [] # Exclude built-in proper nouns (default: [])
|
|
185
185
|
|
|
186
|
-
[
|
|
186
|
+
[unordered_list]
|
|
187
187
|
unordered_marker = "-" # "-", "*", or "+" (default: "-")
|
|
188
|
-
leading_spaces = 1 # Spaces before marker (default: 1)
|
|
189
|
-
trailing_spaces = 2 # Spaces after marker (default: 2)
|
|
190
|
-
indent_width = 4 # Indentation for nested items (default: 4)
|
|
188
|
+
leading_spaces = 1 # Spaces before marker (0–3, default: 1)
|
|
189
|
+
trailing_spaces = 2 # Spaces after marker (0–3, default: 2)
|
|
190
|
+
indent_width = 4 # Indentation for nested items (min: 1, default: 4)
|
|
191
191
|
|
|
192
192
|
[ordered_list]
|
|
193
193
|
odd_level_marker = "." # "." or ")" at odd nesting levels (default: ".")
|
|
194
194
|
even_level_marker = ")" # "." or ")" at even nesting levels (default: ")")
|
|
195
195
|
pad = "start" # "start" or "end" for number alignment (default: "start")
|
|
196
|
-
indent_width = 4 # Indentation for nested items (default: 4)
|
|
196
|
+
indent_width = 4 # Indentation for nested items (min: 1, default: 4)
|
|
197
197
|
|
|
198
198
|
[code_block]
|
|
199
199
|
fence_char = "~" # "~" or "`" (default: "~")
|
|
200
|
-
min_fence_length = 4 # Minimum fence length (default: 4)
|
|
200
|
+
min_fence_length = 4 # Minimum fence length (min: 3, default: 4)
|
|
201
201
|
space_after_fence = true # Space between fence and language (default: true)
|
|
202
202
|
default_language = "" # Default language for code blocks (default: "")
|
|
203
203
|
|
|
@@ -206,8 +206,9 @@ default_language = "" # Default language for code blocks (default: "")
|
|
|
206
206
|
# javascript = ["deno", "fmt", "--ext=js", "-"]
|
|
207
207
|
|
|
208
208
|
[thematic_break]
|
|
209
|
+
# Must be valid CommonMark: at least 3 of *, -, or _ (with optional spaces)
|
|
209
210
|
style = "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
|
|
210
|
-
leading_spaces = 3 # Leading spaces (0
|
|
211
|
+
leading_spaces = 3 # Leading spaces (0–3, default: 3)
|
|
211
212
|
|
|
212
213
|
[punctuation]
|
|
213
214
|
curly_double_quotes = true # "text" to "text" (default: true)
|
|
@@ -218,6 +219,14 @@ en_dash = false # Disabled by default (use "--" to enable)
|
|
|
218
219
|
em_dash = "--" # -- to --- (default: "--", use false to disable)
|
|
219
220
|
~~~~
|
|
220
221
|
|
|
222
|
+
Configuration values are validated at parse time. Invalid values will produce
|
|
223
|
+
descriptive error messages:
|
|
224
|
+
|
|
225
|
+
~~~~ bash
|
|
226
|
+
$ hongdown --config invalid.toml input.md
|
|
227
|
+
Error: failed to parse configuration file: line_width must be at least 8, got 5.
|
|
228
|
+
~~~~
|
|
229
|
+
|
|
221
230
|
When `include` patterns are configured, you can run Hongdown without
|
|
222
231
|
specifying files:
|
|
223
232
|
|
|
@@ -479,6 +488,21 @@ null_ls.register(hongdown)
|
|
|
479
488
|
[none-ls.nvim]: https://github.com/nvimtools/none-ls.nvim
|
|
480
489
|
[Vladimir Rubin]: https://github.com/dahlia/hongdown/issues/4
|
|
481
490
|
|
|
491
|
+
### Helix
|
|
492
|
+
|
|
493
|
+
If you use [Helix], you can register Hongdown as a formatter (contributed by
|
|
494
|
+
[Jean Simard]):
|
|
495
|
+
|
|
496
|
+
~~~~ toml
|
|
497
|
+
[[language]]
|
|
498
|
+
name = "markdown"
|
|
499
|
+
auto-format = true
|
|
500
|
+
formatter = { command = "hongdown", args = ["--stdin"] }
|
|
501
|
+
~~~~
|
|
502
|
+
|
|
503
|
+
[Helix]: https://helix-editor.com/
|
|
504
|
+
[Jean Simard]: https://github.com/dahlia/hongdown/pull/12
|
|
505
|
+
|
|
482
506
|
|
|
483
507
|
Library usage
|
|
484
508
|
-------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hongdown",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-dev.110+5cba5dc5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Markdown formatter that enforces Hong Minhee's Markdown style conventions",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"node": "\u003e=18"
|
|
28
28
|
},
|
|
29
29
|
"optionalDependencies": {
|
|
30
|
-
"@hongdown/darwin-arm64": "0.
|
|
31
|
-
"@hongdown/darwin-x64": "0.
|
|
32
|
-
"@hongdown/linux-arm64": "0.
|
|
33
|
-
"@hongdown/linux-x64": "0.
|
|
34
|
-
"@hongdown/win32-arm64": "0.
|
|
35
|
-
"@hongdown/win32-x64": "0.
|
|
30
|
+
"@hongdown/darwin-arm64": "0.3.0-dev.110+5cba5dc5",
|
|
31
|
+
"@hongdown/darwin-x64": "0.3.0-dev.110+5cba5dc5",
|
|
32
|
+
"@hongdown/linux-arm64": "0.3.0-dev.110+5cba5dc5",
|
|
33
|
+
"@hongdown/linux-x64": "0.3.0-dev.110+5cba5dc5",
|
|
34
|
+
"@hongdown/win32-arm64": "0.3.0-dev.110+5cba5dc5",
|
|
35
|
+
"@hongdown/win32-x64": "0.3.0-dev.110+5cba5dc5"
|
|
36
36
|
}
|
|
37
37
|
}
|