@gitpagedocs/cli 0.0.9 → 0.0.11
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/builders/config-orchestrator.mjs +2 -1
- package/builders/version-config-builder.mjs +59 -8
- package/content/assets/gitpagedocs-project-guide.pdf +34 -34
- package/content/configuration-examples.mjs +76 -0
- package/content/content-blocks.mjs +142 -0
- package/content/docs-en.mjs +73 -23
- package/content/docs-es.mjs +191 -140
- package/content/docs-pt.mjs +213 -162
- package/content/html-doom.mjs +114 -0
- package/content/operations-en.mjs +70 -0
- package/content/operations-es.mjs +70 -0
- package/content/operations-pt.mjs +70 -0
- package/content/overviews-en.mjs +115 -0
- package/content/overviews-es.mjs +115 -0
- package/content/overviews-pt.mjs +115 -0
- package/content/practical-en.mjs +118 -0
- package/content/practical-es.mjs +118 -0
- package/content/practical-pt.mjs +118 -0
- package/contracts/doc-versions.mjs +2 -2
- package/data/composed-pages.mjs +25 -0
- package/data/default-site-config.mjs +150 -130
- package/data/i18n-langmenu.mjs +43 -28
- package/data/i18n-translations.mjs +7 -7
- package/data/menu-sections.mjs +56 -0
- package/data/path-mappings.mjs +16 -1
- package/data/route-metas.mjs +72 -6
- package/package.json +3 -3
- package/runtime/doc-path-resolver.mjs +23 -2
package/content/docs-en.mjs
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { PACKAGE_VERSION } from "../contracts/doc-versions.mjs";
|
|
2
|
+
import { practicalEn } from "./practical-en.mjs";
|
|
3
|
+
import { operationsEn } from "./operations-en.mjs";
|
|
4
|
+
import { overviewsEn } from "./overviews-en.mjs";
|
|
5
|
+
import { CONTENT_BLOCKS_DOCS } from "./content-blocks.mjs";
|
|
6
|
+
import { PARENT_MENU_JSON } from "./configuration-examples.mjs";
|
|
2
7
|
|
|
3
8
|
export const docsEn = {
|
|
9
|
+
...practicalEn,
|
|
10
|
+
...operationsEn,
|
|
11
|
+
...overviewsEn,
|
|
12
|
+
contentBlocks: CONTENT_BLOCKS_DOCS.en,
|
|
4
13
|
pdf: `# PDF documents
|
|
5
14
|
|
|
6
15
|
PDF is a first-class content type alongside Markdown, HTML, source code, video and audio. The viewer uses the browser's native PDF preview. Download and open-in-new-tab actions remain independently configurable.
|
|
@@ -26,13 +35,15 @@ Add this block inside \`site\` in \`gitpagedocs/config.json\`:
|
|
|
26
35
|
}
|
|
27
36
|
\`\`\`
|
|
28
37
|
|
|
29
|
-
\`enabled\` is the master switch for PDF content. The other fields control the preview, download button and new-tab
|
|
38
|
+
\`enabled\` is the master switch for PDF content. The other fields control the preview, download button and new-tab button. Every field defaults to \`true\` when omitted, including older configurations.
|
|
30
39
|
|
|
31
40
|
Action precedence is \`route.pdf.<flag>\` > \`site.pdf.<flag>\` > \`true\`. An explicit route \`true\` enables that action even when its site default is \`false\`; \`site.pdf.enabled: false\` still disables PDF content everywhere. A missing path for the selected language makes the PDF unavailable; there is no automatic language fallback.
|
|
32
41
|
|
|
42
|
+
PDF actions use icons by default. Configure \`site.icons.PdfDownload\` (\`LuDownload\`) and \`site.icons.PdfOpenInNewTab\` (\`LuExternalLink\`) independently with \`reactIcon\`, \`tag\`, \`size\`, \`colorDark\` and \`colorLight\`. For example, \`"PdfDownload": { "reactIcon": false }\` shows download text while the new-tab action remains an icon. Changing appearance does not change the action flags above.
|
|
43
|
+
|
|
33
44
|
## Route and menu example
|
|
34
45
|
|
|
35
|
-
In \`gitpagedocs/docs/versions/0.0.
|
|
46
|
+
In \`gitpagedocs/docs/versions/0.0.11/config.json\`, keep route and menu arrays at the top level:
|
|
36
47
|
|
|
37
48
|
\`\`\`json
|
|
38
49
|
{
|
|
@@ -41,9 +52,9 @@ In \`gitpagedocs/docs/versions/0.0.9/config.json\`, keep route and menu arrays a
|
|
|
41
52
|
"title": { "en": "Project guide (English)", "pt": "Guia do projeto (inglês)", "es": "Guía del proyecto (inglés)" },
|
|
42
53
|
"pdf": {
|
|
43
54
|
"pathPdf": {
|
|
44
|
-
"en": "gitpagedocs/docs/versions/0.0.
|
|
45
|
-
"pt": "gitpagedocs/docs/versions/0.0.
|
|
46
|
-
"es": "gitpagedocs/docs/versions/0.0.
|
|
55
|
+
"en": "gitpagedocs/docs/versions/0.0.11/en/gitpagedocs-project-guide.pdf",
|
|
56
|
+
"pt": "gitpagedocs/docs/versions/0.0.11/en/gitpagedocs-project-guide.pdf",
|
|
57
|
+
"es": "gitpagedocs/docs/versions/0.0.11/en/gitpagedocs-project-guide.pdf"
|
|
47
58
|
},
|
|
48
59
|
"previewEnabled": true,
|
|
49
60
|
"downloadEnabled": true,
|
|
@@ -67,9 +78,9 @@ The optional route flags live inside \`pdf\`. Shared presentation, \`container\`
|
|
|
67
78
|
|
|
68
79
|
Repository-root paths beginning with \`gitpagedocs/\` are copied into the viewer's public assets when Next.js starts or builds. The URL respects the configured deployment subpath on GitHub Pages. Keep the PDF tracked in Git and publish it with the generated documentation. Assets outside \`gitpagedocs/\` must already be in the viewer's \`frontend/public/\` directory or be reachable through an HTTP(S) URL.
|
|
69
80
|
|
|
70
|
-
Use the binary PDF URL, not an HTML repository preview URL. For remote repositories, the configured path resolves against that repository.
|
|
81
|
+
Use the binary PDF URL, not an HTML repository preview URL. For remote repositories, the configured path resolves against that repository. Preview, download and opening a new tab fetch the file bytes, so an external server must allow CORS for all three actions. The viewer validates the PDF signature and creates a temporary \`application/pdf\` Blob URL. Preview and new-tab viewing use the browser's native PDF viewer; the origin server's framing policy and MIME/disposition headers do not control the Blob view.
|
|
71
82
|
|
|
72
|
-
The new-tab
|
|
83
|
+
The new-tab button opens the validated PDF Blob instead of navigating to the raw repository URL. This also works when preview is disabled: loading starts when the reader downloads or opens the document. Previously loaded bytes are reused for the current PDF. Network/CORS failures, invalid PDFs and blocked new tabs produce a visible error; there is no automatic fallback to the raw URL. Native PDF support and the browser's own download preferences still determine how the new tab displays the file.
|
|
73
84
|
|
|
74
85
|
## Reading and troubleshooting
|
|
75
86
|
|
|
@@ -77,7 +88,7 @@ The new-tab link opens the original URL directly. Its behavior depends on the br
|
|
|
77
88
|
- Preview does not convert the PDF to Markdown. Markdown focus mode, section navigation, copy-as-Markdown and narration operate on Markdown documents, not the embedded PDF.
|
|
78
89
|
- Disabling preview can keep the download and new-tab actions available. Turning off every PDF action leaves no interactive PDF control.
|
|
79
90
|
- A disabled button is not access control. Publicly hosted PDFs remain downloadable by URL. Use protected hosting for confidential documents.
|
|
80
|
-
- If a preview is blank,
|
|
91
|
+
- If a preview is blank, verify that the path returns a PDF and that CORS permits access, then try the new-tab action. Allow pop-ups for the site if the browser blocks that action. Download and new-tab failures are reported on the page.
|
|
81
92
|
`,
|
|
82
93
|
index: `# Git Page Docs
|
|
83
94
|
|
|
@@ -117,9 +128,17 @@ The runtime expects this structure:
|
|
|
117
128
|
- **CLI reference**: installation, every command and compatibility flags.
|
|
118
129
|
- **MCP server**: client setup, all 20 tools, 7 resources and provider configuration.
|
|
119
130
|
- **Navigation and nested menus**: recursive trees, URLs and breadcrumb overrides.
|
|
131
|
+
- **Ordered content blocks**: repeat and reorder Markdown, HTML, video, audio and PDF in one page; independently position configured titles and descriptions.
|
|
120
132
|
- **Focus mode**: copy/download Markdown and section/document navigation.
|
|
121
133
|
- **Accessibility and narration**: browser voices, controls and media interaction.
|
|
122
134
|
- **PDF documents**: native previews, download/new-tab controls and the included English guide.
|
|
135
|
+
- **Configuration recipes**: a complete multilingual site and a menu with sections inside sections.
|
|
136
|
+
- **Migration and compatibility**: upgrade configurations from 0.0.1 onward while preserving your content.
|
|
137
|
+
- **Troubleshooting**: UTF-8, local and Pages paths, PDF loading, browser voices and MCP startup.
|
|
138
|
+
- **Contributing and validation**: source files, generation, public contracts and release checks.
|
|
139
|
+
- **HTML containers**: local and external pages, route/menu configuration and the interactive DOOM example.
|
|
140
|
+
|
|
141
|
+
The generated menu keeps Getting Started and Project overview first. Guides contains Configure your site, Read and explore, and Automate and integrate; each category contains its related pages. Operations and development groups publishing, maintenance and contribution guides. Git and GitHub contains the repository examples. Categories can contain further categories without a fixed nesting limit.
|
|
123
142
|
`,
|
|
124
143
|
gettingStarted: `# Getting Started
|
|
125
144
|
|
|
@@ -413,28 +432,44 @@ Behavior:
|
|
|
413
432
|
- If \`layoutsConfigPathOficial=true\`, runtime prefers official layout/template sources.
|
|
414
433
|
- If \`layoutsConfigPathOficial=false\`, runtime prefers repository-local/custom layout sources.
|
|
415
434
|
|
|
416
|
-
## Language, theme and
|
|
435
|
+
## Language, theme, focus, quick navigation, PDF and document controls
|
|
417
436
|
|
|
418
|
-
In \`gitpagedocs/config.json\`,
|
|
437
|
+
In \`gitpagedocs/config.json\`, these \`site.icons\` entries configure the language selector, theme selector, focus, Ctrl+K navigation, PDF actions and document-footer navigation. All eight controls use React Icons by default:
|
|
419
438
|
|
|
420
439
|
\`\`\`json
|
|
421
440
|
{
|
|
422
441
|
"site": {
|
|
423
442
|
"icons": {
|
|
424
443
|
"LanguageSelector": {
|
|
425
|
-
"reactIcon": true, "tag": "
|
|
444
|
+
"reactIcon": true, "tag": "SiGoogletranslate", "size": "22px",
|
|
426
445
|
"colorDark": "currentColor", "colorLight": "currentColor"
|
|
427
446
|
},
|
|
428
447
|
"ThemeSelector": {
|
|
429
|
-
"reactIcon": true, "tag": "
|
|
448
|
+
"reactIcon": true, "tag": "LuPencil", "size": "22px",
|
|
430
449
|
"colorDark": "currentColor", "colorLight": "currentColor"
|
|
431
450
|
},
|
|
432
451
|
"FocusMode": {
|
|
433
|
-
"reactIcon": true, "tag": "
|
|
452
|
+
"reactIcon": true, "tag": "LuBookOpen", "size": "22px",
|
|
434
453
|
"colorDark": "currentColor", "colorLight": "currentColor"
|
|
435
454
|
},
|
|
436
455
|
"QuickNavigation": {
|
|
437
|
-
"reactIcon": true, "tag": "
|
|
456
|
+
"reactIcon": true, "tag": "LuSearch", "size": "22px",
|
|
457
|
+
"colorDark": "currentColor", "colorLight": "currentColor"
|
|
458
|
+
},
|
|
459
|
+
"PdfDownload": {
|
|
460
|
+
"reactIcon": true, "tag": "LuDownload", "size": "22px",
|
|
461
|
+
"colorDark": "currentColor", "colorLight": "currentColor"
|
|
462
|
+
},
|
|
463
|
+
"PdfOpenInNewTab": {
|
|
464
|
+
"reactIcon": true, "tag": "LuExternalLink", "size": "22px",
|
|
465
|
+
"colorDark": "currentColor", "colorLight": "currentColor"
|
|
466
|
+
},
|
|
467
|
+
"DocumentPrevious": {
|
|
468
|
+
"reactIcon": true, "tag": "LuChevronLeft", "size": "22px",
|
|
469
|
+
"colorDark": "currentColor", "colorLight": "currentColor"
|
|
470
|
+
},
|
|
471
|
+
"DocumentNext": {
|
|
472
|
+
"reactIcon": true, "tag": "LuChevronRight", "size": "22px",
|
|
438
473
|
"colorDark": "currentColor", "colorLight": "currentColor"
|
|
439
474
|
}
|
|
440
475
|
}
|
|
@@ -442,7 +477,9 @@ In \`gitpagedocs/config.json\`, merge these entries into \`site.icons\` to use R
|
|
|
442
477
|
}
|
|
443
478
|
\`\`\`
|
|
444
479
|
|
|
445
|
-
Each control is independent: \`reactIcon:
|
|
480
|
+
Each control is independent: \`reactIcon: true\` shows its icon (the default); \`false\` displays text. Customize \`tag\`, \`size\`, \`colorDark\` and \`colorLight\` per control; \`currentColor\` follows the active theme. Icon controls keep their accessible names, and selectors keep their menus. The Ctrl+K shortcut remains available. \`site.FocusMode\` still enables focus mode; \`site.icons.FocusMode\` only changes the button's appearance. \`site.icons.PdfDownload\` and \`site.icons.PdfOpenInNewTab\` independently select text or icons; the corresponding \`site.pdf\` and route \`pdf\` flags control whether each action is available.
|
|
481
|
+
|
|
482
|
+
Compact configs may move shared values into \`site.icons.defaults\`; omitted fields inherit those defaults. Set \`reactIcon: false\` on a specific entry to override the default icon presentation with text.
|
|
446
483
|
|
|
447
484
|
## \`VersionControl\` section
|
|
448
485
|
|
|
@@ -512,7 +549,7 @@ Per-route options for \`routes-md\`, \`routes-html\`, \`routes-video\`, and \`ro
|
|
|
512
549
|
|
|
513
550
|
| Key | Default / purpose |
|
|
514
551
|
| --- | --- |
|
|
515
|
-
| \`ActiveNavigation\` | true;
|
|
552
|
+
| \`ActiveNavigation\` | true; quick-navigation control and Ctrl+K shortcut |
|
|
516
553
|
| \`FocusMode / focusMode\` | Master switch (true) and independent copy, download, section and document controls; see Focus mode |
|
|
517
554
|
| \`pdf\` | PDF master switch, preview, download and new-tab defaults; all true |
|
|
518
555
|
| \`nestedMenusEnabled\` | true; recursive menu tree, or flat destinations when false |
|
|
@@ -873,7 +910,7 @@ Routes define page content; menus define how readers reach it. Configure them in
|
|
|
873
910
|
|
|
874
911
|
Each \`menus-header-md\` entry has an \`id\` and localized \`pt\`, \`en\`, \`es\` objects with \`title\` and optional \`path-click\`. Add \`submenus\` containing more entries to nest the tree. A language object may also contain localized \`submenus\` with the same title/path structure. Use one form consistently to avoid listing the same child twice.
|
|
875
912
|
|
|
876
|
-
Groups without \`path-click\` organize children. For a Markdown destination, use its actual localized path from \`routes-md[].path\`.
|
|
913
|
+
Groups without \`path-click\` organize children. For a Markdown route destination, use its actual localized path from \`routes-md[].path\`. Source-viewer, video, audio, PDF and explicitly composed \`pages\` register \`page:<id>\`; a plain Markdown route uses its file path. The example below uses version \`0.0.8\`: replace that segment with the version you are editing and create the three chapter files.
|
|
877
914
|
|
|
878
915
|
\`\`\`json
|
|
879
916
|
{
|
|
@@ -941,6 +978,14 @@ Groups without \`path-click\` organize children. For a Markdown destination, use
|
|
|
941
978
|
|
|
942
979
|
## Nesting behavior
|
|
943
980
|
|
|
981
|
+
A parent can be both a document and a group. Keep its localized \`path-click\` together with \`submenus\`: the title opens its Markdown page, while the separate arrow expands or collapses children. The scaffold includes useful overviews for all eight parent groups. Breadcrumb ancestors link to those documents; the current destination remains the current breadcrumb. A group without a path can still organize children, but has no destination to open.
|
|
982
|
+
|
|
983
|
+
The following excerpt uses the scaffold's existing Markdown routes 31, 32 and 13. Merge it into \`menus-header-md\` and retain the matching \`routes-md\` definitions and files:
|
|
984
|
+
|
|
985
|
+
\`\`\`json
|
|
986
|
+
${PARENT_MENU_JSON}
|
|
987
|
+
\`\`\`
|
|
988
|
+
|
|
944
989
|
\`site.nestedMenusEnabled: true\` renders expandable recursive menus. You may add another \`submenus\` array at any node: there is no fixed application depth limit. The configuration must remain finite and practical for browser memory and usability. Setting it to \`false\` displays destinations as a flat list; it does not remove nested pages.
|
|
945
990
|
|
|
946
991
|
The tree supplies sidebar navigation, search labels, parent expansion and breadcrumb trails. Keep IDs stable and unambiguous; nodes pointing at a protected page follow its authorization rules. Apply the same structure to \`menus-header-source-viewer\`, \`menus-header-html\`, \`menus-header-video\` , \`menus-header-audio\` and \`menus-header-pdf\`. \`hierarchyMenu\` orders the type sections; \`hierarchyPage\` orders content containers that share a page ID.
|
|
@@ -953,7 +998,9 @@ The tree supplies sidebar navigation, search labels, parent expansion and breadc
|
|
|
953
998
|
|
|
954
999
|
## URLs and previous/next
|
|
955
1000
|
|
|
956
|
-
Versioned URLs use \`/v/<version>/\`; \`?lang=pt\` selects a language and \`?id=101\` selects a page ID. \`?name=chapter\` selects the document slug. Keep \`VersionControl.versions[].path\` pointing at the matching version config. \`site.ActiveNavigation\` enables
|
|
1001
|
+
Versioned URLs use \`/v/<version>/\`; \`?lang=pt\` selects a language and \`?id=101\` selects a page ID. \`?name=chapter\` selects the document slug. Keep \`VersionControl.versions[].path\` pointing at the matching version config. \`site.ActiveNavigation\` enables quick navigation and its Ctrl+K shortcut. Footer previous/next controls follow available menu destinations; focus-mode document navigation has its own option. See Focus mode for its section and document controls.
|
|
1002
|
+
|
|
1003
|
+
Footer previous/next buttons use \`site.icons.DocumentPrevious\` (\`LuChevronLeft\`) and \`site.icons.DocumentNext\` (\`LuChevronRight\`) by default. Set \`reactIcon: false\` on either entry to show its translated text; each entry also accepts \`tag\`, \`size\`, \`colorDark\` and \`colorLight\`. Appearance does not change navigation: the footer appears when more than one menu destination is available, and the unavailable direction stays disabled at the ends.
|
|
957
1004
|
|
|
958
1005
|
Test a new menu from the sidebar, by direct URL and in each enabled language; verify the destination exists and is allowed for the current reader.
|
|
959
1006
|
`,
|
|
@@ -979,18 +1026,21 @@ Merge this fragment into \`gitpagedocs/config.json\`:
|
|
|
979
1026
|
}
|
|
980
1027
|
\`\`\`
|
|
981
1028
|
|
|
982
|
-
Each option defaults to \`true\`; setting one to \`false\` hides its corresponding
|
|
1029
|
+
Each option defaults to \`true\`; setting one to \`false\` hides its corresponding action or navigation group. With \`sectionNavigationEnabled: false\`, focus mode displays the entire document without section pagination. Existing configurations without the new \`focusMode\` object keep the controls enabled.
|
|
983
1030
|
|
|
984
1031
|
## Sections and documents
|
|
985
1032
|
|
|
986
|
-
-
|
|
987
|
-
-
|
|
1033
|
+
- Section navigation has four buttons: first section, previous section, next section and last section of the current document.
|
|
1034
|
+
- Document navigation has four buttons: first document, previous document, next document and last document in menu order, including nested menus.
|
|
1035
|
+
- \`sectionNavigationEnabled\` controls the four section buttons; \`documentNavigationEnabled\` controls the four document buttons. Unavailable directions are disabled at the ends.
|
|
988
1036
|
- Documents without a translation in the active language, non-Markdown destinations and inaccessible pages are skipped.
|
|
989
1037
|
- Switching documents keeps the dialog open and starts at the first section. Section/document counters show the current position.
|
|
990
|
-
- \`site.ActiveNavigation\` controls the
|
|
1038
|
+
- \`site.ActiveNavigation\` controls the quick-navigation interface; it does not disable focus-mode document navigation.
|
|
991
1039
|
|
|
992
1040
|
## Copy and download
|
|
993
1041
|
|
|
1042
|
+
On a composed page, focus reads the authorized Markdown blocks in order, including repetitions. Its copy/download actions join those sources and use \`page-<id>.md\`; individual block actions retain their original filenames. See Ordered content blocks for the full contract.
|
|
1043
|
+
|
|
994
1044
|
Copy and download use the **entire original Markdown document in the selected language**, including sections not currently visible. They do not export the rendered HTML or only the current reading section.
|
|
995
1045
|
|
|
996
1046
|
The download keeps the Markdown basename from the route's localized \`path\`; if unavailable, the filename is \`document.md\`. Clipboard access follows the browser's permission and secure-context rules. If copying fails, use download instead and check the displayed error.
|
|
@@ -1092,7 +1142,7 @@ Because GitHub Pages build mode enables repository-search home and static-export
|
|
|
1092
1142
|
|
|
1093
1143
|
## Why does an icon still show text?
|
|
1094
1144
|
|
|
1095
|
-
Set \`site.icons.<Control>.reactIcon\` to the boolean \`true\`, with an exact React Icons export name in \`tag\`.
|
|
1145
|
+
Set \`site.icons.<Control>.reactIcon\` to the boolean \`true\`, with an exact React Icons export name in \`tag\`. LanguageSelector, ThemeSelector, FocusMode, QuickNavigation, PdfDownload, PdfOpenInNewTab, DocumentPrevious and DocumentNext use icons by default; set any entry to \`false\` for text. Flat \`Icon*ReactIcones\` fields take precedence if both formats are present. Check whether the feature itself is disabled, such as \`HideThemeSelector\`, \`FocusMode\` or the PDF action flags.
|
|
1096
1146
|
|
|
1097
1147
|
## Why do menu children or breadcrumbs differ?
|
|
1098
1148
|
|