markmap-cli 0.15.9-alpha.0 → 0.15.9-alpha.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 +10 -8
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -9,14 +9,14 @@ import { buildCSSItem, buildJSItem, defer } from "markmap-common";
|
|
|
9
9
|
import { Transformer, baseJsPaths } from "markmap-lib";
|
|
10
10
|
export * from "markmap-lib";
|
|
11
11
|
import { packageDirectory } from "pkg-dir";
|
|
12
|
-
import { createReadStream, createWriteStream } from "fs";
|
|
13
|
-
import { EventEmitter } from "events";
|
|
14
12
|
import { serve } from "@hono/node-server";
|
|
15
|
-
import { Hono } from "hono";
|
|
16
13
|
import chokidar from "chokidar";
|
|
14
|
+
import { EventEmitter } from "events";
|
|
15
|
+
import { createReadStream, createWriteStream } from "fs";
|
|
16
|
+
import { Hono } from "hono";
|
|
17
17
|
import { Readable } from "stream";
|
|
18
18
|
import { finished } from "stream/promises";
|
|
19
|
-
const TOOLBAR_VERSION = "0.15.9-alpha.
|
|
19
|
+
const TOOLBAR_VERSION = "0.15.9-alpha.6";
|
|
20
20
|
const TOOLBAR_CSS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/style.css`;
|
|
21
21
|
const TOOLBAR_JS = `markmap-toolbar@${TOOLBAR_VERSION}/dist/index.js`;
|
|
22
22
|
const ASSETS_PREFIX = "/assets/";
|
|
@@ -282,12 +282,14 @@ function startServer(paddingBottom) {
|
|
|
282
282
|
dfs(root);
|
|
283
283
|
return best;
|
|
284
284
|
function dfs(node) {
|
|
285
|
-
var _a, _b;
|
|
286
|
-
const lines = (_a = node.payload) == null ? void 0 : _a.lines;
|
|
287
|
-
|
|
285
|
+
var _a, _b, _c;
|
|
286
|
+
const lines = ((_b = (_a = node.payload) == null ? void 0 : _a.lines) == null ? void 0 : _b.split(",")) || [];
|
|
287
|
+
const start = +lines[0];
|
|
288
|
+
const end = +lines[1];
|
|
289
|
+
if (start >= 0 && start <= lineWithoutFrontmatter && lineWithoutFrontmatter < end) {
|
|
288
290
|
best = node;
|
|
289
291
|
}
|
|
290
|
-
(
|
|
292
|
+
(_c = node.children) == null ? void 0 : _c.forEach(dfs);
|
|
291
293
|
}
|
|
292
294
|
}
|
|
293
295
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markmap-cli",
|
|
3
|
-
"version": "0.15.9-alpha.
|
|
3
|
+
"version": "0.15.9-alpha.6+ccc1c15",
|
|
4
4
|
"description": "Create markmaps from CLI",
|
|
5
5
|
"author": "Gerald <gera2ld@live.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"chokidar": "^3.5.3",
|
|
48
48
|
"commander": "^11.1.0",
|
|
49
49
|
"hono": "^3.11.8",
|
|
50
|
-
"markmap-common": "0.15.9-alpha.
|
|
51
|
-
"markmap-lib": "0.15.9-alpha.
|
|
52
|
-
"markmap-toolbar": "0.15.9-alpha.
|
|
50
|
+
"markmap-common": "0.15.9-alpha.6+ccc1c15",
|
|
51
|
+
"markmap-lib": "0.15.9-alpha.6+ccc1c15",
|
|
52
|
+
"markmap-toolbar": "0.15.9-alpha.6+ccc1c15",
|
|
53
53
|
"open": "^10.0.0",
|
|
54
54
|
"pkg-dir": "^8.0.0",
|
|
55
55
|
"read-package-up": "^11.0.0",
|
|
56
56
|
"update-notifier": "^7.0.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "ccc1c157905c0a8aedbadcb579a79d7114b45b0b"
|
|
59
59
|
}
|