import {
emptyDir,
ensureDir,
-} from "https://deno.land/std@0.195.0/fs/mod.ts";
+} from "https://deno.land/std@0.196.0/fs/mod.ts";
+import {
+ JSON_SCHEMA,
+ parse as parseYaml,
+} from "https://deno.land/std@0.196.0/yaml/mod.ts";
import djot from "npm:@djot/djot@0.2.3";
import { Parser } from "npm:htmlparser2@9.0.0";
import { DomHandler, Element, Text } from "npm:domhandler@5.0.3";
#internalLinks = new Set();
#externalLinks = new Map();
- constructor(namespace, name, ast, source) {
+ constructor(namespace, name, ast, source, config) {
const internalLinks = this.#internalLinks;
const externalLinks = this.#externalLinks;
const sections = Object.create(null);
String.fromCodePoint(parseInt(codepoint, 16))
}`;
} else {
- return {
- "--8": str`${"—\u2060:\u202F"}`, // reverse puppyprick
- "8--": str`${"\u202F:\u2060—"}`, // forward puppyprick
- sp: rawInline` `, // space
- nbsp: str`${"\xA0"}`, // no‐break space
- cgj: str`${"\u034F"}`, // combining grapheme joiner
- ensp: str`${"\u2002"}`, // enspace
- emsp: str`${"\u2003"}`, // emspace
- figsp: str`${"\u2007"}`, // figure space
- zwsp: str`${"\u200B"}`, // zero‐width space
- zwnj: str`${"\u200C"}`, // zero‐width nonjoiner
- zwj: str`${"\u200D"}`, // zero‐width joiner
- nnbsp: str`${"\u202F"}`, // narrow no‐break space
- mathsp: str`${"\u205F"}`, // math space
- wj: str`${"\u2060"}`, // word joiner
- fwsp: str`${"\u3000"}`, // fullwidth space
- }[alias] ?? e;
+ const resolved = config.symbols?.[alias];
+ return resolved != null ? str`${resolved}` : e;
}
},
},
}
{
+ const config = await getRemoteContent("config.yaml").then((yaml) =>
+ parseYaml(yaml, { schema: JSON_SCHEMA })
+ );
const ls = new Deno.Command("git", {
args: ["ls-tree", "-rz", "live"],
stdout: "piped",
console.warn(`Djot(${reference}): ${$.render()}`),
}),
source,
+ config,
);
const reference = `${namespace}:${pageName}`;
pages.set(reference, page);
console.warn(`Djot(${reference}): ${$.render()}`),
}),
source,
+ config,
);
pages.set(reference, page);
}
--- /dev/null
+# Modify this file to configure your GitWikiWeb instance.
+symbols:
+ nbsp: "\xA0" # no‐break space
+ cgj: "\u034F" # combining grapheme joiner
+ ensp: "\u2002" # enspace
+ emsp: "\u2003" # emspace
+ figsp: "\u2007" # figure space
+ zwsp: "\u200B" # zero‐width space
+ zwnj: "\u200C" # zero‐width nonjoiner
+ zwj: "\u200D" # zero‐width joiner
+ nnbsp: "\u202F" # narrow no‐break space
+ mathsp: "\u205F" # math space
+ wj: "\u2060" # word joiner
+ fwsp: "\u3000" # fullwidth space
+ as_text: "\uFE0E" # text variation
+ as_emoji: "\uFE0F" # emoji variation