markmap-cli 0.18.5-alpha.7 → 0.18.6
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/dist/index.js +7 -5
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as markmapLib from "markmap-lib";
|
|
|
6
6
|
import { fillTemplate, baseJsPaths } from "markmap-render";
|
|
7
7
|
import open from "open";
|
|
8
8
|
import { dirname, join, resolve, basename } from "path";
|
|
9
|
+
import { getPortPromise } from "portfinder";
|
|
9
10
|
import { readPackageUp } from "read-package-up";
|
|
10
11
|
import updateNotifier from "update-notifier";
|
|
11
12
|
import { fileURLToPath } from "url";
|
|
@@ -86,7 +87,7 @@ var _baseMimes = {
|
|
|
86
87
|
glb: "model/gltf-binary"
|
|
87
88
|
};
|
|
88
89
|
var baseMimes = _baseMimes;
|
|
89
|
-
const TOOLBAR_VERSION = "0.18.5
|
|
90
|
+
const TOOLBAR_VERSION = "0.18.5";
|
|
90
91
|
const TOOLBAR_CSS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/style.css`;
|
|
91
92
|
const TOOLBAR_JS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/index.js`;
|
|
92
93
|
const distDir = dirname(fileURLToPath(import.meta.url));
|
|
@@ -535,13 +536,13 @@ async function main() {
|
|
|
535
536
|
const notifier = updateNotifier({ pkg });
|
|
536
537
|
notifier.notify();
|
|
537
538
|
const program = new Command();
|
|
538
|
-
program.version(pkg.version).description("Create a markmap from a Markdown input file").arguments("<input>").option("--no-open", "
|
|
539
|
+
program.version(pkg.version).description("Create a markmap from a Markdown input file").arguments("<input>").option("--no-open", "Do not open the output file after generation").option("--no-toolbar", "Do not show toolbar").option("-o, --output <output>", "Specify the filename of the output HTML").option(
|
|
539
540
|
"--offline",
|
|
540
541
|
"Inline all assets to allow the generated HTML to work offline"
|
|
541
542
|
).option(
|
|
542
543
|
"-w, --watch",
|
|
543
|
-
"
|
|
544
|
-
).action(async (input, cmd) => {
|
|
544
|
+
"Watch the input file and update output on the fly, note that this feature is for development only"
|
|
545
|
+
).option("--port <port>", "Set the port for the devServer to listen").action(async (input, cmd) => {
|
|
545
546
|
let { offline } = cmd;
|
|
546
547
|
if (cmd.watch) offline = true;
|
|
547
548
|
if (offline) await fetchAssets();
|
|
@@ -550,7 +551,8 @@ async function main() {
|
|
|
550
551
|
if (cmd.watch) {
|
|
551
552
|
const devServer = await develop({
|
|
552
553
|
toolbar: cmd.toolbar,
|
|
553
|
-
offline
|
|
554
|
+
offline,
|
|
555
|
+
port: +cmd.port || await getPortPromise()
|
|
554
556
|
});
|
|
555
557
|
const address = devServer.serverInfo.address;
|
|
556
558
|
const provider = devServer.addProvider({ filePath: input });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markmap-cli",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "Create markmaps from CLI",
|
|
5
5
|
"author": "Gerald <gera2ld@live.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,13 +49,14 @@
|
|
|
49
49
|
"chokidar": "^4.0.1",
|
|
50
50
|
"commander": "^12.1.0",
|
|
51
51
|
"hono": "^4.6.13",
|
|
52
|
-
"markmap-common": "0.18.5
|
|
53
|
-
"markmap-lib": "0.18.5
|
|
54
|
-
"markmap-render": "0.18.5
|
|
55
|
-
"markmap-toolbar": "0.18.5
|
|
52
|
+
"markmap-common": "0.18.5",
|
|
53
|
+
"markmap-lib": "0.18.5",
|
|
54
|
+
"markmap-render": "0.18.5",
|
|
55
|
+
"markmap-toolbar": "0.18.5",
|
|
56
56
|
"open": "^10.1.0",
|
|
57
|
+
"portfinder": "^1.0.32",
|
|
57
58
|
"read-package-up": "^11.0.0",
|
|
58
59
|
"update-notifier": "^7.3.1"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "fba9dcd20dbb321412b635f09df2ad0e67c29f78"
|
|
61
62
|
}
|