@gitpagedocs/cli 0.0.12 → 0.0.14
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/README.md +3 -1
- package/builders/config-orchestrator.mjs +2 -1
- package/builders/route-builders.mjs +7 -5
- package/builders/version-config-builder.mjs +8 -6
- package/content/assets/pagination-high.wav +0 -0
- package/content/assets/pagination-low.wav +0 -0
- package/content/assets/pagination-reference.pdf +80 -0
- package/content/container-pagination.mjs +155 -0
- package/content/docs-en.mjs +39 -8
- package/content/docs-es.mjs +39 -8
- package/content/docs-pt.mjs +39 -8
- package/content/markdown-markers.mjs +153 -0
- package/content/overviews-en.mjs +2 -0
- package/content/overviews-es.mjs +2 -0
- package/content/overviews-pt.mjs +2 -0
- package/content/pagination-html.mjs +39 -0
- package/content/practical-en.mjs +3 -3
- package/content/practical-es.mjs +3 -3
- package/content/practical-pt.mjs +3 -3
- package/contracts/doc-versions.mjs +2 -2
- package/data/default-site-config.mjs +30 -0
- package/data/i18n-langmenu.mjs +3 -0
- package/data/menu-sections.mjs +2 -1
- package/data/paginated-pages.mjs +77 -0
- package/data/path-mappings.mjs +2 -0
- package/data/route-metas.mjs +8 -0
- package/package.json +3 -3
- package/runtime/doc-path-resolver.mjs +5 -0
- package/runtime/output.mjs +13 -10
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
import { PACKAGE_VERSION } from "../contracts/doc-versions.mjs";
|
|
4
4
|
|
|
5
5
|
const DOC_FILE_KEYS = new Map([
|
|
6
|
+
["container-pagination.md", "containerPagination"],
|
|
7
|
+
["pagination-first.md", "paginationFirst"],
|
|
8
|
+
["markdown-markers.md", "markdownMarkers"],
|
|
6
9
|
["content-blocks.md", "contentBlocks"],
|
|
7
10
|
["index.md", "index"],
|
|
8
11
|
["getting-started.md", "gettingStarted"],
|
|
@@ -45,6 +48,8 @@ export function parseHtmlFileToKey(fileName) {
|
|
|
45
48
|
const base = fileName.replace(/\.html$/, "");
|
|
46
49
|
if (base === "source-viewer") return "sourceViewer";
|
|
47
50
|
if (base === "doom") return "doom";
|
|
51
|
+
if (base === "pagination-first") return "paginationFirst";
|
|
52
|
+
if (base === "pagination-second") return "paginationSecond";
|
|
48
53
|
return undefined;
|
|
49
54
|
}
|
|
50
55
|
|
package/runtime/output.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import { layoutsArtifactPaths } from "../contracts/layouts-paths.mjs";
|
|
|
12
12
|
import { languageArtifactPaths } from "../contracts/langs-paths.mjs";
|
|
13
13
|
import { SUPPORTED_LANGUAGES } from "../contracts/languages.mjs";
|
|
14
14
|
import { PDF_GUIDE_FILENAME } from "../data/path-mappings.mjs";
|
|
15
|
+
import { PAGINATION_ASSETS } from "../data/paginated-pages.mjs";
|
|
15
16
|
import { compactSiteIcons, factorRouteDefaults } from "@gitpagedocs/tools/config-format";
|
|
16
17
|
|
|
17
18
|
const DEFAULT_ICON_SVG = `<?xml version="1.0" encoding="utf-8"?>
|
|
@@ -161,18 +162,20 @@ export async function writeConfigOnlyOutput(options) {
|
|
|
161
162
|
|
|
162
163
|
|
|
163
164
|
await writeVersionedDocs(root, outputDir, artifacts);
|
|
164
|
-
await
|
|
165
|
+
await writeBundledMediaArtifacts(options);
|
|
165
166
|
}
|
|
166
167
|
|
|
167
|
-
async function
|
|
168
|
-
const source = path.join(pkgRoot, "content", "assets", PDF_GUIDE_FILENAME);
|
|
168
|
+
async function writeBundledMediaArtifacts({ root, pkgRoot, outputDir, artifacts }) {
|
|
169
169
|
for (const [versionId, versionConfig] of Object.entries(artifacts.versionConfigs)) {
|
|
170
|
-
const
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
const routes = [...(versionConfig["routes-pdf"] ?? []), ...(versionConfig["routes-audio"] ?? [])];
|
|
171
|
+
const mediaPaths = new Set(routes.flatMap(route => Object.values(route.pdf?.pathPdf ?? route.audio?.pathAudio ?? {})));
|
|
172
|
+
for (const fileName of [PDF_GUIDE_FILENAME, ...PAGINATION_ASSETS]) {
|
|
173
|
+
const bundledPath = `gitpagedocs/docs/versions/${versionId}/en/${fileName}`;
|
|
174
|
+
if (!mediaPaths.has(bundledPath)) continue;
|
|
175
|
+
const source = path.join(pkgRoot, "content", "assets", fileName);
|
|
176
|
+
const destination = path.join(root, normalizeToOutputPath(outputDir, bundledPath));
|
|
177
|
+
await mkdir(path.dirname(destination), { recursive: true });
|
|
178
|
+
await copyFile(source, destination);
|
|
179
|
+
}
|
|
177
180
|
}
|
|
178
181
|
}
|