nuartz 0.1.0 → 0.1.1
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/__tests__/backlinks.test.d.ts +2 -0
- package/dist/__tests__/backlinks.test.d.ts.map +1 -0
- package/dist/__tests__/backlinks.test.js +132 -0
- package/dist/__tests__/backlinks.test.js.map +1 -0
- package/dist/__tests__/fs.test.d.ts +2 -0
- package/dist/__tests__/fs.test.d.ts.map +1 -0
- package/dist/__tests__/fs.test.js +153 -0
- package/dist/__tests__/fs.test.js.map +1 -0
- package/dist/__tests__/markdown.test.d.ts +2 -0
- package/dist/__tests__/markdown.test.d.ts.map +1 -0
- package/dist/__tests__/markdown.test.js +102 -0
- package/dist/__tests__/markdown.test.js.map +1 -0
- package/dist/__tests__/search.test.d.ts +2 -0
- package/dist/__tests__/search.test.d.ts.map +1 -0
- package/dist/__tests__/search.test.js +147 -0
- package/dist/__tests__/search.test.js.map +1 -0
- package/dist/backlinks.d.ts +25 -0
- package/dist/backlinks.d.ts.map +1 -0
- package/dist/backlinks.js +37 -0
- package/dist/backlinks.js.map +1 -0
- package/dist/config.d.ts +46 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -0
- package/dist/fs.d.ts +27 -0
- package/dist/fs.d.ts.map +1 -0
- package/dist/fs.js +113 -0
- package/dist/fs.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown.d.ts +3 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +119 -0
- package/dist/markdown.js.map +1 -0
- package/dist/plugins/arrows.d.ts +4 -0
- package/dist/plugins/arrows.d.ts.map +1 -0
- package/dist/plugins/arrows.js +16 -0
- package/dist/plugins/arrows.js.map +1 -0
- package/dist/plugins/callout.d.ts +4 -0
- package/dist/plugins/callout.d.ts.map +1 -0
- package/dist/plugins/callout.js +75 -0
- package/dist/plugins/callout.js.map +1 -0
- package/dist/plugins/callout.test.d.ts +2 -0
- package/dist/plugins/callout.test.d.ts.map +1 -0
- package/dist/plugins/callout.test.js +75 -0
- package/dist/plugins/callout.test.js.map +1 -0
- package/dist/plugins/comment.d.ts +4 -0
- package/dist/plugins/comment.d.ts.map +1 -0
- package/dist/plugins/comment.js +36 -0
- package/dist/plugins/comment.js.map +1 -0
- package/dist/plugins/comment.test.d.ts +2 -0
- package/dist/plugins/comment.test.d.ts.map +1 -0
- package/dist/plugins/comment.test.js +55 -0
- package/dist/plugins/comment.test.js.map +1 -0
- package/dist/plugins/highlight.d.ts +4 -0
- package/dist/plugins/highlight.d.ts.map +1 -0
- package/dist/plugins/highlight.js +33 -0
- package/dist/plugins/highlight.js.map +1 -0
- package/dist/plugins/highlight.test.d.ts +2 -0
- package/dist/plugins/highlight.test.d.ts.map +1 -0
- package/dist/plugins/highlight.test.js +51 -0
- package/dist/plugins/highlight.test.js.map +1 -0
- package/dist/plugins/tag.d.ts +11 -0
- package/dist/plugins/tag.d.ts.map +1 -0
- package/dist/plugins/tag.js +47 -0
- package/dist/plugins/tag.js.map +1 -0
- package/dist/plugins/tag.test.d.ts +2 -0
- package/dist/plugins/tag.test.d.ts.map +1 -0
- package/dist/plugins/tag.test.js +75 -0
- package/dist/plugins/tag.test.js.map +1 -0
- package/dist/plugins/wikilink.d.ts +12 -0
- package/dist/plugins/wikilink.d.ts.map +1 -0
- package/dist/plugins/wikilink.js +85 -0
- package/dist/plugins/wikilink.js.map +1 -0
- package/dist/plugins/wikilink.test.d.ts +2 -0
- package/dist/plugins/wikilink.test.d.ts.map +1 -0
- package/dist/plugins/wikilink.test.js +99 -0
- package/dist/plugins/wikilink.test.js.map +1 -0
- package/dist/search.d.ts +14 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +35 -0
- package/dist/search.js.map +1 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RenderResult } from "./types.js";
|
|
2
|
+
export interface BacklinkEntry {
|
|
3
|
+
slug: string;
|
|
4
|
+
title: string;
|
|
5
|
+
excerpt: string;
|
|
6
|
+
}
|
|
7
|
+
export type BacklinkIndex = Map<string, BacklinkEntry[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Builds a backlink index from a collection of rendered pages.
|
|
10
|
+
*
|
|
11
|
+
* For each page, its outgoing wikilinks are read and the page is registered
|
|
12
|
+
* as a backlink on every target it points to.
|
|
13
|
+
*
|
|
14
|
+
* @param pages - Map of slug → { result, raw content }
|
|
15
|
+
* @returns Map of slug → pages that link to it
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildBacklinkIndex(pages: Map<string, {
|
|
18
|
+
result: RenderResult;
|
|
19
|
+
raw: string;
|
|
20
|
+
}>): BacklinkIndex;
|
|
21
|
+
/**
|
|
22
|
+
* Looks up backlinks for a given slug.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getBacklinks(index: BacklinkIndex, slug: string): BacklinkEntry[];
|
|
25
|
+
//# sourceMappingURL=backlinks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backlinks.d.ts","sourceRoot":"","sources":["../src/backlinks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAA;AAExD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GACxD,aAAa,CAoBf;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,MAAM,GACX,aAAa,EAAE,CAEjB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildBacklinkIndex = buildBacklinkIndex;
|
|
4
|
+
exports.getBacklinks = getBacklinks;
|
|
5
|
+
/**
|
|
6
|
+
* Builds a backlink index from a collection of rendered pages.
|
|
7
|
+
*
|
|
8
|
+
* For each page, its outgoing wikilinks are read and the page is registered
|
|
9
|
+
* as a backlink on every target it points to.
|
|
10
|
+
*
|
|
11
|
+
* @param pages - Map of slug → { result, raw content }
|
|
12
|
+
* @returns Map of slug → pages that link to it
|
|
13
|
+
*/
|
|
14
|
+
function buildBacklinkIndex(pages) {
|
|
15
|
+
const index = new Map();
|
|
16
|
+
for (const [slug, { result, raw }] of pages) {
|
|
17
|
+
const title = result.frontmatter.title ?? slug;
|
|
18
|
+
const excerpt = raw.replace(/^---[\s\S]*?---/, "").trim().slice(0, 160) + "…";
|
|
19
|
+
for (const target of result.links) {
|
|
20
|
+
const normalizedTarget = target
|
|
21
|
+
.toLowerCase()
|
|
22
|
+
.replace(/\s+/g, "-")
|
|
23
|
+
.replace(/[^\w-]/g, "");
|
|
24
|
+
const existing = index.get(normalizedTarget) ?? [];
|
|
25
|
+
existing.push({ slug, title, excerpt });
|
|
26
|
+
index.set(normalizedTarget, existing);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return index;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Looks up backlinks for a given slug.
|
|
33
|
+
*/
|
|
34
|
+
function getBacklinks(index, slug) {
|
|
35
|
+
return index.get(slug) ?? [];
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=backlinks.js.map
|
|
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@
|
|
|
1
|
+
import type { RenderOptions } from "./types.js";
|
|
2
|
+
export interface NuartzConfig {
|
|
3
|
+
/** Absolute path to the content directory */
|
|
4
|
+
contentDir: string;
|
|
5
|
+
/** Site metadata */
|
|
6
|
+
site: {
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Production URL, e.g. "https://example.com". Defaults to "http://localhost:3000". */
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
locale?: string;
|
|
12
|
+
};
|
|
13
|
+
/** Markdown rendering options */
|
|
14
|
+
markdown?: RenderOptions;
|
|
15
|
+
/** Features to enable/disable */
|
|
16
|
+
features?: {
|
|
17
|
+
wikilinks?: boolean;
|
|
18
|
+
callouts?: boolean;
|
|
19
|
+
tags?: boolean;
|
|
20
|
+
backlinks?: boolean;
|
|
21
|
+
toc?: boolean;
|
|
22
|
+
search?: boolean;
|
|
23
|
+
darkMode?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* What to show on the home page (`/`).
|
|
27
|
+
* - `"index"` — render `content/index.md` (default). Falls back to recent notes if the file doesn't exist.
|
|
28
|
+
* - `"recent"` — show a list of all notes sorted by date.
|
|
29
|
+
*/
|
|
30
|
+
homePage?: "index" | "recent";
|
|
31
|
+
/** Navigation */
|
|
32
|
+
nav?: {
|
|
33
|
+
/** Extra links in the header */
|
|
34
|
+
links?: Array<{
|
|
35
|
+
label: string;
|
|
36
|
+
href: string;
|
|
37
|
+
external?: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export declare function defineConfig(config: NuartzConfig): NuartzConfig & {
|
|
42
|
+
site: {
|
|
43
|
+
baseUrl: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAA;IAElB,oBAAoB;IACpB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,uFAAuF;QACvF,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IAED,iCAAiC;IACjC,QAAQ,CAAC,EAAE,aAAa,CAAA;IAExB,iCAAiC;IACjC,QAAQ,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,IAAI,CAAC,EAAE,OAAO,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,GAAG,CAAC,EAAE,OAAO,CAAA;QACb,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAA;IAED;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IAE7B,iBAAiB;IACjB,GAAG,CAAC,EAAE;QACJ,gCAAgC;QAChC,KAAK,CAAC,EAAE,KAAK,CAAC;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC,CAAA;KACnE,CAAA;CACF;AAYD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAS/F"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineConfig = defineConfig;
|
|
4
|
+
const DEFAULT_FEATURES = {
|
|
5
|
+
wikilinks: true,
|
|
6
|
+
callouts: true,
|
|
7
|
+
tags: true,
|
|
8
|
+
backlinks: true,
|
|
9
|
+
toc: true,
|
|
10
|
+
search: true,
|
|
11
|
+
darkMode: true,
|
|
12
|
+
};
|
|
13
|
+
function defineConfig(config) {
|
|
14
|
+
return {
|
|
15
|
+
...config,
|
|
16
|
+
site: {
|
|
17
|
+
baseUrl: "http://localhost:3000",
|
|
18
|
+
...config.site,
|
|
19
|
+
},
|
|
20
|
+
features: { ...DEFAULT_FEATURES, ...config.features },
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AAqDA,oCASC;AAnBD,MAAM,gBAAgB,GAAuC;IAC3D,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,IAAI;IACf,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;CACf,CAAA;AAED,SAAgB,YAAY,CAAC,MAAoB;IAC/C,OAAO;QACL,GAAG,MAAM;QACT,IAAI,EAAE;YACJ,OAAO,EAAE,uBAAuB;YAChC,GAAG,MAAM,CAAC,IAAI;SACf;QACD,QAAQ,EAAE,EAAE,GAAG,gBAAgB,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE;KACtD,CAAA;AACH,CAAC"}
|
package/dist/fs.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Frontmatter } from "./types.js";
|
|
2
|
+
export interface MarkdownFile {
|
|
3
|
+
slug: string;
|
|
4
|
+
filePath: string;
|
|
5
|
+
frontmatter: Frontmatter;
|
|
6
|
+
raw: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Recursively walks a directory and returns all .md files.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getAllMarkdownFiles(contentDir: string): Promise<MarkdownFile[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Reads a single markdown file by slug.
|
|
14
|
+
* Returns null if the file doesn't exist.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getMarkdownBySlug(contentDir: string, slug: string): Promise<MarkdownFile | null>;
|
|
17
|
+
export interface FileTreeNode {
|
|
18
|
+
name: string;
|
|
19
|
+
path: string;
|
|
20
|
+
type: "file" | "folder";
|
|
21
|
+
children?: FileTreeNode[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Builds a nested file tree from a flat list of MarkdownFile entries.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildFileTree(files: MarkdownFile[]): FileTreeNode[];
|
|
27
|
+
//# sourceMappingURL=fs.d.ts.map
|
package/dist/fs.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,WAAW,CAAA;IACxB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC,CAoCzB;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAS9B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;IACvB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;CAC1B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CA+CnE"}
|
package/dist/fs.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getAllMarkdownFiles = getAllMarkdownFiles;
|
|
7
|
+
exports.getMarkdownBySlug = getMarkdownBySlug;
|
|
8
|
+
exports.buildFileTree = buildFileTree;
|
|
9
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
10
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
11
|
+
const gray_matter_1 = __importDefault(require("gray-matter"));
|
|
12
|
+
/**
|
|
13
|
+
* Recursively walks a directory and returns all .md files.
|
|
14
|
+
*/
|
|
15
|
+
async function getAllMarkdownFiles(contentDir) {
|
|
16
|
+
const results = [];
|
|
17
|
+
async function walk(dir) {
|
|
18
|
+
let entries;
|
|
19
|
+
try {
|
|
20
|
+
entries = await promises_1.default.readdir(dir, { withFileTypes: true });
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
const fullPath = node_path_1.default.join(dir, entry.name);
|
|
27
|
+
if (entry.isDirectory()) {
|
|
28
|
+
await walk(fullPath);
|
|
29
|
+
}
|
|
30
|
+
else if (entry.name.endsWith(".md") && !entry.name.startsWith("_")) {
|
|
31
|
+
const raw = await promises_1.default.readFile(fullPath, "utf-8");
|
|
32
|
+
const { data } = (0, gray_matter_1.default)(raw);
|
|
33
|
+
// Skip draft or unpublished files
|
|
34
|
+
if (data.draft === true || data.published === false)
|
|
35
|
+
continue;
|
|
36
|
+
const relative = node_path_1.default.relative(contentDir, fullPath);
|
|
37
|
+
const slug = relative.replace(/\.md$/, "").replace(/\\/g, "/");
|
|
38
|
+
results.push({
|
|
39
|
+
slug,
|
|
40
|
+
filePath: fullPath,
|
|
41
|
+
frontmatter: data,
|
|
42
|
+
raw,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
await walk(contentDir);
|
|
48
|
+
return results;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Reads a single markdown file by slug.
|
|
52
|
+
* Returns null if the file doesn't exist.
|
|
53
|
+
*/
|
|
54
|
+
async function getMarkdownBySlug(contentDir, slug) {
|
|
55
|
+
const filePath = node_path_1.default.join(contentDir, slug + ".md");
|
|
56
|
+
try {
|
|
57
|
+
const raw = await promises_1.default.readFile(filePath, "utf-8");
|
|
58
|
+
const { data } = (0, gray_matter_1.default)(raw);
|
|
59
|
+
return { slug, filePath, frontmatter: data, raw };
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Builds a nested file tree from a flat list of MarkdownFile entries.
|
|
67
|
+
*/
|
|
68
|
+
function buildFileTree(files) {
|
|
69
|
+
const root = [];
|
|
70
|
+
const nodeMap = new Map();
|
|
71
|
+
const sortedFiles = [...files].sort((a, b) => a.slug.localeCompare(b.slug));
|
|
72
|
+
for (const file of sortedFiles) {
|
|
73
|
+
const parts = file.slug.split("/");
|
|
74
|
+
let parentList = root;
|
|
75
|
+
for (let i = 0; i < parts.length; i++) {
|
|
76
|
+
const part = parts[i];
|
|
77
|
+
const partPath = parts.slice(0, i + 1).join("/");
|
|
78
|
+
const isLast = i === parts.length - 1;
|
|
79
|
+
if (isLast) {
|
|
80
|
+
const node = {
|
|
81
|
+
name: file.frontmatter.title ?? part,
|
|
82
|
+
path: file.slug,
|
|
83
|
+
type: "file",
|
|
84
|
+
};
|
|
85
|
+
parentList.push(node);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
let folderNode = nodeMap.get(partPath);
|
|
89
|
+
if (!folderNode) {
|
|
90
|
+
folderNode = { name: part, path: partPath, type: "folder", children: [] };
|
|
91
|
+
nodeMap.set(partPath, folderNode);
|
|
92
|
+
parentList.push(folderNode);
|
|
93
|
+
}
|
|
94
|
+
parentList = folderNode.children;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Sort each level: folders first, then files; alphabetically within each group
|
|
99
|
+
function sortNodes(nodes) {
|
|
100
|
+
nodes.sort((a, b) => {
|
|
101
|
+
if (a.type !== b.type)
|
|
102
|
+
return a.type === "folder" ? -1 : 1;
|
|
103
|
+
return a.name.localeCompare(b.name, undefined, { sensitivity: "base" });
|
|
104
|
+
});
|
|
105
|
+
for (const node of nodes) {
|
|
106
|
+
if (node.children)
|
|
107
|
+
sortNodes(node.children);
|
|
108
|
+
}
|
|
109
|
+
return nodes;
|
|
110
|
+
}
|
|
111
|
+
return sortNodes(root);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=fs.js.map
|
package/dist/fs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":";;;;;AAeA,kDAsCC;AAMD,8CAYC;AAYD,sCA+CC;AAlID,gEAAiC;AACjC,0DAA4B;AAC5B,8DAAgC;AAUhC;;GAEG;AACI,KAAK,UAAU,mBAAmB,CACvC,UAAkB;IAElB,MAAM,OAAO,GAAmB,EAAE,CAAA;IAElC,KAAK,UAAU,IAAI,CAAC,GAAW;QAC7B,IAAI,OAAmD,CAAA;QACvD,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,kBAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAA+C,CAAA;QACxG,CAAC;QAAC,MAAM,CAAC;YACP,OAAM;QAC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7C,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,CAAA;AACxB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { renderMarkdown } from "./markdown.js";
|
|
2
|
+
export { buildBacklinkIndex, getBacklinks } from "./backlinks.js";
|
|
3
|
+
export { getAllMarkdownFiles, getMarkdownBySlug, buildFileTree } from "./fs.js";
|
|
4
|
+
export { buildSearchIndex } from "./search.js";
|
|
5
|
+
export { defineConfig } from "./config.js";
|
|
6
|
+
export type { NuartzConfig } from "./config.js";
|
|
7
|
+
export type { SearchEntry } from "./search.js";
|
|
8
|
+
export type { MarkdownFile, FileTreeNode } from "./fs.js";
|
|
9
|
+
export type { BacklinkEntry, BacklinkIndex } from "./backlinks.js";
|
|
10
|
+
export { remarkCallout } from "./plugins/callout.js";
|
|
11
|
+
export { remarkTag } from "./plugins/tag.js";
|
|
12
|
+
export { remarkWikilink } from "./plugins/wikilink.js";
|
|
13
|
+
export { remarkHighlight } from "./plugins/highlight.js";
|
|
14
|
+
export { remarkObsidianComment } from "./plugins/comment.js";
|
|
15
|
+
export { remarkArrows } from "./plugins/arrows.js";
|
|
16
|
+
export type { Frontmatter, RenderResult, RenderOptions, TocEntry } from "./types.js";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACzD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.remarkArrows = exports.remarkObsidianComment = exports.remarkHighlight = exports.remarkWikilink = exports.remarkTag = exports.remarkCallout = exports.defineConfig = exports.buildSearchIndex = exports.buildFileTree = exports.getMarkdownBySlug = exports.getAllMarkdownFiles = exports.getBacklinks = exports.buildBacklinkIndex = exports.renderMarkdown = void 0;
|
|
4
|
+
var markdown_js_1 = require("./markdown.js");
|
|
5
|
+
Object.defineProperty(exports, "renderMarkdown", { enumerable: true, get: function () { return markdown_js_1.renderMarkdown; } });
|
|
6
|
+
var backlinks_js_1 = require("./backlinks.js");
|
|
7
|
+
Object.defineProperty(exports, "buildBacklinkIndex", { enumerable: true, get: function () { return backlinks_js_1.buildBacklinkIndex; } });
|
|
8
|
+
Object.defineProperty(exports, "getBacklinks", { enumerable: true, get: function () { return backlinks_js_1.getBacklinks; } });
|
|
9
|
+
var fs_js_1 = require("./fs.js");
|
|
10
|
+
Object.defineProperty(exports, "getAllMarkdownFiles", { enumerable: true, get: function () { return fs_js_1.getAllMarkdownFiles; } });
|
|
11
|
+
Object.defineProperty(exports, "getMarkdownBySlug", { enumerable: true, get: function () { return fs_js_1.getMarkdownBySlug; } });
|
|
12
|
+
Object.defineProperty(exports, "buildFileTree", { enumerable: true, get: function () { return fs_js_1.buildFileTree; } });
|
|
13
|
+
var search_js_1 = require("./search.js");
|
|
14
|
+
Object.defineProperty(exports, "buildSearchIndex", { enumerable: true, get: function () { return search_js_1.buildSearchIndex; } });
|
|
15
|
+
var config_js_1 = require("./config.js");
|
|
16
|
+
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return config_js_1.defineConfig; } });
|
|
17
|
+
var callout_js_1 = require("./plugins/callout.js");
|
|
18
|
+
Object.defineProperty(exports, "remarkCallout", { enumerable: true, get: function () { return callout_js_1.remarkCallout; } });
|
|
19
|
+
var tag_js_1 = require("./plugins/tag.js");
|
|
20
|
+
Object.defineProperty(exports, "remarkTag", { enumerable: true, get: function () { return tag_js_1.remarkTag; } });
|
|
21
|
+
var wikilink_js_1 = require("./plugins/wikilink.js");
|
|
22
|
+
Object.defineProperty(exports, "remarkWikilink", { enumerable: true, get: function () { return wikilink_js_1.remarkWikilink; } });
|
|
23
|
+
var highlight_js_1 = require("./plugins/highlight.js");
|
|
24
|
+
Object.defineProperty(exports, "remarkHighlight", { enumerable: true, get: function () { return highlight_js_1.remarkHighlight; } });
|
|
25
|
+
var comment_js_1 = require("./plugins/comment.js");
|
|
26
|
+
Object.defineProperty(exports, "remarkObsidianComment", { enumerable: true, get: function () { return comment_js_1.remarkObsidianComment; } });
|
|
27
|
+
var arrows_js_1 = require("./plugins/arrows.js");
|
|
28
|
+
Object.defineProperty(exports, "remarkArrows", { enumerable: true, get: function () { return arrows_js_1.remarkArrows; } });
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAArC,6GAAA,cAAc,OAAA;AACvB,+CAAiE;AAAxD,kHAAA,kBAAkB,OAAA;AAAE,4GAAA,YAAY,OAAA;AACzC,iCAA+E;AAAtE,4GAAA,mBAAmB,OAAA;AAAE,0GAAA,iBAAiB,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC9D,yCAA8C;AAArC,6GAAA,gBAAgB,OAAA;AACzB,yCAA0C;AAAjC,yGAAA,YAAY,OAAA;AAKrB,mDAAoD;AAA3C,2GAAA,aAAa,OAAA;AACtB,2CAA4C;AAAnC,mGAAA,SAAS,OAAA;AAClB,qDAAsD;AAA7C,6GAAA,cAAc,OAAA;AACvB,uDAAwD;AAA/C,+GAAA,eAAe,OAAA;AACxB,mDAA4D;AAAnD,mHAAA,qBAAqB,OAAA;AAC9B,iDAAkD;AAAzC,yGAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAe,YAAY,EAAE,aAAa,EAAY,MAAM,YAAY,CAAA;AAiDpF,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAqDvB"}
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.renderMarkdown = renderMarkdown;
|
|
7
|
+
const gray_matter_1 = __importDefault(require("gray-matter"));
|
|
8
|
+
const unified_1 = require("unified");
|
|
9
|
+
const remark_parse_1 = __importDefault(require("remark-parse"));
|
|
10
|
+
const remark_frontmatter_1 = __importDefault(require("remark-frontmatter"));
|
|
11
|
+
const remark_gfm_1 = __importDefault(require("remark-gfm"));
|
|
12
|
+
const remark_math_1 = __importDefault(require("remark-math"));
|
|
13
|
+
const remark_rehype_1 = __importDefault(require("remark-rehype"));
|
|
14
|
+
const rehype_raw_1 = __importDefault(require("rehype-raw"));
|
|
15
|
+
const rehype_slug_1 = __importDefault(require("rehype-slug"));
|
|
16
|
+
const rehype_autolink_headings_1 = __importDefault(require("rehype-autolink-headings"));
|
|
17
|
+
const rehype_katex_1 = __importDefault(require("rehype-katex"));
|
|
18
|
+
const rehype_stringify_1 = __importDefault(require("rehype-stringify"));
|
|
19
|
+
const unist_util_visit_1 = require("unist-util-visit");
|
|
20
|
+
const remark_breaks_1 = __importDefault(require("remark-breaks"));
|
|
21
|
+
const rehype_pretty_code_1 = require("rehype-pretty-code");
|
|
22
|
+
const callout_js_1 = require("./plugins/callout.js");
|
|
23
|
+
const tag_js_1 = require("./plugins/tag.js");
|
|
24
|
+
const wikilink_js_1 = require("./plugins/wikilink.js");
|
|
25
|
+
const highlight_js_1 = require("./plugins/highlight.js");
|
|
26
|
+
const comment_js_1 = require("./plugins/comment.js");
|
|
27
|
+
const arrows_js_1 = require("./plugins/arrows.js");
|
|
28
|
+
// Rehype plugin that extracts headings into vfile.data.toc
|
|
29
|
+
const rehypeExtractToc = () => {
|
|
30
|
+
return (tree, file) => {
|
|
31
|
+
const toc = [];
|
|
32
|
+
(0, unist_util_visit_1.visit)(tree, "element", (node) => {
|
|
33
|
+
const match = node.tagName.match(/^h([1-6])$/);
|
|
34
|
+
if (!match)
|
|
35
|
+
return;
|
|
36
|
+
const depth = parseInt(match[1]);
|
|
37
|
+
const id = node.properties?.id ?? "";
|
|
38
|
+
const text = extractText(node);
|
|
39
|
+
toc.push({ depth, text, id, children: [] });
|
|
40
|
+
});
|
|
41
|
+
file.data.toc = buildTocTree(toc);
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
function extractText(node) {
|
|
45
|
+
let text = "";
|
|
46
|
+
(0, unist_util_visit_1.visit)(node, "text", (n) => {
|
|
47
|
+
text += n.value;
|
|
48
|
+
});
|
|
49
|
+
return text;
|
|
50
|
+
}
|
|
51
|
+
function buildTocTree(flat) {
|
|
52
|
+
const root = [];
|
|
53
|
+
const stack = [];
|
|
54
|
+
for (const entry of flat) {
|
|
55
|
+
while (stack.length > 0 && stack[stack.length - 1].depth >= entry.depth) {
|
|
56
|
+
stack.pop();
|
|
57
|
+
}
|
|
58
|
+
if (stack.length === 0) {
|
|
59
|
+
root.push(entry);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
stack[stack.length - 1].children.push(entry);
|
|
63
|
+
}
|
|
64
|
+
stack.push(entry);
|
|
65
|
+
}
|
|
66
|
+
return root;
|
|
67
|
+
}
|
|
68
|
+
async function renderMarkdown(content, options = {}) {
|
|
69
|
+
const { baseUrl = "/", resolveLink = (t) => t, knownSlugs } = options;
|
|
70
|
+
// Parse frontmatter with gray-matter
|
|
71
|
+
const { data: frontmatter, content: body } = (0, gray_matter_1.default)(content);
|
|
72
|
+
const file = await (0, unified_1.unified)()
|
|
73
|
+
.use(remark_parse_1.default)
|
|
74
|
+
.use(remark_frontmatter_1.default, ["yaml", "toml"])
|
|
75
|
+
.use(comment_js_1.remarkObsidianComment)
|
|
76
|
+
.use(remark_gfm_1.default)
|
|
77
|
+
.use(remark_math_1.default)
|
|
78
|
+
.use(remark_breaks_1.default)
|
|
79
|
+
.use(wikilink_js_1.remarkWikilink, { baseUrl, resolve: resolveLink, knownSlugs })
|
|
80
|
+
.use(callout_js_1.remarkCallout)
|
|
81
|
+
.use(tag_js_1.remarkTag)
|
|
82
|
+
.use(highlight_js_1.remarkHighlight)
|
|
83
|
+
.use(arrows_js_1.remarkArrows)
|
|
84
|
+
.use(remark_rehype_1.default, { allowDangerousHtml: true })
|
|
85
|
+
.use(rehype_raw_1.default)
|
|
86
|
+
.use(rehype_pretty_code_1.rehypePrettyCode, {
|
|
87
|
+
theme: { light: "github-light", dark: "github-dark" },
|
|
88
|
+
keepBackground: false,
|
|
89
|
+
})
|
|
90
|
+
.use(rehype_slug_1.default)
|
|
91
|
+
.use(rehype_autolink_headings_1.default, {
|
|
92
|
+
behavior: "append",
|
|
93
|
+
properties: { className: "heading-anchor", ariaLabel: "Copy link to section" },
|
|
94
|
+
content: {
|
|
95
|
+
type: "element", tagName: "svg",
|
|
96
|
+
properties: { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none",
|
|
97
|
+
stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" },
|
|
98
|
+
children: [
|
|
99
|
+
{ type: "element", tagName: "path", properties: { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" }, children: [] },
|
|
100
|
+
{ type: "element", tagName: "path", properties: { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" }, children: [] },
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
})
|
|
104
|
+
.use(rehype_katex_1.default)
|
|
105
|
+
.use(rehypeExtractToc)
|
|
106
|
+
.use(rehype_stringify_1.default)
|
|
107
|
+
.process(body);
|
|
108
|
+
return {
|
|
109
|
+
html: String(file),
|
|
110
|
+
frontmatter: frontmatter,
|
|
111
|
+
toc: file.data.toc ?? [],
|
|
112
|
+
links: file.data.links ?? [],
|
|
113
|
+
tags: [
|
|
114
|
+
...(frontmatter.tags ?? []),
|
|
115
|
+
...(file.data.tags ?? []),
|
|
116
|
+
].filter((t, i, a) => a.indexOf(t) === i),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../src/markdown.ts"],"names":[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AAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,8DAA8D,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;aACtI;SACgB;KACpB,CAAC;SACD,GAAG,CAAC,sBAAW,CAAC;SAChB,GAAG,CAAC,gBAAgB,CAAC;SACrB,GAAG,CAAC,0BAAe,CAAC;SACpB,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhB,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;QAClB,WAAW,EAAE,WAA0B;QACvC,GAAG,EAAG,IAAI,CAAC,IAAI,CAAC,GAAkB,IAAI,EAAE;QACxC,KAAK,EAAG,IAAI,CAAC,IAAI,CAAC,KAAkB,IAAI,EAAE;QAC1C,IAAI,EAAE;YACJ,GAAG,CAAE,WAAW,CAAC,IAAiB,IAAI,EAAE,CAAC;YACzC,GAAG,CAAE,IAAI,CAAC,IAAI,CAAC,IAAiB,IAAI,EAAE,CAAC;SACxC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;KAC1C,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrows.d.ts","sourceRoot":"","sources":["../../src/plugins/arrows.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,OAAO,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CASzC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.remarkArrows = void 0;
|
|
4
|
+
const unist_util_visit_1 = require("unist-util-visit");
|
|
5
|
+
const remarkArrows = () => {
|
|
6
|
+
return (tree) => {
|
|
7
|
+
(0, unist_util_visit_1.visit)(tree, "text", (node) => {
|
|
8
|
+
node.value = node.value
|
|
9
|
+
.replace(/<-->/g, "↔")
|
|
10
|
+
.replace(/-->/g, "→")
|
|
11
|
+
.replace(/<--/g, "←");
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.remarkArrows = remarkArrows;
|
|
16
|
+
//# sourceMappingURL=arrows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrows.js","sourceRoot":"","sources":["../../src/plugins/arrows.ts"],"names":[],"mappings":";;;AAAA,uDAAwC;AAIjC,MAAM,YAAY,GAAqB,GAAG,EAAE;IACjD,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,IAAA,wBAAK,EAAC,IAAI,EAAE,MAAM,EAAE,CAAC,IAAU,EAAE,EAAE;YACjC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK;iBACpB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;iBACrB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;iBACpB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QACzB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC,CAAA;AATY,QAAA,YAAY,gBASxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../src/plugins/callout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA+B,MAAM,OAAO,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAiBrC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CA0D1C,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.remarkCallout = void 0;
|
|
4
|
+
const unist_util_visit_1 = require("unist-util-visit");
|
|
5
|
+
// All supported callout types (Obsidian-compatible)
|
|
6
|
+
const CALLOUT_TYPES = new Set([
|
|
7
|
+
"note", "abstract", "summary", "tldr",
|
|
8
|
+
"info", "todo", "tip", "hint", "important",
|
|
9
|
+
"success", "check", "done",
|
|
10
|
+
"question", "help", "faq",
|
|
11
|
+
"warning", "caution", "attention",
|
|
12
|
+
"failure", "fail", "missing",
|
|
13
|
+
"danger", "error", "bug",
|
|
14
|
+
"example", "quote", "cite",
|
|
15
|
+
]);
|
|
16
|
+
// [!type] or [!type]+ or [!type]- optionally followed by title
|
|
17
|
+
const CALLOUT_REGEX = /^\[!(\w+)\]([+-]?)([ \t].*)?$/i;
|
|
18
|
+
const remarkCallout = () => {
|
|
19
|
+
return (tree) => {
|
|
20
|
+
(0, unist_util_visit_1.visit)(tree, "blockquote", (node) => {
|
|
21
|
+
const firstChild = node.children[0];
|
|
22
|
+
if (firstChild?.type !== "paragraph")
|
|
23
|
+
return;
|
|
24
|
+
const firstInline = firstChild.children[0];
|
|
25
|
+
if (firstInline?.type !== "text")
|
|
26
|
+
return;
|
|
27
|
+
const firstLine = firstInline.value.split("\n")[0];
|
|
28
|
+
const match = firstLine.match(CALLOUT_REGEX);
|
|
29
|
+
if (!match)
|
|
30
|
+
return;
|
|
31
|
+
const [, rawType, fold, titleText] = match;
|
|
32
|
+
const type = rawType.toLowerCase();
|
|
33
|
+
if (!CALLOUT_TYPES.has(type))
|
|
34
|
+
return;
|
|
35
|
+
// Trim [!type] line from the paragraph
|
|
36
|
+
const remainder = firstInline.value.slice(firstLine.length).trimStart();
|
|
37
|
+
if (remainder) {
|
|
38
|
+
firstInline.value = remainder;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
firstChild.children.shift();
|
|
42
|
+
// remarkBreaks runs before this plugin and converts the line break after
|
|
43
|
+
// [!type] into a break node — remove any leading break nodes
|
|
44
|
+
while (firstChild.children.length > 0 && firstChild.children[0].type === "break") {
|
|
45
|
+
firstChild.children.shift();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// If the first paragraph is now empty, remove it entirely
|
|
49
|
+
if (firstChild.children.length === 0) {
|
|
50
|
+
node.children.shift();
|
|
51
|
+
}
|
|
52
|
+
const title = titleText?.trim() ?? type.charAt(0).toUpperCase() + type.slice(1);
|
|
53
|
+
const titleParagraph = {
|
|
54
|
+
type: "paragraph",
|
|
55
|
+
data: {
|
|
56
|
+
hName: "div",
|
|
57
|
+
hProperties: { className: "callout-title" },
|
|
58
|
+
},
|
|
59
|
+
children: [{ type: "text", value: title }],
|
|
60
|
+
};
|
|
61
|
+
node.children.unshift(titleParagraph);
|
|
62
|
+
node.data = {
|
|
63
|
+
...node.data,
|
|
64
|
+
hName: "div",
|
|
65
|
+
hProperties: {
|
|
66
|
+
className: `callout callout-${type}`,
|
|
67
|
+
"data-callout": type,
|
|
68
|
+
"data-callout-fold": fold || null,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
exports.remarkCallout = remarkCallout;
|
|
75
|
+
//# sourceMappingURL=callout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.js","sourceRoot":"","sources":["../../src/plugins/callout.ts"],"names":[],"mappings":";;;AAAA,uDAAwC;AAIxC,oDAAoD;AACpD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM;IACrC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW;IAC1C,SAAS,EAAE,OAAO,EAAE,MAAM;IAC1B,UAAU,EAAE,MAAM,EAAE,KAAK;IACzB,SAAS,EAAE,SAAS,EAAE,WAAW;IACjC,SAAS,EAAE,MAAM,EAAE,SAAS;IAC5B,QAAQ,EAAE,OAAO,EAAE,KAAK;IACxB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