promaster 1.3.0 → 1.4.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 +7 -6
- package/package.json +1 -1
- package/src/commands/list.js +4 -26
package/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Interactive CLI to browse Markdown from a **public GitHub repo**, grouped into
|
|
4
4
|
three categories: **blog**, **memory**, **books**. Each selected file is
|
|
5
|
-
rendered to a styled, standalone **HTML** page
|
|
5
|
+
rendered to a styled, standalone **HTML** page and opened in your browser —
|
|
6
|
+
nothing is saved to disk.
|
|
6
7
|
|
|
7
8
|
The package ships only the CLI. Your Markdown content lives in your own GitHub
|
|
8
9
|
repo and is fetched at runtime — it is never bundled into npm.
|
|
@@ -33,12 +34,12 @@ promaster list
|
|
|
33
34
|
1. Pick a category: `blog` / `memory` / `books`.
|
|
34
35
|
2. Files are listed newest → oldest (by last git commit date).
|
|
35
36
|
3. Toggle one or more with space, confirm with enter.
|
|
36
|
-
4. Each selection is
|
|
37
|
-
|
|
38
|
-
5.
|
|
37
|
+
4. Each selection is rendered to HTML in a temporary directory and opened in
|
|
38
|
+
your default browser right away.
|
|
39
|
+
5. Press Enter in the CLI when you're done — the temporary files are deleted.
|
|
40
|
+
Nothing is ever written to your project directory.
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
(styles are inlined, with light/dark support).
|
|
42
|
+
The pages render fully offline (styles are inlined, with light/dark support).
|
|
42
43
|
|
|
43
44
|
## Configuration
|
|
44
45
|
|
package/package.json
CHANGED
package/src/commands/list.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { select, checkbox,
|
|
2
|
-
import { resolve, dirname } from "node:path";
|
|
1
|
+
import { select, checkbox, input } from "@inquirer/prompts";
|
|
3
2
|
import { rmSync } from "node:fs";
|
|
4
3
|
import { rm } from "node:fs/promises";
|
|
5
4
|
import { resolveRepo, CATEGORIES } from "../config.js";
|
|
6
5
|
import { listMarkdown, lastCommitDate, fetchRaw, HttpError } from "../github.js";
|
|
7
|
-
import {
|
|
6
|
+
import { saveTemp } from "../download.js";
|
|
8
7
|
import { openInBrowser } from "../open.js";
|
|
9
8
|
|
|
10
9
|
const CONCURRENCY = 5;
|
|
@@ -56,29 +55,8 @@ export async function runList() {
|
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
await openEphemeral(picked, ctx);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const saved = [];
|
|
66
|
-
for (const file of picked) {
|
|
67
|
-
const content = await fetchRaw(file.download_url, ctx);
|
|
68
|
-
saved.push(await save(category, file, content));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
console.log("\nSaved (HTML — click to open in a browser):");
|
|
72
|
-
for (const p of saved) console.log(` ${p}`);
|
|
73
|
-
console.log(`\nOutput dir: ${resolve(process.cwd(), OUTPUT_ROOT, category)}`);
|
|
74
|
-
|
|
75
|
-
const open = await confirm({
|
|
76
|
-
message: `Open ${saved.length === 1 ? "it" : "them"} in your browser now?`,
|
|
77
|
-
default: true,
|
|
78
|
-
});
|
|
79
|
-
if (open) {
|
|
80
|
-
for (const p of saved) openInBrowser(p);
|
|
81
|
-
}
|
|
58
|
+
// All categories open immediately, never persist — temp files deleted on exit.
|
|
59
|
+
await openEphemeral(picked, ctx);
|
|
82
60
|
}
|
|
83
61
|
|
|
84
62
|
// Render picks to OS temp, auto-open in the browser, then delete once the
|