md-pipe 0.8.2 → 0.8.3
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 +22 -0
- package/cli-contract.yaml +31 -7
- package/dist/md-pipe.bundle.mjs +189 -301
- package/dist/md-pipe.bundle.mjs.map +4 -4
- package/docs/cli-reference.md +7 -5
- package/package.json +4 -2
package/docs/cli-reference.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A rendering engine that transforms Markdown manuscripts into HTML/PDF through HTML-comment directives and DOM transformations, without polluting the Markdown source.
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
**Version:** 0.8.
|
|
6
|
+
**Version:** 0.8.3
|
|
7
7
|
|
|
8
8
|
## Table of Contents
|
|
9
9
|
|
|
@@ -42,7 +42,7 @@ Converts HTML-comment directives into class/id/attribute-bearing HTML nodes, emb
|
|
|
42
42
|
|
|
43
43
|
Render a Markdown file through the pipeline.
|
|
44
44
|
|
|
45
|
-
Execute the rendering pipeline on an input file or stdin. Stages: preprocess → render → transform → html → pdf. Use --pipeline to specify the execution range in [start.]end format; omitting start begins from the .md source. When --pipeline is omitted, the output format is inferred from the -o extension (.html → html, .pdf → pdf), then from frontmatter/config, defaulting to html. Output is written to
|
|
45
|
+
Execute the rendering pipeline on an input file or stdin. Stages: preprocess → render → transform → html → pdf. Use --pipeline to specify the execution range in [start.]end format; omitting start begins from the .md source. When --pipeline is omitted, the output format is inferred from the -o extension (.html → html, .pdf → pdf), then from frontmatter/config, defaulting to html. Output is written to the file -o names, otherwise to the frontmatter or project config output, and to stdout when none of them is set. The document, the project config and the files they name are trusted input, read and run with the invoking user's authority: frontmatter chooses the output path and the styles, scripts and template read from any path the user can read; project config transforms run as code; the config is looked up from the current directory to the root; the pdf stage loads the page in Chromium with its scripts and remote resources. Convert only documents and directories you trust.
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
**Usage:**
|
|
@@ -84,13 +84,14 @@ cat report.md | md-pipe --pipeline .transform | md-pipe --pipeline transform.pdf
|
|
|
84
84
|
|
|
|
85
85
|
| `--scripts` | | No | | Additional JavaScript file paths. Multiple values allowed. Appended after theme assets in load order.
|
|
86
86
|
|
|
|
87
|
-
| `--paper-size` | | No |
|
|
87
|
+
| `--paper-size` | | No | | Paper size for the pdf stage. Overrides frontmatter paper.size and the project config pdf.paper.size. A4 when none of them names one.
|
|
88
|
+
|
|
|
88
89
|
| `--landscape` | | No | `false` | Landscape orientation for the pdf stage. |
|
|
89
90
|
| `--header` | | No | | Page header text for the pdf stage. |
|
|
90
91
|
| `--viewport` | | No | | Viewport size for the pdf stage in WIDTHxHEIGHT format (e.g. 1024x768). Controls Puppeteer's page.setViewport() and the viewport meta tag in the default HTML template. When omitted, the default HTML template uses width=device-width, initial-scale=1 and Puppeteer uses its default (800x600).
|
|
91
92
|
|
|
|
92
93
|
| `--margin` | | No | | Page margin for the pdf stage. Example: 16mm, 18mm. |
|
|
93
|
-
| `--prefer-css-page-size` | | No |
|
|
94
|
+
| `--prefer-css-page-size` | | No | | Use CSS @page size instead of the --paper-size value. When enabled, Puppeteer defers to the CSS @page { size: ... } rule for page dimensions, which avoids the 96/72 DPI scaling mismatch between CSS pixels and PDF points. When omitted, frontmatter pdf.preferCSSPageSize and then the project config pdf.preferCSSPageSize apply; disabled when neither sets it.
|
|
94
95
|
|
|
|
95
96
|
|
|
96
97
|
#### Streams
|
|
@@ -207,9 +208,10 @@ x-agent:
|
|
|
207
208
|
recommended_before_use:
|
|
208
209
|
- Check that md-pipe.config.yml exists when using themes or custom directives
|
|
209
210
|
- Verify the optional puppeteer peer dependency is installed and Chromium is available when targeting pdf output
|
|
211
|
+
- Convert only documents and directories you trust; frontmatter chooses the output path and reads files with your authority, and project config transforms run as code
|
|
210
212
|
rollback:
|
|
211
213
|
supported: false
|
|
212
|
-
notes: Output files can be deleted manually;
|
|
214
|
+
notes: Output files can be deleted manually; the side effects are the file writes and the pdf stage's network requests stated in effects.
|
|
213
215
|
retryable_exit_codes:
|
|
214
216
|
- 1
|
|
215
217
|
expected_duration_ms: 5000
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "md-pipe",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "A rendering engine that transforms Markdown to HTML/PDF via directive-driven pipelines",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"browser:install": "puppeteer browsers install chrome",
|
|
15
15
|
"test": "vitest run",
|
|
16
16
|
"test:unit": "vitest run test/unit",
|
|
17
|
-
"test:ci": "vitest run"
|
|
17
|
+
"test:ci": "vitest run",
|
|
18
|
+
"audit:signatures": "npx --yes npm@11.19.1 audit signatures"
|
|
18
19
|
},
|
|
19
20
|
"keywords": [
|
|
20
21
|
"markdown",
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
"cheerio": "^1.2.0",
|
|
53
54
|
"cli-contracts": "^0.35.1",
|
|
54
55
|
"commander": "^14.0.3",
|
|
56
|
+
"domhandler": "^5.0.3",
|
|
55
57
|
"esbuild": "^0.28.2",
|
|
56
58
|
"handlebars": "^4.7.10",
|
|
57
59
|
"js-yaml": "^4.1.1",
|