@gitpagedocs/tools 0.0.9 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitpagedocs/tools",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "description": "Shared business-logic core for Git Page Docs (consumed by frontend, cli and mcp). Ships TypeScript source; consume via tsx or a TS-aware bundler.",
6
6
  "main": "./src/index.ts",
@@ -40,7 +40,7 @@ export class GitPageDocsConfigLoader implements ConfigLoader {
40
40
  private async parse<TConfig>(resolvedPath: string, ext: ConfigExtension): Promise<TConfig> {
41
41
  if (ext === ".json") {
42
42
  const text = await readFile(resolvedPath, "utf8");
43
- return JSON.parse(text) as TConfig;
43
+ return JSON.parse(text.trimStart()) as TConfig;
44
44
  }
45
45
  if (ext === ".js" || ext === ".ts") {
46
46
  const mod = (await import(pathToFileURL(resolvedPath).href)) as Record<string, unknown>;
@@ -38,12 +38,18 @@ export function cliCommandsSection(commands: readonly CommandDoc[]): string {
38
38
  "",
39
39
  "### User references",
40
40
  "",
41
- "The generated versioned documentation includes dedicated pages for configuration, CLI, MCP, recursive navigation, focus mode, accessibility/narration, PDF documents, deployment, architecture, themes and troubleshooting. Each page is available in English, Portuguese and Spanish; Markdown filenames stay in English across languages.",
41
+ "The generated documentation includes 23 Markdown pages per language: focused references plus complete configuration recipes, migration/compatibility, troubleshooting, contributing/testing and HTML-container guides. All pages are available in English, Portuguese and Spanish; Markdown filenames stay in English while titles and content preserve UTF-8 accents and special characters.",
42
42
  "",
43
- "Configure language, theme, focus and Ctrl+K control icons through `gitpagedocs/config.json` → `site.icons`. Set `reactIcon` independently on `LanguageSelector`, `ThemeSelector`, `FocusMode` and `QuickNavigation`; `false` keeps the text controls. Customize `tag`, `size`, `colorDark` and `colorLight` per entry.",
43
+ "The scaffold has real nested sections: Guides → Configure your site / Read and explore / Automate and integrate → documents, plus Operations and development and Git/GitHub groups. Getting Started and Project overview remain the first destinations. Recursive `submenus` can extend the hierarchy without a fixed depth limit; `site.nestedMenusEnabled: false` keeps every destination in a flat presentation.",
44
+ "",
45
+ "Configure controls through `gitpagedocs/config.json` → `site.icons`. `LanguageSelector`, `ThemeSelector`, `FocusMode`, `QuickNavigation`, `PdfDownload`, `PdfOpenInNewTab`, `DocumentPrevious` and `DocumentNext` use icons by default. Set `reactIcon: false` independently to display text; `true` displays the icon. Customize `tag`, `size`, `colorDark` and `colorLight` per entry. Compact configs inherit omitted values from `icons.defaults`, so an omitted per-control `reactIcon` does not mean text mode. The Ctrl+K shortcut and accessible control names remain available.",
44
46
  "",
45
47
  "`site.nestedMenusEnabled` selects recursive or flat navigation. Breadcrumbs use `RouteGuide` with route > version defaults > site precedence. `site.FocusMode` enables reading mode; `site.focusMode` controls copy, download, section navigation and document navigation independently.",
46
48
  "",
49
+ "Focus mode provides eight navigation buttons: first, previous, next and last document, plus first, previous, next and last section. Each navigation flag controls its group of four; document changes keep the reader open and restart at the first section.",
50
+ "",
51
+ "Document-footer controls use `DocumentPrevious` (`FiChevronLeft`) and `DocumentNext` (`FiChevronRight`); either can use its translated text with `reactIcon: false`. The footer appears for multiple available menu destinations and disables unavailable directions. `site.ActiveNavigation` controls quick navigation and Ctrl+K separately.",
52
+ "",
47
53
  "`site.accessibility.narration` configures native browser reading. Voices and offline availability depend on the browser and operating system. `site.mediaExclusivePlayback` coordinates narration, radio, audio and video so only one audible source plays by default.",
48
54
  "",
49
55
  "See [the MCP reference](mcp/README.md) for installation, client configuration, all 20 tools, all 7 resources, provider variables and limits. Start with `gitpagedocs mcp start` from the target project; on a source checkout the direct entry is `node --import tsx mcp/src/bin.ts`.",
@@ -55,10 +61,40 @@ export function cliCommandsSection(commands: readonly CommandDoc[]): string {
55
61
  "Configure `site.pdf` with `enabled`, `previewEnabled`, `downloadEnabled` and `openInNewTabEnabled` (all default to `true`). The version config uses `routes-pdf`, `pdf.pathPdf` per language and `menus-header-pdf` with `page:23` for the bundled example. Route-level preview/download/new-tab options go inside `pdf`; `hierarchyPage.pdf` and `hierarchyMenu.pdf` order the content and menu sections.",
56
62
  "",
57
63
  "```json",
58
- '{ "id": 23, "pdf": { "pathPdf": { "en": "gitpagedocs/docs/versions/0.0.9/en/gitpagedocs-project-guide.pdf", "pt": "gitpagedocs/docs/versions/0.0.9/en/gitpagedocs-project-guide.pdf", "es": "gitpagedocs/docs/versions/0.0.9/en/gitpagedocs-project-guide.pdf" }, "previewEnabled": true, "downloadEnabled": true, "openInNewTabEnabled": true } }',
64
+ '{ "id": 23, "pdf": { "pathPdf": { "en": "gitpagedocs/docs/versions/0.0.10/en/gitpagedocs-project-guide.pdf", "pt": "gitpagedocs/docs/versions/0.0.10/en/gitpagedocs-project-guide.pdf", "es": "gitpagedocs/docs/versions/0.0.10/en/gitpagedocs-project-guide.pdf" }, "previewEnabled": true, "downloadEnabled": true, "openInNewTabEnabled": true } }',
65
+ "```",
66
+ "",
67
+ "The native browser viewer handles PDF previews and new tabs through validated `application/pdf` Blob URLs. Preview, download and new-tab actions all require CORS permission for external files. Opening a new tab does not navigate to the raw repository URL, so that server's Content-Type/Content-Disposition does not force a download. Browser PDF support and user preferences still apply. With preview disabled, the first download or new-tab action loads the PDF; cached bytes are reused. File/network errors and blocked pop-ups are reported without silently falling back to the raw URL.",
68
+ "",
69
+ "PDF action icons are independent: `site.icons.PdfDownload` defaults to `FiDownload`, and `site.icons.PdfOpenInNewTab` defaults to `FiExternalLink`. For example, `\"PdfDownload\": { \"reactIcon\": false }` shows download text while the new-tab control remains an icon. The `site.pdf` and route `pdf` action flags control availability separately from appearance.",
70
+ "",
71
+ "Next.js dev/build stages repository PDFs from `gitpagedocs/` into public assets and respects the Pages subpath; other local files must be in `frontend/public/`. See the generated PDF documents page for complete site, route, menu and icon examples.",
72
+ "",
73
+ "### HTML containers and the DOOM example",
74
+ "",
75
+ "The scaffold includes a local HTML demonstration with a title, description and an explicit load button for the externally hosted DOOM player. Game assets are not bundled. The wrapper is generated as `docs/versions/<version>/{en,pt,es}/doom.html`; the HTML containers guide explains sizing, external URLs and browser restrictions.",
76
+ "",
77
+ "Keep both `routes-html` and `menus-header-html` in the version configuration. Menu paths must match the localized HTML paths; local HTML does not use a `page:29` alias. Merge this example with existing arrays:",
78
+ "",
79
+ "```json",
80
+ "{",
81
+ ' "routes-html": [{',
82
+ ' "id": 29,',
83
+ ' "title": { "en": "DOOM: HTML example", "pt": "DOOM: exemplo HTML", "es": "DOOM: ejemplo HTML" },',
84
+ ' "description": { "en": "Load an interactive HTML demo", "pt": "Carregue uma demonstração HTML interativa", "es": "Carga una demostración HTML interactiva" },',
85
+ ' "titleIsVisible": true, "descriptionIsVisible": true, "container": "full",',
86
+ ' "path": { "en": "gitpagedocs/docs/versions/0.0.10/en/doom.html", "pt": "gitpagedocs/docs/versions/0.0.10/pt/doom.html", "es": "gitpagedocs/docs/versions/0.0.10/es/doom.html" }',
87
+ " }],",
88
+ ' "menus-header-html": [{',
89
+ ' "id": 29,',
90
+ ' "en": { "title": "DOOM: HTML example", "path-click": "gitpagedocs/docs/versions/0.0.10/en/doom.html" },',
91
+ ' "pt": { "title": "DOOM: exemplo HTML", "path-click": "gitpagedocs/docs/versions/0.0.10/pt/doom.html" },',
92
+ ' "es": { "title": "DOOM: ejemplo HTML", "path-click": "gitpagedocs/docs/versions/0.0.10/es/doom.html" }',
93
+ " }]",
94
+ "}",
59
95
  "```",
60
96
  "",
61
- "The native browser viewer handles PDF previews through temporary Blob URLs after the file signature is validated. Both preview and download require CORS permission when the file comes from another origin. The new-tab link opens the original URL directly, where browser support and the server's Content-Type/Content-Disposition can cause a download instead of inline display. Next.js dev/build stages repository PDFs from `gitpagedocs/` into public assets and respects the Pages subpath; other local files must be in `frontend/public/`. See the generated PDF documents page for complete site, route and menu examples.",
97
+ "Select the HTML menu entry and press its load button, then use the player's controls. Internet access and a compatible browser are required. The direct provider link remains available if embedding fails. Only publish trusted HTML: the existing iframe permits scripts and same-origin content. Test keyboard access, mobile layout and the actual deployed Pages URL; external availability and framing policies remain controlled by the provider.",
62
98
  ].join("\n");
63
99
  }
64
100