ironmark 1.10.2 → 1.11.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 +25 -10
- package/package.json +1 -1
- package/wasm/node.js +1 -1
- package/wasm/pkg/ironmark_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -103,17 +103,22 @@ const ansi = renderAnsi(
|
|
|
103
103
|
);
|
|
104
104
|
process.stdout.write(ansi);
|
|
105
105
|
|
|
106
|
+
// With padding — adds horizontal spacing on both sides
|
|
107
|
+
const ansi = renderAnsi("# Hello\n\n> A quote", {}, { padding: 2 });
|
|
108
|
+
process.stdout.write(ansi);
|
|
109
|
+
|
|
106
110
|
// Plain text — strips all ANSI codes (useful for piping to files)
|
|
107
111
|
const plain = renderAnsi("# Hello\n\n> quote", {}, { color: false });
|
|
108
112
|
````
|
|
109
113
|
|
|
110
114
|
#### ANSI options
|
|
111
115
|
|
|
112
|
-
| Option | Type | Default | Description
|
|
113
|
-
| ------------- | --------- | ------- |
|
|
114
|
-
| `width` | `number` | `80` | Column width for word-wrap, heading underlines, rule length. `0` = use default.
|
|
115
|
-
| `color` | `boolean` | `true` | Emit ANSI colour codes. `false` = plain text output.
|
|
116
|
-
| `lineNumbers` | `boolean` | `false` | Show line numbers in fenced code blocks.
|
|
116
|
+
| Option | Type | Default | Description |
|
|
117
|
+
| ------------- | --------- | ------- | --------------------------------------------------------------------------------------------- |
|
|
118
|
+
| `width` | `number` | `80` | Column width for word-wrap, heading underlines, rule length. `0` = use default. |
|
|
119
|
+
| `color` | `boolean` | `true` | Emit ANSI colour codes. `false` = plain text output. |
|
|
120
|
+
| `lineNumbers` | `boolean` | `false` | Show line numbers in fenced code blocks. |
|
|
121
|
+
| `padding` | `number` | `0` | Horizontal padding added to both sides of each line, plus ⌈padding/2⌉ blank lines at the top. |
|
|
117
122
|
|
|
118
123
|
### Browser / Bundler
|
|
119
124
|
|
|
@@ -171,6 +176,7 @@ Both CLIs support the same flags (the npm CLI requires `--ansi` as the first fla
|
|
|
171
176
|
```text
|
|
172
177
|
OPTIONS:
|
|
173
178
|
--width N Terminal column width (default: auto-detect, fallback 80)
|
|
179
|
+
--padding N Horizontal padding added to both sides of each line, plus ceil(padding/2) blank lines at the top (default: 0)
|
|
174
180
|
--no-color Disable ANSI escape codes (plain text)
|
|
175
181
|
-n, --line-numbers Show line numbers in fenced code blocks
|
|
176
182
|
--no-hard-breaks Don't turn soft newlines into hard line breaks
|
|
@@ -278,6 +284,14 @@ fn main() {
|
|
|
278
284
|
);
|
|
279
285
|
print!("{out}");
|
|
280
286
|
|
|
287
|
+
// With padding — adds horizontal spacing on both sides
|
|
288
|
+
let out = render_ansi(
|
|
289
|
+
"# Hello\n\n> A quote",
|
|
290
|
+
&ParseOptions::default(),
|
|
291
|
+
Some(&AnsiOptions { padding: 2, ..AnsiOptions::default() }),
|
|
292
|
+
);
|
|
293
|
+
print!("{out}");
|
|
294
|
+
|
|
281
295
|
// Plain text — no ANSI codes (e.g. for writing to a file)
|
|
282
296
|
let plain = render_ansi(
|
|
283
297
|
"# Hello",
|
|
@@ -289,11 +303,12 @@ fn main() {
|
|
|
289
303
|
|
|
290
304
|
`AnsiOptions` fields:
|
|
291
305
|
|
|
292
|
-
| Field | Type | Default | Description
|
|
293
|
-
| -------------- | ------- | ------- |
|
|
294
|
-
| `width` | `usize` | `80` | Column width for word-wrap, heading underlines, rule length. `0` = disable.
|
|
295
|
-
| `color` | `bool` | `true` | Emit ANSI 256-colour escape codes.
|
|
296
|
-
| `line_numbers` | `bool` | `false` | Show line numbers in fenced code blocks.
|
|
306
|
+
| Field | Type | Default | Description |
|
|
307
|
+
| -------------- | ------- | ------- | --------------------------------------------------------------------------------------------- |
|
|
308
|
+
| `width` | `usize` | `80` | Column width for word-wrap, heading underlines, rule length. `0` = disable. |
|
|
309
|
+
| `color` | `bool` | `true` | Emit ANSI 256-colour escape codes. |
|
|
310
|
+
| `line_numbers` | `bool` | `false` | Show line numbers in fenced code blocks. |
|
|
311
|
+
| `padding` | `usize` | `0` | Horizontal padding added to both sides of each line, plus ⌈padding/2⌉ blank lines at the top. |
|
|
297
312
|
|
|
298
313
|
## C / C++
|
|
299
314
|
|