CLI tool to sync your Markdown to Leaflet
leafletpub
atproto
cli
markdown
1import type { ResourceUri } from "@atcute/lexicons";
2
3export interface ReplacementCtx {
4 file: string;
5}
6export type Replacement = [[string, string]] | ((key: string, ctx: ReplacementCtx) => string | undefined);
7
8export interface Config {
9 glob: { pattern: string; base?: string };
10 frontmatter?: {
11 type: "yaml";
12 titleKey: string;
13 descriptionKey?: string;
14 uploadDateKey?: string;
15 };
16 publicationUri?: ResourceUri;
17 prependDoc?: { path: string; replacement?: Replacement };
18 appendDoc?: { path: string; replacement?: Replacement };
19 /**
20 * All available themes can be found at {@link https://shiki.matsu.io/themes} under the ID column
21 */
22 codeblockTheme?: string;
23}
24
25export function defineConfig(config: Config) {
26 if (config.publicationUri) {
27 if (!config.publicationUri.includes("/site.standard.publication/"))
28 throw new Error("Invalid publicationUri inside of the config.");
29 }
30
31 return config;
32}