@gitpagedocs/cli 0.0.8 → 0.0.10

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.
@@ -1,6 +1,90 @@
1
1
  import { PACKAGE_VERSION } from "../contracts/doc-versions.mjs";
2
+ import { practicalEn } from "./practical-en.mjs";
3
+ import { operationsEn } from "./operations-en.mjs";
2
4
 
3
5
  export const docsEn = {
6
+ ...practicalEn,
7
+ ...operationsEn,
8
+ pdf: `# PDF documents
9
+
10
+ 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.
11
+
12
+ ## Included English project guide
13
+
14
+ The scaffold includes [GitPageDocs project guide (PDF, English)](https://github.com/Vidigal-code/git-page-docs/blob/main/cli/content/assets/gitpagedocs-project-guide.pdf). It explains the project, packages, configuration, icons, focus mode, narration, CLI, MCP and deployment. The PDF is in English; the reference page is translated into English, Portuguese and Spanish.
15
+
16
+ The CLI copies the bundled PDF bytes into \`gitpagedocs/docs/versions/<version>/en/gitpagedocs-project-guide.pdf\`. All three language paths in the example point to this English file. To provide translations, add the translated PDFs and change each language path.
17
+
18
+ ## Site defaults
19
+
20
+ Add this block inside \`site\` in \`gitpagedocs/config.json\`:
21
+
22
+ \`\`\`json
23
+ {
24
+ "pdf": {
25
+ "enabled": true,
26
+ "previewEnabled": true,
27
+ "downloadEnabled": true,
28
+ "openInNewTabEnabled": true
29
+ }
30
+ }
31
+ \`\`\`
32
+
33
+ \`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.
34
+
35
+ 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.
36
+
37
+ PDF actions use icons by default. Configure \`site.icons.PdfDownload\` (\`FiDownload\`) and \`site.icons.PdfOpenInNewTab\` (\`FiExternalLink\`) 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.
38
+
39
+ ## Route and menu example
40
+
41
+ In \`gitpagedocs/docs/versions/0.0.10/config.json\`, keep route and menu arrays at the top level:
42
+
43
+ \`\`\`json
44
+ {
45
+ "routes-pdf": [{
46
+ "id": 23,
47
+ "title": { "en": "Project guide (English)", "pt": "Guia do projeto (inglês)", "es": "Guía del proyecto (inglés)" },
48
+ "pdf": {
49
+ "pathPdf": {
50
+ "en": "gitpagedocs/docs/versions/0.0.10/en/gitpagedocs-project-guide.pdf",
51
+ "pt": "gitpagedocs/docs/versions/0.0.10/en/gitpagedocs-project-guide.pdf",
52
+ "es": "gitpagedocs/docs/versions/0.0.10/en/gitpagedocs-project-guide.pdf"
53
+ },
54
+ "previewEnabled": true,
55
+ "downloadEnabled": true,
56
+ "openInNewTabEnabled": true
57
+ }
58
+ }],
59
+ "menus-header-pdf": [{
60
+ "id": 23,
61
+ "en": { "title": "Project guide (English)", "path-click": "page:23" },
62
+ "pt": { "title": "Guia do projeto (inglês)", "path-click": "page:23" },
63
+ "es": { "title": "Guía del proyecto (inglés)", "path-click": "page:23" }
64
+ }]
65
+ }
66
+ \`\`\`
67
+
68
+ The \`pdf.pathPdf\` map selects the file for the current language. Use \`page:<id>\` in PDF menu destinations. The same recursive \`submenus\` structure used by other menus is supported. The scaffold reserves ID 23 for the PDF example and ID 24 for this Markdown reference; use unique IDs for additional pages.
69
+
70
+ The optional route flags live inside \`pdf\`. Shared presentation, \`container\`, \`RouteGuide\` and authorization options remain route-level fields. \`routeDefaults\` also applies to PDF routes. Add \`"pdf": 5\` to \`hierarchyPage\` and \`hierarchyMenu\` to position PDFs after audio; change the order values to suit your site.
71
+
72
+ ## Files and deployment
73
+
74
+ 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.
75
+
76
+ 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.
77
+
78
+ 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.
79
+
80
+ ## Reading and troubleshooting
81
+
82
+ - Native PDF controls, keyboard support, zoom and page navigation depend on the browser's PDF viewer. Some mobile browsers open or download the file instead of embedding it.
83
+ - 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.
84
+ - Disabling preview can keep the download and new-tab actions available. Turning off every PDF action leaves no interactive PDF control.
85
+ - A disabled button is not access control. Publicly hosted PDFs remain downloadable by URL. Use protected hosting for confidential documents.
86
+ - 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.
87
+ `,
4
88
  index: `# Git Page Docs
5
89
 
6
90
  Git Page Docs is a multilingual documentation runtime for repositories that ship a \`gitpagedocs/\` folder.
@@ -33,50 +117,70 @@ The runtime expects this structure:
33
117
  - Open **Themes and layouts** for template authoring details.
34
118
  - Open **Authorized routes** for key, roles, and external auth setup.
35
119
  - Open **FAQ** for troubleshooting.
120
+
121
+ ## Detailed references
122
+
123
+ - **CLI reference**: installation, every command and compatibility flags.
124
+ - **MCP server**: client setup, all 20 tools, 7 resources and provider configuration.
125
+ - **Navigation and nested menus**: recursive trees, URLs and breadcrumb overrides.
126
+ - **Focus mode**: copy/download Markdown and section/document navigation.
127
+ - **Accessibility and narration**: browser voices, controls and media interaction.
128
+ - **PDF documents**: native previews, download/new-tab controls and the included English guide.
129
+ - **Configuration recipes**: a complete multilingual site and a menu with sections inside sections.
130
+ - **Migration and compatibility**: upgrade configurations from 0.0.1 onward while preserving your content.
131
+ - **Troubleshooting**: UTF-8, local and Pages paths, PDF loading, browser voices and MCP startup.
132
+ - **Contributing and validation**: source files, generation, public contracts and release checks.
133
+ - **HTML containers**: local and external pages, route/menu configuration and the interactive DOOM example.
134
+
135
+ 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.
36
136
  `,
37
137
  gettingStarted: `# Getting Started
38
138
 
39
- This guide configures your repository from zero to running docs.
139
+ Git Page Docs separates the documentation files from the viewer. Install the CLI to create the files; use the official viewer, GitHub Pages or a checkout of the runtime to display them.
40
140
 
41
- ## Prerequisites
141
+ ## Requirements and installation
42
142
 
43
- - Node.js 20+
44
- - npm 10+
143
+ Use Node.js 20 or newer. Git is needed for publishing; GitHub CLI is needed when asking the CLI to configure Pages automatically.
45
144
 
46
- ## Install and generate
145
+ \`\`\`bash
146
+ npm install --save-dev @gitpagedocs/cli
147
+ npx gitpagedocs --no-interactive --owner YOUR_USER --repo YOUR_REPOSITORY
148
+ \`\`\`
47
149
 
48
- 1. Install package:
49
- - \`npm install @gitpagedocs/cli\`
50
- 2. Generate docs config and versions:
51
- - \`npx @gitpagedocs/cli\`
52
- 3. Optional: generate local layouts/templates:
53
- - \`npx @gitpagedocs/cli --layoutconfig\`
150
+ For a one-off run, use \`npx --yes @gitpagedocs/cli --no-interactive --owner YOUR_USER --repo YOUR_REPOSITORY\`. For a global command, use \`npm install -g @gitpagedocs/cli\`, then \`gitpagedocs\`. Run from the repository root.
54
151
 
55
- ## Local run
152
+ ## Generated contract
56
153
 
57
- 1. Development:
58
- - \`npm run dev\`
59
- 2. Production locally:
60
- - \`npm run build\`
61
- - \`npm start\`
154
+ - \`gitpagedocs/config.json\`: site options and version references.
155
+ - \`gitpagedocs/langs/{en,pt,es}.json\`: UI strings.
156
+ - \`gitpagedocs/docs/versions/<version>/config.json\`: routes and menus.
157
+ - \`gitpagedocs/docs/versions/<version>/{en,pt,es}/*.md\`: page content; filenames stay in English across languages.
158
+ - \`gitpagedocs/icon.svg\`: site icon.
159
+ - \`--layoutconfig\` additionally writes \`gitpagelayouts/\`; use \`--layouts-dir\` to change that directory.
62
160
 
63
- ## CLI behavior
161
+ The generator writes configuration and content; it does not install a Next.js application into your repository. Rerunning it writes the scaffold files again: review the Git diff before keeping changes to hand-edited documentation.
64
162
 
65
- \`npx @gitpagedocs/cli\` generates only artifacts in \`gitpagedocs/\`:
163
+ ## Read and publish
66
164
 
67
- - JSON + markdown docs assets
68
- - No \`index.html\`
69
- - No \`index.js\`
70
- - No install command execution
165
+ Commit and push the generated folder, then open \`https://vidigal-code.github.io/git-page-docs/YOUR_USER/YOUR_REPOSITORY/\` for a public repository. To publish your own site, authenticate with \`gh auth login\`, then run \`npx gitpagedocs pages deploy --owner YOUR_USER --repo YOUR_REPOSITORY\`. This generates files, commits and pushes; inspect the resulting GitHub Actions run. See Deployment for the subpath and workflow contract.
71
166
 
72
- ## Repository search mode
167
+ ## Develop the viewer locally
73
168
 
74
- Local repository search is controlled by:
169
+ The following commands belong to a checkout of Git Page Docs, not to a repository containing only generated files:
75
170
 
76
- - \`GITPAGEDOCS_REPOSITORY_SEARCH=true\`
77
- - \`GITPAGEDOCS_REPOSITORY_SEARCH=false\`
171
+ \`\`\`bash
172
+ git clone https://github.com/Vidigal-code/git-page-docs.git
173
+ cd git-page-docs
174
+ corepack enable
175
+ pnpm install --frozen-lockfile
176
+ pnpm dev
177
+ \`\`\`
78
178
 
79
- On GitHub Pages builds (\`GITHUB_ACTIONS=true\`), repository-search home is enabled.
179
+ The repository pins pnpm in \`packageManager\`. \`pnpm dev\` enables repository search; \`pnpm dev:e2e\` uses the local documentation. For a production build, run \`pnpm build\` and \`pnpm start\`; the start script rebuilds before starting. Use \`PORT=3100\` in the process environment when port 3000 is occupied.
180
+
181
+ ## Next steps
182
+
183
+ Use Configuration for languages, icons, navigation, focus and narration; Functionalities for CLI and MCP; Themes and layouts for visual tokens; FAQ for diagnostics.
80
184
  `,
81
185
  projectOverview: `# Project Overview
82
186
 
@@ -108,51 +212,9 @@ Git Page Docs is a **pnpm + turborepo monorepo** that turns a repository's \`git
108
212
 
109
213
  Complete reference of CLI options, configuration keys, and runtime features.
110
214
 
111
- ## CLI commands
112
-
113
- | Command | Description |
114
- |---------|--------------|
115
- | \`gitpagedocs\` | Generate config and docs in \`gitpagedocs/\` |
116
- | \`gitpagedocs --layoutconfig\` | Also generate local layouts/templates in \`gitpagelayouts/\` |
117
- | \`gitpagedocs --home\` | Standalone distribution (\`gitpagedocshome/\`) |
118
- | \`gitpagedocs --push --owner X --repo Y\` | Setup workflow, commit, push |
119
- | \`gitpagedocs --interactive\` / \`-i\` | Interactive mode with prompts (the default in a terminal) |
120
- | \`gitpagedocs --no-interactive\` / \`--yes\` / \`-y\` | Never prompt; use flags and defaults |
121
- | \`gitpagedocs ai\` | Interactive AI documentation generator |
122
- | \`gitpagedocs chat [question]\` | Streaming AI chat in the terminal (REPL on a TTY; one-shot with a question or piped stdin) |
123
- | \`gitpagedocs provider [id]\` / \`models [provider]\` | List AI providers / catalog models |
124
- | \`gitpagedocs document[:repo\\|:file\\|:folder]\` | Generate documentation with AI |
125
- | \`gitpagedocs deploy\` / \`pages [actions\\|deploy]\` | Configure GitHub Pages via Actions + push |
126
- | \`gitpagedocs docs\` | Refresh README/CONTRIBUTING/SECURITY managed regions |
127
- | \`gitpagedocs password\` | Set a documentation access password (public key in \`site.docsAccess\`) |
128
- | \`gitpagedocs config\` / \`config clear\` | Show the resolved config / delete the stored config and key vault |
129
- | \`gitpagedocs doctor\` / \`version\` / \`update\` | Diagnostics / version / registry update check |
130
- | \`gitpagedocs mcp start\` | Start the MCP server over stdio |
131
-
132
- Install globally with \`npm install -g @gitpagedocs/cli\`, or run one-off with \`npx @gitpagedocs/cli\`.
215
+ ## Command line
133
216
 
134
- ## CLI options
135
-
136
- | Option | Description |
137
- |--------|-------------|
138
- | \`--owner <user>\` | GitHub owner |
139
- | \`--repo <repo>\` | GitHub repository |
140
- | \`--path <subpath>\` | Docs subpath (e.g. \`docs\`); without it, base path = repo name for correct CSS/JS on project sites |
141
- | \`--output <dir>\` | Output directory (default: \`gitpagedocs\`) |
142
- | \`--search true|false\` | Enable/disable repository search (\`--home\`) |
143
- | \`--layoutconfig\` | Generate local layouts in \`gitpagelayouts/\` |
144
- | \`--layouts-dir <dir>\` | Folder for local layouts (default: \`gitpagelayouts\`) |
145
- | \`--push\` | Create workflow, commit artifacts, push |
146
- | \`--pages-actions\` | Only switch GitHub Pages to GitHub Actions (same as \`pages actions\`) |
147
- | \`--home\` | Generate \`gitpagedocshome/\` (static + .env + Dockerfile) |
148
-
149
- ## Generated output
150
-
151
- - \`gitpagedocs/config.json\` – root config
152
- - \`gitpagedocs/icon.svg\` – default icon
153
- - \`gitpagedocs/docs/versions/<ver>/config.json\` – per-version routes
154
- - \`gitpagedocs/docs/versions/<ver>/{en,pt,es}/*.md\` – markdown docs
155
- - \`gitpagelayouts/\` – only with \`--layoutconfig\` (folder configurable with \`--layouts-dir\`)
217
+ See **CLI reference** for all commands, flags, examples and compatibility behavior. See **MCP server** for editor integration.
156
218
 
157
219
  ## Content types
158
220
 
@@ -162,6 +224,7 @@ Install globally with \`npm install -g @gitpagedocs/cli\`, or run one-off with \
162
224
  | HTML | \`routes-html\` | local \`path\` or external \`url\` |
163
225
  | Video | \`routes-video\` | \`video.pathVideo\`, \`video.videoType\` |
164
226
  | Audio | \`routes-audio\` | \`audio.pathAudio\`, \`audio.audioType\` |
227
+ | PDF | \`routes-pdf\` | \`pdf.pathPdf\` per language; native preview and download |
165
228
 
166
229
  ## Source code viewer
167
230
 
@@ -363,6 +426,55 @@ Behavior:
363
426
  - If \`layoutsConfigPathOficial=true\`, runtime prefers official layout/template sources.
364
427
  - If \`layoutsConfigPathOficial=false\`, runtime prefers repository-local/custom layout sources.
365
428
 
429
+ ## Language, theme, focus, quick navigation, PDF and document controls
430
+
431
+ 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:
432
+
433
+ \`\`\`json
434
+ {
435
+ "site": {
436
+ "icons": {
437
+ "LanguageSelector": {
438
+ "reactIcon": true, "tag": "FiGlobe", "size": "22px",
439
+ "colorDark": "currentColor", "colorLight": "currentColor"
440
+ },
441
+ "ThemeSelector": {
442
+ "reactIcon": true, "tag": "BsSunFill", "size": "22px",
443
+ "colorDark": "currentColor", "colorLight": "currentColor"
444
+ },
445
+ "FocusMode": {
446
+ "reactIcon": true, "tag": "MdFullscreen", "size": "22px",
447
+ "colorDark": "currentColor", "colorLight": "currentColor"
448
+ },
449
+ "QuickNavigation": {
450
+ "reactIcon": true, "tag": "FiSearch", "size": "22px",
451
+ "colorDark": "currentColor", "colorLight": "currentColor"
452
+ },
453
+ "PdfDownload": {
454
+ "reactIcon": true, "tag": "FiDownload", "size": "22px",
455
+ "colorDark": "currentColor", "colorLight": "currentColor"
456
+ },
457
+ "PdfOpenInNewTab": {
458
+ "reactIcon": true, "tag": "FiExternalLink", "size": "22px",
459
+ "colorDark": "currentColor", "colorLight": "currentColor"
460
+ },
461
+ "DocumentPrevious": {
462
+ "reactIcon": true, "tag": "FiChevronLeft", "size": "22px",
463
+ "colorDark": "currentColor", "colorLight": "currentColor"
464
+ },
465
+ "DocumentNext": {
466
+ "reactIcon": true, "tag": "FiChevronRight", "size": "22px",
467
+ "colorDark": "currentColor", "colorLight": "currentColor"
468
+ }
469
+ }
470
+ }
471
+ }
472
+ \`\`\`
473
+
474
+ 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.
475
+
476
+ 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.
477
+
366
478
  ## \`VersionControl\` section
367
479
 
368
480
  \`VersionControl.versions\` defines:
@@ -394,10 +506,11 @@ Version configs support multiple content types:
394
506
  - \`routes-html\`: HTML page paths per language
395
507
  - \`routes-video\`: Video config with \`video.videoType\` (youtube, vimeo, mp4, etc.) and \`video.pathVideo\`
396
508
  - \`routes-audio\`: Audio config with \`audio.audioType\` (youtube, mp3, etc.) and \`audio.pathAudio\`
509
+ - \`routes-pdf\`: PDF config with \`pdf.pathPdf\` per language; see PDF documents.
397
510
  - \`authorization\` (md/html/video): route guard by access key, roles, and external auth
398
- - \`menus-header-md\`, \`menus-header-source-viewer\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`: menus per type
399
- - \`hierarchyPage\`: container order on page \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
400
- - \`hierarchyMenu\`: menu section order \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
511
+ - \`menus-header-md\`, \`menus-header-source-viewer\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`, \`menus-header-pdf\`: menus per type
512
+ - \`hierarchyPage\`: container order on page \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4, pdf: 5 }\`
513
+ - \`hierarchyMenu\`: menu section order \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4, pdf: 5 }\`
401
514
 
402
515
  Each route can include \`title\`, \`description\` (per language), \`titleCss\`, \`titlePosition: "center"\`, \`descriptionPosition: "center"\`, \`titleIsVisible\`, \`descriptionIsVisible\`.
403
516
 
@@ -425,48 +538,84 @@ Per-route options for \`routes-md\`, \`routes-html\`, \`routes-video\`, and \`ro
425
538
 
426
539
  - \`GITPAGEDOCS_REPOSITORY_SEARCH\`: enable/disable remote repository search in local runtime
427
540
  - \`GITHUB_ACTIONS\`: enables GitHub Pages specific runtime behavior
541
+
542
+ ## Site behavior and defaults
543
+
544
+ | Key | Default / purpose |
545
+ | --- | --- |
546
+ | \`ActiveNavigation\` | true; quick-navigation control and Ctrl+K shortcut |
547
+ | \`FocusMode / focusMode\` | Master switch (true) and independent copy, download, section and document controls; see Focus mode |
548
+ | \`pdf\` | PDF master switch, preview, download and new-tab defaults; all true |
549
+ | \`nestedMenusEnabled\` | true; recursive menu tree, or flat destinations when false |
550
+ | \`RouteGuide\` | true; breadcrumbs, overridable by version defaults and individual Markdown routes |
551
+ | \`accessibility\` | Enabled by default; narration settings are explained in Accessibility |
552
+ | \`HideThemeSelector\` | false; true hides the theme selector |
553
+ | \`FooterEnabled\` | true; show the footer |
554
+ | \`FooterLinkName / FooterLinkUrl\` | Footer link label and destination |
555
+ | \`FooterDateMode / FooterDateCustom\` | browser, year or custom; custom uses the configured text |
556
+ | \`SiteHeaderName / SiteIconPath\` | Header brand and site icon path |
557
+ | \`audioPlayerEnabled\` | true; background audio controls |
558
+ | \`audioAutoPlayOnLoad\` | false; autoplay remains subject to browser policy |
559
+ | \`audioLoopEnabled / audioSequentialPlayback\` | false; loop current track / advance native tracks |
560
+ | \`audioAllowUserChoice\` | Allow track selection when a playlist has multiple entries |
561
+ | \`audioTracks\` | Track objects: url, type and localized title |
562
+ | \`audioPopoverHideSource / audioPopoverShowMinutes\` | false / true; source label and native-track duration |
563
+ | \`audioPopoverSourceCustomLabel\` | Optional localized source label |
564
+ | \`mediaExclusivePlayback\` | true; only one audible source among narration, radio, audio and video |
565
+ | \`AiChatEnabled / AiChatAutoLockSeconds\` | true / 30; show the chat and lock after inactivity (0 disables the timer) |
566
+ | \`docsAccess\` | enabled and publicKey configure the documentation gate; public files remain public |
567
+ | \`RouteguideBrandPositionDefault / RouteguideBrandContainerTopDefault\` | center / false; heading-outline layout, distinct from breadcrumbs |
568
+ | \`TocScrollMaxHeightDesktop / TocScrollMaxHeightMobile\` | Heading-outline scroll limits; CSS lengths such as min(65vh, 400px) |
569
+
570
+ ## Adding a version or document
571
+
572
+ Create a version directory and its config, then register it in \`VersionControl.versions\` with \`id\` and \`path\`. Add a \`routes-md\` entry with a unique page ID and localized paths; add matching menu destinations. Keep \`routeDefaults\` for values shared by all routes; explicit route fields win. See Navigation for recursive menus and \`RouteGuide\` overrides.
573
+
574
+ Display settings are public configuration. Never store provider credentials or private keys in site JSON. The examples in Authorized routes demonstrate client-side controls, not server-side protection of downloadable files.
575
+
576
+ The \`QuickNavigation\` entry controls the Ctrl+K button's icon/text appearance. The keyboard shortcut and search panel remain available.
428
577
  `,
429
578
  deployment: `# Deployment
430
579
 
431
- Git Page Docs supports two usage models:
580
+ Choose the official viewer for a public repository, deploy a dedicated GitHub Pages site, or host a static export built from the runtime.
581
+
582
+ ## Official viewer
583
+
584
+ Commit the generated \`gitpagedocs/\` folder to your public repository. Open \`https://vidigal-code.github.io/git-page-docs/OWNER/REPOSITORY/\`; select a version and language. The viewer fetches the repository configuration and content. A private repository is not made public by using this URL.
585
+
586
+ ## Your GitHub Pages site
587
+
588
+ Prerequisites: Git repository, a GitHub origin, permission to push, and authenticated GitHub CLI (\`gh auth login\`) when configuring Pages through the CLI.
432
589
 
433
- 1. Use the official viewer site
434
- 2. Self-host your own GitHub Pages runtime
590
+ \`\`\`bash
591
+ npx gitpagedocs pages deploy --owner OWNER --repo REPOSITORY
592
+ \`\`\`
435
593
 
436
- ## Official viewer site
594
+ This flow confirms the target, generates docs and \`.github/workflows/gitpagedocs-pages.yml\`, commits, pushes and requests GitHub Actions as the Pages source. To change only the source, use \`npx gitpagedocs pages actions\`. To publish under a subpath, pass \`--path docs\`.
437
595
 
438
- Use:
596
+ Watch the GitHub Actions run until deployment succeeds; the CLI's printed URL can appear before the remote build finishes. Project sites normally use \`https://OWNER.github.io/REPOSITORY/\`; user/organization sites use the root of their \`OWNER.github.io\` repository.
439
597
 
440
- - \`https://vidigal-code.github.io/git-page-docs/\`
598
+ ## Build contract
441
599
 
442
- Provide owner + repository to load docs from repositories that contain \`gitpagedocs/\`.
600
+ The workflow installs the pinned pnpm workspace dependencies, builds the viewer and uploads the static artifact with the official Pages actions. Its deploy job needs \`pages: write\`, \`id-token: write\` and the \`github-pages\` environment.
443
601
 
444
- ## Self-hosted GitHub Pages
602
+ - \`GITHUB_ACTIONS=true\` enables Next.js static export.
603
+ - \`GITHUB_REPOSITORY=OWNER/REPOSITORY\` supplies the repository base path.
604
+ - \`GITPAGEDOCS_REPOSITORY_SEARCH=true\` enables the search-home build.
605
+ - \`GITPAGEDOCS_BASE_PATH\` can explicitly override the base path; \`GITPAGEDOCS_PATH\` supplies the docs subpath.
606
+ - \`GITPAGEDOCS_DIST_DIR\` separates build/dev output when running two local servers.
445
607
 
446
- 1. Generate docs:
447
- - \`npx @gitpagedocs/cli\`
448
- - or \`npx @gitpagedocs/cli --layoutconfig\` for local templates
449
- 2. Set \`site.rendering\` in \`gitpagedocs/config.json\`:
450
- - \`https://<your-user>.github.io/<your-repo>/\`
451
- 3. Build and validate:
452
- - \`npm run lint\`
453
- - \`npm run build\`
454
- 4. Deploy with GitHub Pages workflow.
608
+ A normal \`pnpm build\` without the Pages environment is a Next.js production build; it does not by itself prove the static export. Preserve \`.nojekyll\` when hosting the export on Pages.
455
609
 
456
- When \`GITHUB_ACTIONS=true\`, runtime applies GitHub Pages behavior.
610
+ ## Standalone export
457
611
 
458
- ## npm publish flows
612
+ From a runtime checkout with installed dependencies, \`node cli/index.mjs --home --output gitpagedocshome --no-interactive\` builds \`frontend/\` and packages a static distribution. \`--search true\` enables its repository-search home. The output includes static files, a README, Dockerfile and environment example; its destination is recreated. A static web server serves the resulting files; changing a build-time environment option requires another build.
459
613
 
460
- Recommended: GitHub Release + CI publish.
614
+ ## npm releases for maintainers
461
615
 
462
- Manual fallback:
616
+ The monorepo publishes \`@gitpagedocs/tools\`, \`@gitpagedocs/mcp\` and \`@gitpagedocs/cli\`; the workspace root and frontend are private. The current \`npm-publish.yml\` runs on pushes to \`main\` and skips a CLI version already on npm. It uses the repository's \`NPM_TOKEN\` secret and publishes workspaces in dependency order. Creating a GitHub release alone is not its trigger.
463
617
 
464
- 1. \`npm whoami\`
465
- 2. \`npm run lint\`
466
- 3. \`npm run build\`
467
- 4. \`npm pack --ignore-scripts\`
468
- 5. \`npm version patch\`
469
- 6. \`npm publish --access public\`
618
+ Synchronize package versions and internal dependencies, regenerate docs/baselines, run typecheck, lint, tests, smoke checks, build and Playwright, then review before pushing. Confirm all three package versions on npm and the Pages workflow result. The config-only CLI ignores \`prebuilt/\`; it is not required by this publishing workflow.
470
619
  `,
471
620
  architecture: `# Architecture
472
621
 
@@ -536,6 +685,414 @@ Each template usually includes:
536
685
  - Light/dark toggle resolves paired theme via reference.
537
686
  - CSS variables are generated from template tokens.
538
687
  - Runtime includes fallback behavior if a source is unavailable.
688
+
689
+ ## Choose and customize
690
+
691
+ Select an installed theme through the theme selector or configure \`site.ThemeDefault\` with its exact ID. \`ThemeModeDefault\` sets the initial light/dark mode. \`HideThemeSelector\` hides the selector; the selected theme still applies.
692
+
693
+ For your own repository, run the CLI with \`--layoutconfig\`, then edit the generated template and keep its ID consistent with \`layoutsConfig.json\`. A route's content and \`site.icons\` remain independent of the theme catalog. Use \`currentColor\` for icons that should inherit the active text color, or configure separate dark/light colors with sufficient contrast.
694
+
695
+ When contributing to Git Page Docs itself, the authoring source is \`gitpagelayouts/v2/base.json\` plus \`gitpagelayouts/v2/layouts/<id>.json\`. Run \`pnpm layouts:sync\` to regenerate templates and documentation. Direct edits to generated templates can be overwritten by that synchronization.
696
+ `,
697
+ mcp: `# MCP server
698
+
699
+ The Model Context Protocol server exposes 20 tools and 7 resources over **stdio**. It starts as a child process of your MCP client. It does not open an HTTP port or run a background daemon.
700
+
701
+ ## Install and connect
702
+
703
+ Use Node.js 20+. Install the CLI in the project with \`npm install --save-dev @gitpagedocs/cli\`; this includes the server and its TypeScript runtime. A global installation also supports \`gitpagedocs mcp start\`. For a one-off run, use \`npx --yes @gitpagedocs/cli mcp start\`.
704
+
705
+ In VS Code, create \`.vscode/mcp.json\` with the following configuration. The process working directory is the project root; the MCP command has no \`--root\` or \`--cwd\` flag.
706
+
707
+ \`\`\`json
708
+ {
709
+ "servers": {
710
+ "gitpagedocs": {
711
+ "type": "stdio",
712
+ "command": "node",
713
+ "args": [
714
+ "\${workspaceFolder}/node_modules/@gitpagedocs/cli/index.mjs",
715
+ "mcp",
716
+ "start"
717
+ ],
718
+ "cwd": "\${workspaceFolder}"
719
+ }
720
+ }
721
+ }
722
+ \`\`\`
723
+
724
+ Open the client's MCP server controls, start GitPageDocs and list its tools/resources. Test \`list_files\` with \`{"path":".","recursive":false}\` and read \`project://readme\`. These operations need no provider key. A terminal launched with \`mcp start\` waits for JSON-RPC; ordinary text typed into stdin is not a chat command. On a source checkout, the direct entry is \`node --import tsx mcp/src/bin.ts\`, not \`index.ts\`.
725
+
726
+ ## Configure a provider
727
+
728
+ Provider calls read credentials from the server process environment. MCP does not automatically load \`.env\` or the CLI's encrypted vault. Use the client's protected input/secret facility to inject environment values; never place real keys in a committed configuration. Restart the MCP process after changing its environment.
729
+
730
+ Select a provider using \`configure_ai_provider\` or \`.gitpagedocs-mcp.json\` at the project root:
731
+
732
+ \`\`\`json
733
+ {
734
+ "provider": "ollama",
735
+ "model": "llama3"
736
+ }
737
+ \`\`\`
738
+
739
+ | Provider | Environment |
740
+ | --- | --- |
741
+ | \`openai\` | \`OPENAI_API_KEY\` |
742
+ | \`anthropic\` | \`ANTHROPIC_API_KEY / CLAUDE_API_KEY\` |
743
+ | \`gemini\` | \`GEMINI_API_KEY / GOOGLE_API_KEY\` |
744
+ | \`openrouter\` | \`OPENROUTER_API_KEY\` |
745
+ | \`ollama\` | \`OLLAMA_BASE_URL\` |
746
+ | \`azure-openai\` | \`AZURE_OPENAI_API_KEY + AZURE_OPENAI_BASE_URL\` |
747
+ | \`mistral\` | \`MISTRAL_API_KEY\` |
748
+ | \`deepseek\` | \`DEEPSEEK_API_KEY\` |
749
+ | \`cohere\` | \`COHERE_API_KEY\` |
750
+ | \`groq\` | \`GROQ_API_KEY\` |
751
+ | \`xai\` | \`XAI_API_KEY\` |
752
+ | \`together\` | \`TOGETHER_API_KEY\` |
753
+ | \`fireworks\` | \`FIREWORKS_API_KEY\` |
754
+ | \`perplexity\` | \`PERPLEXITY_API_KEY\` |
755
+
756
+ With no valid selection, the default provider is OpenAI. Ollama does not require an API key; its local service and chosen model must be available. \`OLLAMA_BASE_URL\` is optional. Azure's base URL is the complete chat-operation URL, including deployment and API-version query when required. Model listings are the bundled catalog, not a live availability check.
757
+
758
+ ## Tool reference
759
+
760
+ \`?\` marks an optional argument. Paths and content are strings; \`recursive\` is boolean. Provider identifiers come from the provider catalog. Call tools through the MCP client's tool interface.
761
+
762
+ | Tool | Arguments | Behavior |
763
+ | --- | --- | --- |
764
+ | \`list_files\` | \`path?, recursive?\` | List files (defaults: current directory, non-recursive) |
765
+ | \`read_file\` | \`path\` | Read UTF-8 text |
766
+ | \`write_file\` | \`path, content\` | Write the entire file; create parent directories |
767
+ | \`search_project\` | \`query, extension?\` | Case-insensitive substring search |
768
+ | \`list_ai_providers\` | \`—\` | Read the provider catalog |
769
+ | \`list_ai_models\` | \`provider?\` | Read the local model catalog |
770
+ | \`configure_ai_provider\` | \`provider, model?\` | Save .gitpagedocs-mcp.json |
771
+ | \`ask_ai\` | \`prompt, provider?, model?, system?\` | Return one response, without conversation history |
772
+ | \`generate_documentation\` | \`path, provider?\` | Document one source file |
773
+ | \`generate_api_docs\` | \`path, provider?\` | Describe the API in one file |
774
+ | \`generate_database_docs\` | \`path, provider?\` | Describe data models in one file |
775
+ | \`analyze_source_code\` | \`path, provider?\` | Analyze one source file |
776
+ | \`generate_readme\` | \`provider?\` | Use the tree and package.json |
777
+ | \`generate_architecture_docs\` | \`provider?\` | Use the repository tree |
778
+ | \`analyze_repository\` | \`provider?\` | Analyze the repository tree |
779
+ | \`analyze_project\` | \`provider?\` | Analyze the tree and package.json |
780
+ | \`generate_changelog\` | \`provider?\` | Use up to 80 commits, falling back to the tree |
781
+ | \`generate_release_notes\` | \`provider?\` | Use the same context as the changelog |
782
+ | \`validate_docs\` | \`provider?\` | Ask the provider to review gathered Markdown |
783
+ | \`update_documentation\` | \`path, instructions?, provider?\` | Generate and write a managed region |
784
+
785
+ \`generate_*\`, \`analyze_*\`, \`ask_ai\` and \`validate_docs\` return text; they do not save it automatically. \`validate_docs\` is a provider review, not a deterministic link checker. Only \`write_file\`, \`configure_ai_provider\` and \`update_documentation\` write files. \`update_documentation\` preserves text outside \`<!-- gitpagedocs:start -->\` / \`<!-- gitpagedocs:end -->\`; it appends a region when a valid pair is absent. The server does not show its own confirmation prompt; configure permissions in the MCP client.
786
+
787
+ ## Resource reference
788
+
789
+ | URI | Content |
790
+ | --- | --- |
791
+ | \`project://structure\` | Repository tree |
792
+ | \`project://docs\` | Collected Markdown documents |
793
+ | \`project://config\` | Resolved configuration and sourcePath |
794
+ | \`project://repository\` | package.json content |
795
+ | \`project://readme\` | README.md |
796
+ | \`project://ai/providers\` | Provider catalog |
797
+ | \`project://ai/models\` | Model catalog by provider |
798
+
799
+ ## Example workflow
800
+
801
+ 1. Read \`project://structure\` and \`project://readme\`.
802
+ 2. Call \`list_ai_providers\` and \`list_ai_models\` to select a provider/model.
803
+ 3. Call \`generate_api_docs\` with \`{"path":"src/index.ts"}\` to review the returned draft.
804
+ 4. Save approved text with \`write_file\`, or use \`update_documentation\` with \`{"path":"docs/api.md","instructions":"Document the public API in English."}\` for a managed region.
805
+
806
+ The generation step sends selected project content to the configured provider.
807
+
808
+ ## Limits and troubleshooting
809
+
810
+ - File reads: up to 512,000 bytes. Listing: up to 2,000 entries; gathered project trees: 400 entries.
811
+ - Search: up to 5,000 entries, 200 matches, 240 characters per matching line.
812
+ - Documentation gathering: first 40 Markdown files among up to 2,000 entries; files over 40,000 bytes are skipped. Provider context is capped at 24,000 characters.
813
+ - Listing skips build/dependency directories such as \`node_modules\`, \`.git\`, \`.next\`, \`out\`, \`dist\`, \`prebuilt\`, \`.turbo\` and \`coverage\`. It does not interpret \`.gitignore\`; files such as \`.env\` are not automatically excluded. Run only in a trusted project and select the content to expose.
814
+ - Path checks use lexical containment; do not treat the process as an operating-system sandbox or assume symlink/junction isolation. Loading \`project://config\` can import JavaScript/TypeScript configuration.
815
+ - Tool failures include \`isError: true\`. Missing resources return \`Unavailable: ...\`. Check the client's stderr log for startup errors; stdout is reserved for JSON-RPC.
816
+ - If tools work but generation fails, verify provider selection, environment credentials, model availability and service connectivity.
817
+ `,
818
+ cli: `# CLI reference
819
+
820
+ ## CLI commands
821
+
822
+ | Command | Description |
823
+ |---------|--------------|
824
+ | \`gitpagedocs\` | Generate config and docs in \`gitpagedocs/\` |
825
+ | \`gitpagedocs --layoutconfig\` | Also generate local layouts/templates in \`gitpagelayouts/\` |
826
+ | \`gitpagedocs --home\` | Standalone distribution (\`gitpagedocshome/\`) |
827
+ | \`gitpagedocs --push --owner X --repo Y\` | Setup workflow, commit, push |
828
+ | \`gitpagedocs --interactive\` / \`-i\` | Interactive mode with prompts (the default in a terminal) |
829
+ | \`gitpagedocs --no-interactive\` / \`--yes\` / \`-y\` | Never prompt; use flags and defaults |
830
+ | \`gitpagedocs ai\` | Interactive AI documentation generator |
831
+ | \`gitpagedocs chat [question]\` | Streaming AI chat in the terminal (REPL on a TTY; one-shot with a question or piped stdin) |
832
+ | \`gitpagedocs provider [id]\` / \`models [provider]\` | List AI providers / catalog models |
833
+ | \`gitpagedocs document[:repo\\|:file\\|:folder]\` | Generate documentation with AI |
834
+ | \`gitpagedocs deploy\` / \`pages [actions\\|deploy]\` | Configure GitHub Pages via Actions + push |
835
+ | \`gitpagedocs docs\` | Refresh README/CONTRIBUTING/SECURITY managed regions |
836
+ | \`gitpagedocs password\` | Set a documentation access password (public key in \`site.docsAccess\`) |
837
+ | \`gitpagedocs config\` / \`config clear\` | Show the resolved config / delete the stored config and key vault |
838
+ | \`gitpagedocs doctor\` / \`version\` / \`update\` | Diagnostics / version / registry update check |
839
+ | \`gitpagedocs mcp start\` | Start the MCP server over stdio |
840
+
841
+ Install globally with \`npm install -g @gitpagedocs/cli\`, or run one-off with \`npx @gitpagedocs/cli\`.
842
+
843
+ ## CLI options
844
+
845
+ | Option | Description |
846
+ |--------|-------------|
847
+ | \`--owner <user>\` | GitHub owner |
848
+ | \`--repo <repo>\` | GitHub repository |
849
+ | \`--path <subpath>\` | Docs subpath (e.g. \`docs\`); without it, base path = repo name for correct CSS/JS on project sites |
850
+ | \`--output <dir>\` | Output directory (default: \`gitpagedocs\`) |
851
+ | \`--search <true-or-false>\` | Enable/disable repository search (\`--home\`) |
852
+ | \`--layoutconfig\` | Generate local layouts in \`gitpagelayouts/\` |
853
+ | \`--layouts-dir <dir>\` | Folder for local layouts (default: \`gitpagelayouts\`) |
854
+ | \`--push\` | Create workflow, commit artifacts, push |
855
+ | \`--pages-actions\` | Only switch GitHub Pages to GitHub Actions (same as \`pages actions\`) |
856
+ | \`--home\` | Generate \`gitpagedocshome/\` (static + .env + Dockerfile) |
857
+
858
+ ## Generated output
859
+
860
+ - \`gitpagedocs/config.json\` – root config
861
+ - \`gitpagedocs/icon.svg\` – default icon
862
+ - \`gitpagedocs/docs/versions/<ver>/config.json\` – per-version routes
863
+ - \`gitpagedocs/docs/versions/<ver>/{en,pt,es}/*.md\` – markdown docs
864
+ - \`gitpagelayouts/\` – only with \`--layoutconfig\` (folder configurable with \`--layouts-dir\`)
865
+
866
+ ## Examples and command boundaries
867
+
868
+ \`\`\`bash
869
+ npx gitpagedocs --no-interactive --owner octocat --repo handbook
870
+ npx gitpagedocs --layoutconfig --layouts-dir assets/layouts --no-interactive
871
+ npx gitpagedocs chat "Explain this project" --provider ollama --model llama3
872
+ npx gitpagedocs pages deploy --owner octocat --repo handbook --path docs
873
+ npx gitpagedocs mcp start
874
+ \`\`\`
875
+
876
+ - \`init\` is an alias of generation. \`providers\` aliases \`provider\`; \`--version\` and \`-v\` alias \`version\`.
877
+ - \`document\`, \`document:repo\`, \`document:file\`, \`document:folder\` and \`--ai\` select the interactive documentation workflow. Select directories in its prompts; these aliases do not implement a separate positional file/folder API.
878
+ - \`chat\` accepts \`--provider <id>\`, \`--model <id>\` and \`--system <prompt>\`. With a question or piped stdin it answers once; an interactive terminal without a question starts a conversation.
879
+ - \`--build\`, \`--serve\` and \`--full\` are compatibility flags: the ordinary scaffold remains config-only and they do not start a local server.
880
+ - \`--home\` builds \`frontend/\` from a runtime checkout and writes the static export plus supporting files. Its output directory is recreated when it is not \`.\`; keep your source documentation outside that destination. Installing the CLI alone does not supply \`frontend/\`.
881
+ - \`pages actions\` only configures the Pages source; \`pages deploy\` and \`--push\` generate, commit and push. A printed URL does not mean the remote build has finished: check GitHub Actions.
882
+ - \`update\` checks npm and prints an installation command; it does not silently upgrade the CLI.
883
+
884
+ ## Configuration and credentials
885
+
886
+ Site display settings are in \`gitpagedocs/config.json\`. The interactive generator/chat stores \`.gitpagedocsconfig\` and its encrypted \`.gitpagedocsvault\` in the per-user OS configuration directory: \`%APPDATA%/gitpagedocs\` on Windows, \`~/Library/Application Support/gitpagedocs\` on macOS, and the XDG config location on Linux. \`config clear\` removes those saved settings and the vault. MCP uses its own project-local \`.gitpagedocs-mcp.json\` plus process environment; see the MCP page.
887
+
888
+ \`gitpagedocs docs\` updates only marker-bounded regions of README.md, CONTRIBUTING.md and SECURITY.md, preserving surrounding prose. \`password\` configures the documentation access key pair; client-side presentation controls do not make public repository files confidential.
889
+ `,
890
+ navigation: `# Navigation and nested menus
891
+
892
+ Routes define page content; menus define how readers reach it. Configure them in \`gitpagedocs/docs/versions/<version>/config.json\`. Site-wide presentation options belong to \`gitpagedocs/config.json\`.
893
+
894
+ \`\`\`json
895
+ {
896
+ "site": {
897
+ "nestedMenusEnabled": true,
898
+ "RouteGuide": true
899
+ }
900
+ }
901
+ \`\`\`
902
+
903
+ ## Build a menu tree
904
+
905
+ 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.
906
+
907
+ Groups without \`path-click\` organize children. For a Markdown destination, use its actual localized path from \`routes-md[].path\`. The \`page:<id>\` alias is registered by source-viewer, video, audio and PDF routes; do not use it for a Markdown-only page. The example below uses version \`0.0.8\`: replace that segment with the version you are editing and create the three chapter files.
908
+
909
+ \`\`\`json
910
+ {
911
+ "routeDefaults": {
912
+ "RouteGuide": false
913
+ },
914
+ "routes-md": [
915
+ {
916
+ "id": 101,
917
+ "RouteGuide": true,
918
+ "path": {
919
+ "pt": "gitpagedocs/docs/versions/0.0.8/pt/chapter.md",
920
+ "en": "gitpagedocs/docs/versions/0.0.8/en/chapter.md",
921
+ "es": "gitpagedocs/docs/versions/0.0.8/es/chapter.md"
922
+ }
923
+ }
924
+ ],
925
+ "menus-header-md": [
926
+ {
927
+ "id": 900,
928
+ "pt": {
929
+ "title": "Guia"
930
+ },
931
+ "en": {
932
+ "title": "Guide"
933
+ },
934
+ "es": {
935
+ "title": "Guía"
936
+ },
937
+ "submenus": [
938
+ {
939
+ "id": 901,
940
+ "pt": {
941
+ "title": "Capítulos"
942
+ },
943
+ "en": {
944
+ "title": "Chapters"
945
+ },
946
+ "es": {
947
+ "title": "Capítulos"
948
+ },
949
+ "submenus": [
950
+ {
951
+ "id": 101,
952
+ "pt": {
953
+ "title": "Primeiro capítulo",
954
+ "path-click": "gitpagedocs/docs/versions/0.0.8/pt/chapter.md"
955
+ },
956
+ "en": {
957
+ "title": "First chapter",
958
+ "path-click": "gitpagedocs/docs/versions/0.0.8/en/chapter.md"
959
+ },
960
+ "es": {
961
+ "title": "Primer capítulo",
962
+ "path-click": "gitpagedocs/docs/versions/0.0.8/es/chapter.md"
963
+ }
964
+ }
965
+ ]
966
+ }
967
+ ]
968
+ }
969
+ ]
970
+ }
971
+ \`\`\`
972
+
973
+ ## Nesting behavior
974
+
975
+ \`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.
976
+
977
+ 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.
978
+
979
+ ## Breadcrumbs: RouteGuide
980
+
981
+ \`RouteGuide\` controls the breadcrumb trail. Resolution order is the page's \`routes-md[].RouteGuide\`, then the version's \`routeDefaults.RouteGuide\`, then \`site.RouteGuide\`, with \`true\` as the fallback. The example disables breadcrumbs for the version and enables them for chapter 101. Existing version \`0.0.8\` files can use the same fields.
982
+
983
+ \`RouteguideBrand\` and \`RouteguideBrandPosition\` are separate settings for the document's heading outline/table of contents; they do not control breadcrumbs.
984
+
985
+ ## URLs and previous/next
986
+
987
+ 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.
988
+
989
+ Footer previous/next buttons use \`site.icons.DocumentPrevious\` (\`FiChevronLeft\`) and \`site.icons.DocumentNext\` (\`FiChevronRight\`) 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.
990
+
991
+ 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.
992
+ `,
993
+ focusMode: `# Focus mode
994
+
995
+ Focus mode opens the current Markdown document in a reading dialog. Enable it with \`site.FocusMode\`; the control is available only for a real Markdown page. \`site.icons.FocusMode\` changes its icon/text appearance and does not enable or disable the feature.
996
+
997
+ ## Configure the controls
998
+
999
+ Merge this fragment into \`gitpagedocs/config.json\`:
1000
+
1001
+ \`\`\`json
1002
+ {
1003
+ "site": {
1004
+ "FocusMode": true,
1005
+ "focusMode": {
1006
+ "copyEnabled": true,
1007
+ "downloadEnabled": true,
1008
+ "sectionNavigationEnabled": true,
1009
+ "documentNavigationEnabled": true
1010
+ }
1011
+ }
1012
+ }
1013
+ \`\`\`
1014
+
1015
+ 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.
1016
+
1017
+ ## Sections and documents
1018
+
1019
+ - Section navigation has four buttons: first section, previous section, next section and last section of the current document.
1020
+ - Document navigation has four buttons: first document, previous document, next document and last document in menu order, including nested menus.
1021
+ - \`sectionNavigationEnabled\` controls the four section buttons; \`documentNavigationEnabled\` controls the four document buttons. Unavailable directions are disabled at the ends.
1022
+ - Documents without a translation in the active language, non-Markdown destinations and inaccessible pages are skipped.
1023
+ - Switching documents keeps the dialog open and starts at the first section. Section/document counters show the current position.
1024
+ - \`site.ActiveNavigation\` controls the quick-navigation interface; it does not disable focus-mode document navigation.
1025
+
1026
+ ## Copy and download
1027
+
1028
+ 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.
1029
+
1030
+ 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.
1031
+
1032
+ ## Keyboard and reading
1033
+
1034
+ The dialog has an accessible name, keyboard focus management and a close control. Use Tab to move through controls and Escape to close it. Keep icon-only controls accessible by retaining their translated names. Closing the dialog returns to the documentation view.
1035
+
1036
+ Narration is configured separately in Accessibility. Changing the active document or language cancels the previous narration so it cannot continue reading stale content.
1037
+ `,
1038
+ accessibility: `# Accessibility and narration
1039
+
1040
+ The accessibility controls include native browser narration for the current Markdown document. Narration uses the Web Speech API (\`speechSynthesis\`); it does not require an API key or an external GitPageDocs speech service.
1041
+
1042
+ ## Configuration
1043
+
1044
+ Merge the following settings into \`gitpagedocs/config.json\`:
1045
+
1046
+ \`\`\`json
1047
+ {
1048
+ "site": {
1049
+ "accessibility": {
1050
+ "enabled": true,
1051
+ "narration": {
1052
+ "enabled": true,
1053
+ "defaultRate": 1,
1054
+ "defaultVolume": 1
1055
+ }
1056
+ },
1057
+ "mediaExclusivePlayback": true
1058
+ }
1059
+ }
1060
+ \`\`\`
1061
+
1062
+ - \`site.accessibility.enabled\`: enable the accessibility interface.
1063
+ - \`site.accessibility.narration.enabled\`: enable document narration.
1064
+ - \`defaultRate\`: initial speed from \`0.5\` to \`2\`, in steps of \`0.25\`; the default is \`1\`.
1065
+ - \`defaultVolume\`: initial volume from \`0\` (silent) to \`1\` (full), in steps of \`0.1\`; the default is \`1\`.
1066
+ - All enable switches default to \`true\`; omitted settings use the shipped defaults.
1067
+
1068
+ ## Read a document aloud
1069
+
1070
+ 1. Open a Markdown page and the accessibility/narration controls.
1071
+ 2. Choose a voice and language from those exposed by your browser; adjust speed and volume.
1072
+ 3. Start reading. Pause temporarily, resume from the paused speech or stop the session.
1073
+ 4. To change reading settings predictably, stop, change the controls and start again.
1074
+
1075
+ Narration starts only after your action; there is no autoplay. Automatic voice selection follows the document language, while an explicit voice choice uses that voice's language. Narration does not translate the document.
1076
+
1077
+ The speech content is readable text extracted from the rendered Markdown. Scripts, styles, SVG content and elements marked hidden for assistive technology are excluded. Long documents are read completely in successive blocks. Changing the document or language, disabling narration or leaving the page cancels the previous speech.
1078
+
1079
+ The normal view and focus mode share voice, speed and volume preferences while the page remains mounted. These preferences are not stored across reloads. Non-numeric speed or volume settings use \`1\`; numeric settings outside the supported ranges are clamped to their nearest limit.
1080
+
1081
+ ## One audio source at a time
1082
+
1083
+ With \`site.mediaExclusivePlayback: true\` (default), starting or resuming narration pauses the radio, audio tracks and route videos. Starting those media stops narration. A muted video remains outside this sound rule. Use \`false\` only when simultaneous playback is intentional.
1084
+
1085
+ The setting is shared with existing media playback; there is no second narration-exclusivity flag. The page remains readable when narration is disabled.
1086
+
1087
+ ## Browser and voice availability
1088
+
1089
+ Speech support and voices depend on the browser, operating system and installed or remotely supplied voices. Voice lists can arrive after the page loads. A browser may expose a different set of languages than another device.
1090
+
1091
+ Unavailable speech support and playback errors are reported in the interface. Confirm that a usable voice exists, system audio is enabled and the page has received a user interaction. An empty voice list is not evidence that the document failed to load.
1092
+
1093
+ Do not assume every voice works offline: browser voices can be local or remote. This feature speaks text; it does not record microphone input. Browser narration complements keyboard navigation and screen readers; it does not replace them.
1094
+
1095
+ See the [Web Speech API reference](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis) for browser-level behavior.
539
1096
  `,
540
1097
  faq: `# FAQ
541
1098
 
@@ -566,5 +1123,25 @@ Check:
566
1123
  ## Why can GitHub Pages behave differently from local?
567
1124
 
568
1125
  Because GitHub Pages build mode enables repository-search home and static-export specific behavior.
1126
+
1127
+ ## Why does an icon still show text?
1128
+
1129
+ 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.
1130
+
1131
+ ## Why do menu children or breadcrumbs differ?
1132
+
1133
+ \`nestedMenusEnabled: false\` intentionally flattens destinations. Check \`submenus\`, language objects and \`path-click\`, then confirm that referenced pages exist and are accessible. Breadcrumbs use \`RouteGuide\` with route > version > site priority. \`RouteguideBrand\` controls the heading outline instead.
1134
+
1135
+ ## Why is narration silent or interrupted?
1136
+
1137
+ Check browser support, available voice, language, volume and system output. Voices can load asynchronously or require a remote service. With \`mediaExclusivePlayback: true\`, another audio/video source stops narration by design. Switching documents cancels the old speech. See Accessibility for setup.
1138
+
1139
+ ## Why does the MCP command wait or a tool fail?
1140
+
1141
+ \`mcp start\` waits for an MCP client over stdio; it is not a terminal chat prompt. Confirm the process cwd and use the published CLI entry or \`mcp/src/bin.ts\`. Filesystem/catalog tools need no provider, but generation requires credentials in the MCP process environment. The CLI vault and \`.env\` are not loaded automatically; inspect \`isError\` and the client's stderr log.
1142
+
1143
+ ## Why did regeneration change my pages?
1144
+
1145
+ Scaffolding writes generated routes, configs and documentation again. Review changes in Git and keep project-specific content in your chosen source files. In this repository, edit \`cli/content/docs-{en,pt,es}.mjs\` and route metadata before regeneration; do not edit generated copies as the only source.
569
1146
  `,
570
1147
  };