@heroiclands/package-build 22.2.0 → 22.3.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/CHANGELOG.md +20 -0
- package/CONTENT.md +27 -32
- package/bin/content-build.mjs +25 -6
- package/content-config.mjs +54 -41
- package/docs/api.md +25 -25
- package/docs/commands.md +23 -0
- package/docs/configuration.md +31 -35
- package/docs/content-format.md +36 -6
- package/engine/field-reference.mjs +135 -0
- package/engine/foundry-entries.mjs +12 -1
- package/engine/frontmatter-lint.mjs +2 -3
- package/engine/helpers.mjs +4 -1
- package/engine/ids.mjs +12 -0
- package/engine/note-claims.mjs +21 -0
- package/engine/pack-router.mjs +82 -5
- package/engine/pdf-build.mjs +2 -2
- package/engine/retired-fields.mjs +2 -3
- package/engine/site-build.mjs +59 -218
- package/engine/site-index.mjs +18 -62
- package/engine/web-wikilinks.mjs +2 -16
- package/engine/wikilinks.mjs +35 -14
- package/package.json +1 -1
- package/sohl/kb-passes.mjs +14 -85
- package/types/content-config.d.mts +14 -6
- package/types/engine/field-reference.d.mts +78 -0
- package/types/engine/ids.d.mts +11 -0
- package/types/engine/pack-router.d.mts +20 -2
- package/types/engine/site-build.d.mts +12 -62
- package/types/engine/site-index.d.mts +3 -28
- package/types/engine/web-wikilinks.d.mts +1 -1
- package/types/engine/wikilinks.d.mts +6 -3
- package/types/sohl/kb-passes.d.mts +5 -36
|
@@ -17,59 +17,28 @@
|
|
|
17
17
|
* @returns {string} The body with every tag resolved.
|
|
18
18
|
*/
|
|
19
19
|
export function resolveApiLinks(body: string, symbols: Record<string, string>, apiBase: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Rewrites the relative links in a developer-doc body so they resolve on the
|
|
22
|
-
* published site.
|
|
23
|
-
*
|
|
24
|
-
* Developer docs are authored to link one another and the source tree with
|
|
25
|
-
* repository-relative paths, and neither target exists at the same path once
|
|
26
|
-
* rendered. Each link is resolved against the doc's own location:
|
|
27
|
-
*
|
|
28
|
-
* - a `*.md` link landing inside the documentation tree becomes the published
|
|
29
|
-
* route, preserving any `#anchor`; a `README` is its directory's landing, so
|
|
30
|
-
* that segment is dropped.
|
|
31
|
-
* - anything else — source, templates, a repository-root `*.md` — becomes its
|
|
32
|
-
* GitHub blob URL.
|
|
33
|
-
*
|
|
34
|
-
* Absolute URLs, anchor-only links, `mailto:` and site-root links are untouched.
|
|
35
|
-
*
|
|
36
|
-
* @param {string} body - The markdown body.
|
|
37
|
-
* @param {string} docRel - The doc's path relative to the documentation tree.
|
|
38
|
-
* @param {object} options - `{ repoRoot, docsSrc, docsRel, route, blob }`.
|
|
39
|
-
* @returns {string} The body with every relative link rewritten.
|
|
40
|
-
*/
|
|
41
|
-
export function rewriteRepoLinks(body: string, docRel: string, options: object): string;
|
|
42
20
|
/**
|
|
43
21
|
* The `sohl` knowledgebase pass bundle, built from its options.
|
|
44
22
|
*
|
|
45
|
-
* A pass bundle is
|
|
46
|
-
* resolution,
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* `{@link}` tag may sit inside prose a wikilink also touches.
|
|
50
|
-
* - `afterLinks` runs only on pages from an **extra tree** — the documentation
|
|
51
|
-
* tree — because repository-relative links are a property of how those pages
|
|
52
|
-
* are authored, not of content notes.
|
|
53
|
-
*
|
|
54
|
-
* Both run inside code-fence protection, so neither can rewrite a fenced example.
|
|
23
|
+
* A pass bundle is the hook the page renderer calls before wikilink
|
|
24
|
+
* resolution: `beforeLinks` runs on every page, before wikilinks resolve,
|
|
25
|
+
* because a `{@link}` tag may sit inside prose a wikilink also touches. It
|
|
26
|
+
* runs inside code-fence protection, so it cannot rewrite a fenced example.
|
|
55
27
|
*
|
|
56
28
|
* @param {object} options - Resolved from `site.passOptions`.
|
|
57
29
|
* @param {string} [options.symbolMap] - Path to the TypeDoc symbol map,
|
|
58
30
|
* relative to `repoRoot`. Absent means no API links; present and unusable is
|
|
59
31
|
* a build failure.
|
|
60
32
|
* @param {string} [options.apiBase] - Where the API documentation is served.
|
|
61
|
-
* @param {string} [options.blob] - GitHub blob base for repository files.
|
|
62
33
|
* @param {string} options.repoRoot - The repository root, for relative paths.
|
|
63
|
-
* @returns {{beforeLinks: Function
|
|
34
|
+
* @returns {{beforeLinks: Function}} The bundle.
|
|
64
35
|
* @throws {Error} When a configured `symbolMap` cannot be resolved, read,
|
|
65
36
|
* parsed, or is not a name → page object.
|
|
66
37
|
*/
|
|
67
38
|
export function sohlKbPass(options: {
|
|
68
39
|
symbolMap?: string | undefined;
|
|
69
40
|
apiBase?: string | undefined;
|
|
70
|
-
blob?: string | undefined;
|
|
71
41
|
repoRoot: string;
|
|
72
42
|
}): {
|
|
73
43
|
beforeLinks: Function;
|
|
74
|
-
afterLinks: Function;
|
|
75
44
|
};
|