ghost-paper 0.2.0 → 0.3.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 +5 -3
- package/dist/cli.js +3 -2
- package/package.json +2 -2
- package/dist/-5YRZFEDB.js +0 -10
- package/dist/-6A745MKY.js +0 -10
- package/dist/-ANANGS26.js +0 -10
- package/dist/-EON5YM73.js +0 -10
- package/dist/-FCFRRCIG.js +0 -10
- package/dist/-HRRPL4SN.js +0 -10
- package/dist/-K6SQE2E5.js +0 -10
- package/dist/-N6RDWVBC.js +0 -10
- package/dist/-NRPITI2A.js +0 -10
- package/dist/-OKZHAHO3.js +0 -10
- package/dist/-RMMSGBXC.js +0 -10
- package/dist/-RZB6N6OZ.js +0 -10
- package/dist/-TG5MSQYZ.js +0 -10
- package/dist/-TTLTI6LQ.js +0 -10
- package/dist/-U5MQJGM2.js +0 -10
- package/dist/-YCMFHAET.js +0 -10
- package/dist/chunk-2QOHE4NF.js +0 -1464
- package/dist/chunk-3HX4SVJH.js +0 -1504
- package/dist/chunk-4P2YAHD2.js +0 -1522
- package/dist/chunk-6WF3MSUR.js +0 -1362
- package/dist/chunk-DSRRH4T2.js +0 -1425
- package/dist/chunk-J2XA7LOH.js +0 -1463
- package/dist/chunk-MNZVZ2ZA.js +0 -1464
- package/dist/chunk-NUWIGEJ3.js +0 -1462
- package/dist/chunk-QMHJ3BGD.js +0 -1471
- package/dist/chunk-RMODJYHI.js +0 -1526
- package/dist/chunk-SOKYK7YV.js +0 -1496
- package/dist/chunk-TV6ABXBU.js +0 -1534
- package/dist/chunk-TW7HQTU6.js +0 -1444
- package/dist/chunk-U2G5K2PR.js +0 -1465
- package/dist/chunk-UWUILD43.js +0 -1471
- package/dist/chunk-ZRSWDAXH.js +0 -1433
- package/dist/pdf-ADH6BBSB.js +0 -71
- package/dist/pdf-EDRHZK4V.js +0 -72
- package/dist/pdf-HC6MMT72.js +0 -62
- package/dist/pdf-SKUNOP45.js +0 -62
- package/dist/pdf-TQDMPPSC.js +0 -71
- package/dist/pdf-VCMDLIDX.js +0 -71
- package/dist/pdf-WLYWKSHR.js +0 -71
package/README.md
CHANGED
|
@@ -13,14 +13,16 @@ npm install -g ghost-paper
|
|
|
13
13
|
Or run directly:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npx ghost-paper build report.md
|
|
16
|
+
npx ghost-paper build html report.md
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
ghost-paper build report.md # → report.html
|
|
23
|
-
ghost-paper build report.md -o output.html # custom output path
|
|
22
|
+
ghost-paper build html report.md # → report.html
|
|
23
|
+
ghost-paper build html report.md -o output.html # custom output path
|
|
24
|
+
ghost-paper build pdf report.md # → report.pdf
|
|
25
|
+
ghost-paper build pdf report.md --landscape # landscape orientation
|
|
24
26
|
```
|
|
25
27
|
|
|
26
28
|
Open the resulting HTML file in any browser. Everything is self-contained — no server needed.
|
package/dist/cli.js
CHANGED
|
@@ -59,7 +59,8 @@ Write standard markdown tables. Ghost Paper auto-classifies them:
|
|
|
59
59
|
|
|
60
60
|
Any table that doesn't match these patterns renders as a styled HTML table.`);
|
|
61
61
|
});
|
|
62
|
-
program.command("build").description("Convert a markdown file to
|
|
62
|
+
var buildCmd = program.command("build").description("Convert a markdown file to HTML or PDF");
|
|
63
|
+
buildCmd.command("html").description("Convert a markdown file to an HTML report").argument("<input>", "Markdown file path").option("-o, --output <path>", "Output HTML file path").action((input, opts) => {
|
|
63
64
|
const inputPath = resolve(input);
|
|
64
65
|
const markdown = readFileSync(inputPath, "utf-8");
|
|
65
66
|
const outputPath = opts.output ? resolve(opts.output) : inputPath.replace(/\.md$/, ".html");
|
|
@@ -67,7 +68,7 @@ program.command("build").description("Convert a markdown file to an HTML report"
|
|
|
67
68
|
writeFileSync(outputPath, html, "utf-8");
|
|
68
69
|
console.log(`\u2728 ${outputPath}`);
|
|
69
70
|
});
|
|
70
|
-
|
|
71
|
+
buildCmd.command("pdf").description("Convert a markdown file to a PDF report").argument("<input>", "Markdown file path").option("-o, --output <path>", "Output PDF file path").option("--page-size <size>", "Page size: A4 or Letter", "A4").option("--landscape", "Use landscape orientation").action(async (input, opts) => {
|
|
71
72
|
const inputPath = resolve(input);
|
|
72
73
|
const markdown = readFileSync(inputPath, "utf-8");
|
|
73
74
|
const outputPath = opts.output ? resolve(opts.output) : inputPath.replace(/\.md$/, ".pdf");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ghost-paper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Turn markdown into beautiful HTML reports",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"ghost-paper": "./dist/cli.js"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "tsup src/cli.ts --format esm --out-dir dist --external puppeteer-core",
|
|
31
|
+
"build": "tsup src/cli.ts --format esm --out-dir dist --external puppeteer-core --clean",
|
|
32
32
|
"dev": "tsup src/cli.ts --format esm --out-dir dist --watch --external puppeteer-core"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
package/dist/-5YRZFEDB.js
DELETED
package/dist/-6A745MKY.js
DELETED
package/dist/-ANANGS26.js
DELETED
package/dist/-EON5YM73.js
DELETED
package/dist/-FCFRRCIG.js
DELETED
package/dist/-HRRPL4SN.js
DELETED
package/dist/-K6SQE2E5.js
DELETED
package/dist/-N6RDWVBC.js
DELETED
package/dist/-NRPITI2A.js
DELETED
package/dist/-OKZHAHO3.js
DELETED
package/dist/-RMMSGBXC.js
DELETED
package/dist/-RZB6N6OZ.js
DELETED
package/dist/-TG5MSQYZ.js
DELETED
package/dist/-TTLTI6LQ.js
DELETED
package/dist/-U5MQJGM2.js
DELETED