@gitpagedocs/cli 0.0.8 → 0.0.9

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,3 +1,3 @@
1
- export const PACKAGE_VERSION = "0.0.8";
1
+ export const PACKAGE_VERSION = "0.0.9";
2
2
 
3
3
  export const DOC_VERSIONS = [PACKAGE_VERSION];
@@ -1,4 +1,5 @@
1
1
  export { DOC_VERSIONS } from "./doc-versions.mjs";
2
+ export { PDF_GUIDE_FILENAME } from "../data/path-mappings.mjs";
2
3
  export {
3
4
  DEFAULT_LAYOUTS_DIR,
4
5
  LAYOUTS_CONFIG_FILENAME,
@@ -14,7 +14,45 @@ export function getDefaultSiteConfig(projectLink, languageToggles = buildLanguag
14
14
  ThemeDefault: "aurora-dark",
15
15
  ThemeModeDefault: "dark",
16
16
  ActiveNavigation: true,
17
+ IconQuickNavigationReactIcones: false,
18
+ IconQuickNavigationReactIconesTag: "FiSearch",
19
+ IconQuickNavigationReactIconesTagColorDark: "currentColor",
20
+ IconQuickNavigationReactIconesTagColorLight: "currentColor",
21
+ IconQuickNavigationReactIconesTagSize: "22px",
17
22
  FocusMode: true,
23
+ focusMode: {
24
+ copyEnabled: true,
25
+ downloadEnabled: true,
26
+ sectionNavigationEnabled: true,
27
+ documentNavigationEnabled: true,
28
+ },
29
+ nestedMenusEnabled: true,
30
+ pdf: {
31
+ enabled: true,
32
+ previewEnabled: true,
33
+ downloadEnabled: true,
34
+ openInNewTabEnabled: true,
35
+ },
36
+ RouteGuide: true,
37
+ accessibility: {
38
+ enabled: true,
39
+ narration: { enabled: true, defaultRate: 1, defaultVolume: 1 },
40
+ },
41
+ IconLanguageSelectorReactIcones: false,
42
+ IconLanguageSelectorReactIconesTag: "FiGlobe",
43
+ IconLanguageSelectorReactIconesTagColorDark: "currentColor",
44
+ IconLanguageSelectorReactIconesTagColorLight: "currentColor",
45
+ IconLanguageSelectorReactIconesTagSize: "22px",
46
+ IconThemeSelectorReactIcones: false,
47
+ IconThemeSelectorReactIconesTag: "BsSunFill",
48
+ IconThemeSelectorReactIconesTagColorDark: "currentColor",
49
+ IconThemeSelectorReactIconesTagColorLight: "currentColor",
50
+ IconThemeSelectorReactIconesTagSize: "22px",
51
+ IconFocusModeReactIcones: false,
52
+ IconFocusModeReactIconesTag: "MdFullscreen",
53
+ IconFocusModeReactIconesTagColorDark: "currentColor",
54
+ IconFocusModeReactIconesTagColorLight: "currentColor",
55
+ IconFocusModeReactIconesTagSize: "22px",
18
56
  FooterEnabled: true,
19
57
  FooterLinkName: "GitPageDocs",
20
58
  FooterLinkUrl: projectLink,
@@ -1,5 +1,11 @@
1
1
  export const defaultLangMenu = {
2
2
  pt: {
3
+ titleHeaderMenuPdf: "PDF",
4
+ PdfDownload: "Baixar PDF",
5
+ PdfOpenInNewTab: "Abrir PDF em nova aba",
6
+ PdfUnavailable: "A prévia do PDF depende do navegador. Use as ações disponíveis para abrir ou baixar o documento.",
7
+ PdfDownloadError: "Não foi possível baixar o PDF. Tente abrir o documento em uma nova aba.",
8
+ PdfDownloading: "Baixando PDF...",
3
9
  pt: "Portugues",
4
10
  en: "Ingles",
5
11
  es: "Espanhol",
@@ -19,6 +25,27 @@ export const defaultLangMenu = {
19
25
  typeToNavigate: "Digite para navegar...",
20
26
  noNavigationResults: "Nenhum resultado de navegacao.",
21
27
  focusMode: "Modo foco",
28
+ focusSectionsLabel: "Seções",
29
+ focusDocumentsLabel: "Documentos",
30
+ focusPreviousSectionLabel: "Seção anterior",
31
+ focusNextSectionLabel: "Próxima seção",
32
+ focusPreviousDocumentLabel: "Documento anterior",
33
+ focusNextDocumentLabel: "Próximo documento",
34
+ narrationTitle: "Acessibilidade e leitura",
35
+ narrationStart: "Ler documento",
36
+ narrationPause: "Pausar leitura",
37
+ narrationResume: "Retomar leitura",
38
+ narrationStop: "Parar leitura",
39
+ narrationVoice: "Voz do navegador",
40
+ narrationAutomaticVoice: "Automática pelo idioma do documento",
41
+ narrationRate: "Velocidade",
42
+ narrationVolume: "Volume",
43
+ narrationUnsupported: "Este navegador não oferece narração de texto.",
44
+ narrationError: "Não foi possível narrar. Escolha outra voz ou tente novamente.",
45
+ narrationReady: "Pronto para ler",
46
+ narrationSpeaking: "Lendo documento",
47
+ narrationPaused: "Leitura pausada",
48
+ narrationSettingsHint: "As vozes são fornecidas pelo navegador. Pare a leitura para alterar as preferências.",
22
49
  versionLinksLabel: "Links do repositorio",
23
50
  titleHeaderMenuMd: "Markdown",
24
51
  titleHeaderMenuSourceViewer: "Codigo fonte",
@@ -137,6 +164,12 @@ export const defaultLangMenu = {
137
164
  docsAccessBlockCancelBtn: "Cancelar",
138
165
  },
139
166
  en: {
167
+ titleHeaderMenuPdf: "PDF",
168
+ PdfDownload: "Download PDF",
169
+ PdfOpenInNewTab: "Open PDF in a new tab",
170
+ PdfUnavailable: "PDF preview depends on your browser. Use the available actions to open or download the document.",
171
+ PdfDownloadError: "The PDF could not be downloaded. Try opening the document in a new tab.",
172
+ PdfDownloading: "Downloading PDF...",
140
173
  pt: "Portuguese",
141
174
  en: "English",
142
175
  es: "Spanish",
@@ -156,6 +189,27 @@ export const defaultLangMenu = {
156
189
  typeToNavigate: "Type to navigate...",
157
190
  noNavigationResults: "No navigation results.",
158
191
  focusMode: "Focus mode",
192
+ focusSectionsLabel: "Sections",
193
+ focusDocumentsLabel: "Documents",
194
+ focusPreviousSectionLabel: "Previous section",
195
+ focusNextSectionLabel: "Next section",
196
+ focusPreviousDocumentLabel: "Previous document",
197
+ focusNextDocumentLabel: "Next document",
198
+ narrationTitle: "Accessibility and reading",
199
+ narrationStart: "Read document",
200
+ narrationPause: "Pause reading",
201
+ narrationResume: "Resume reading",
202
+ narrationStop: "Stop reading",
203
+ narrationVoice: "Browser voice",
204
+ narrationAutomaticVoice: "Automatic for the document language",
205
+ narrationRate: "Speed",
206
+ narrationVolume: "Volume",
207
+ narrationUnsupported: "This browser does not support text narration.",
208
+ narrationError: "Could not read aloud. Choose another voice or try again.",
209
+ narrationReady: "Ready to read",
210
+ narrationSpeaking: "Reading document",
211
+ narrationPaused: "Reading paused",
212
+ narrationSettingsHint: "Voices are supplied by your browser. Stop reading to change preferences.",
159
213
  versionLinksLabel: "Repository links",
160
214
  titleHeaderMenuMd: "Markdown",
161
215
  titleHeaderMenuSourceViewer: "Source code",
@@ -274,6 +328,12 @@ export const defaultLangMenu = {
274
328
  docsAccessBlockCancelBtn: "Cancel",
275
329
  },
276
330
  es: {
331
+ titleHeaderMenuPdf: "PDF",
332
+ PdfDownload: "Descargar PDF",
333
+ PdfOpenInNewTab: "Abrir PDF en una pestaña nueva",
334
+ PdfUnavailable: "La vista previa del PDF depende del navegador. Usa las acciones disponibles para abrir o descargar el documento.",
335
+ PdfDownloadError: "No se pudo descargar el PDF. Intenta abrir el documento en una pestaña nueva.",
336
+ PdfDownloading: "Descargando PDF...",
277
337
  pt: "Portugues",
278
338
  en: "Ingles",
279
339
  es: "Espanol",
@@ -293,6 +353,27 @@ export const defaultLangMenu = {
293
353
  typeToNavigate: "Escribe para navegar...",
294
354
  noNavigationResults: "Sin resultados de navegacion.",
295
355
  focusMode: "Modo foco",
356
+ focusSectionsLabel: "Secciones",
357
+ focusDocumentsLabel: "Documentos",
358
+ focusPreviousSectionLabel: "Sección anterior",
359
+ focusNextSectionLabel: "Siguiente sección",
360
+ focusPreviousDocumentLabel: "Documento anterior",
361
+ focusNextDocumentLabel: "Siguiente documento",
362
+ narrationTitle: "Accesibilidad y lectura",
363
+ narrationStart: "Leer documento",
364
+ narrationPause: "Pausar lectura",
365
+ narrationResume: "Reanudar lectura",
366
+ narrationStop: "Detener lectura",
367
+ narrationVoice: "Voz del navegador",
368
+ narrationAutomaticVoice: "Automática según el idioma del documento",
369
+ narrationRate: "Velocidad",
370
+ narrationVolume: "Volumen",
371
+ narrationUnsupported: "Este navegador no admite narración de texto.",
372
+ narrationError: "No se pudo leer. Elige otra voz o inténtalo de nuevo.",
373
+ narrationReady: "Listo para leer",
374
+ narrationSpeaking: "Leyendo documento",
375
+ narrationPaused: "Lectura pausada",
376
+ narrationSettingsHint: "El navegador proporciona las voces. Detén la lectura para cambiar las preferencias.",
296
377
  versionLinksLabel: "Enlaces del repositorio",
297
378
  titleHeaderMenuMd: "Markdown",
298
379
  titleHeaderMenuSourceViewer: "Codigo fuente",
@@ -1,5 +1,7 @@
1
1
  /** Path and media mappings for doc versions */
2
2
 
3
+ export const PDF_GUIDE_FILENAME = "gitpagedocs-project-guide.pdf";
4
+
3
5
  export const ROUTE_PATHS = {
4
6
  1: { pt: "getting-started.md", en: "getting-started.md", es: "getting-started.md" },
5
7
  2: { pt: "project-overview.md", en: "project-overview.md", es: "project-overview.md" },
@@ -7,6 +9,17 @@ export const ROUTE_PATHS = {
7
9
  4: { pt: "github-issues-projects.md", en: "github-issues-projects.md", es: "github-issues-projects.md" },
8
10
  5: { pt: "git-introduction.md", en: "git-introduction.md", es: "git-introduction.md" },
9
11
  6: { pt: "authorized-routes.md", en: "authorized-routes.md", es: "authorized-routes.md" },
12
+ 13: { pt: "configuration.md", en: "configuration.md", es: "configuration.md" },
13
+ 14: { pt: "deployment.md", en: "deployment.md", es: "deployment.md" },
14
+ 15: { pt: "architecture.md", en: "architecture.md", es: "architecture.md" },
15
+ 16: { pt: "themes.md", en: "themes.md", es: "themes.md" },
16
+ 17: { pt: "faq.md", en: "faq.md", es: "faq.md" },
17
+ 18: { pt: "cli.md", en: "cli.md", es: "cli.md" },
18
+ 19: { pt: "mcp.md", en: "mcp.md", es: "mcp.md" },
19
+ 20: { pt: "navigation.md", en: "navigation.md", es: "navigation.md" },
20
+ 21: { pt: "accessibility.md", en: "accessibility.md", es: "accessibility.md" },
21
+ 22: { pt: "focus-mode.md", en: "focus-mode.md", es: "focus-mode.md" },
22
+ 24: { pt: "pdf.md", en: "pdf.md", es: "pdf.md" },
10
23
  };
11
24
 
12
25
  export const VIDEO_IDS = ["bdIJkGr2NV0", "c67GaAkf1BE", "N3my6W_Rdwg", "r8jQ9hVA2qs"];
@@ -1,8 +1,8 @@
1
1
  /** Route and video metadata for doc versions */
2
2
 
3
- export const DEFAULT_HIERARCHY = { md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 };
3
+ export const DEFAULT_HIERARCHY = { md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4, pdf: 5 };
4
4
  /** Page order that puts the video container above the markdown. */
5
- export const VIDEO_FIRST_HIERARCHY = { video: 0, md: 1, "source-viewer": 2, html: 3, audio: 4 };
5
+ export const VIDEO_FIRST_HIERARCHY = { video: 0, md: 1, "source-viewer": 2, html: 3, audio: 4, pdf: 5 };
6
6
 
7
7
  export const ROUTE_META_ID1 = {
8
8
  titles: { pt: "Primeiros passos", en: "Getting Started", es: "Primeros pasos" },
@@ -38,6 +38,53 @@ export const ROUTE_META_ID6 = {
38
38
  },
39
39
  };
40
40
 
41
+ export const REFERENCE_ROUTE_METAS = {
42
+ 13: {
43
+ titles: { pt: "Configuração", en: "Configuration", es: "Configuración" },
44
+ descriptions: { pt: "Idiomas, ícones, navegação, foco e acessibilidade", en: "Languages, icons, navigation, focus and accessibility", es: "Idiomas, iconos, navegación, foco y accesibilidad" },
45
+ },
46
+ 14: {
47
+ titles: { pt: "Publicação", en: "Deployment", es: "Publicación" },
48
+ descriptions: { pt: "Execução local e publicação no GitHub Pages", en: "Local runtime and GitHub Pages deployment", es: "Ejecución local y publicación en GitHub Pages" },
49
+ },
50
+ 15: {
51
+ titles: { pt: "Arquitetura", en: "Architecture", es: "Arquitectura" },
52
+ descriptions: { pt: "Pacotes, contratos e fluxo de dados", en: "Packages, contracts and data flow", es: "Paquetes, contratos y flujo de datos" },
53
+ },
54
+ 16: {
55
+ titles: { pt: "Temas e layouts", en: "Themes and layouts", es: "Temas y diseños" },
56
+ descriptions: { pt: "Personalize templates e tokens visuais", en: "Customize templates and visual tokens", es: "Personaliza plantillas y tokens visuales" },
57
+ },
58
+ 17: {
59
+ titles: { pt: "Perguntas frequentes", en: "FAQ", es: "Preguntas frecuentes" },
60
+ descriptions: { pt: "Diagnóstico e solução de problemas", en: "Diagnostics and troubleshooting", es: "Diagnóstico y solución de problemas" },
61
+ },
62
+ 18: {
63
+ titles: { pt: "Referência da CLI", en: "CLI reference", es: "Referencia de la CLI" },
64
+ descriptions: { pt: "Instalação, comandos, opções e exemplos", en: "Installation, commands, options and examples", es: "Instalación, comandos, opciones y ejemplos" },
65
+ },
66
+ 19: {
67
+ titles: { pt: "Servidor MCP", en: "MCP server", es: "Servidor MCP" },
68
+ descriptions: { pt: "Instalação, clientes, tools, resources e provedores", en: "Installation, clients, tools, resources and providers", es: "Instalación, clientes, tools, resources y proveedores" },
69
+ },
70
+ 20: {
71
+ titles: { pt: "Navegação e submenus", en: "Navigation and nested menus", es: "Navegación y submenús" },
72
+ descriptions: { pt: "Árvores recursivas, URLs e breadcrumbs", en: "Recursive trees, URLs and breadcrumbs", es: "Árboles recursivos, URLs y breadcrumbs" },
73
+ },
74
+ 21: {
75
+ titles: { pt: "Acessibilidade e narração", en: "Accessibility and narration", es: "Accesibilidad y narración" },
76
+ descriptions: { pt: "Leitura com vozes nativas do navegador", en: "Reading with native browser voices", es: "Lectura con voces nativas del navegador" },
77
+ },
78
+ 22: {
79
+ titles: { pt: "Modo foco", en: "Focus mode", es: "Modo foco" },
80
+ descriptions: { pt: "Leitura, cópia, download e navegação entre documentos", en: "Reading, copy, download and document navigation", es: "Lectura, copia, descarga y navegación entre documentos" },
81
+ },
82
+ 24: {
83
+ titles: { pt: "Documentos PDF", en: "PDF documents", es: "Documentos PDF" },
84
+ descriptions: { pt: "Rotas, prévia, download e publicação de anexos PDF", en: "Routes, previews, downloads and publishing PDF attachments", es: "Rutas, vista previa, descarga y publicación de anexos PDF" },
85
+ },
86
+ };
87
+
41
88
  export const SOURCE_VIEWER_META = {
42
89
  id: 7,
43
90
  titles: { pt: "Codigo fonte", en: "Source code", es: "Codigo fuente" },
@@ -58,6 +105,16 @@ export const AUDIO_META_ID12 = {
58
105
  },
59
106
  };
60
107
 
108
+ export const PDF_GUIDE_META = {
109
+ id: 23,
110
+ titles: { pt: "Guia do projeto em PDF (inglês)", en: "Project guide PDF (English)", es: "Guía del proyecto en PDF (inglés)" },
111
+ descriptions: {
112
+ pt: "Visualize ou baixe o guia do GitPageDocs em inglês.",
113
+ en: "Preview or download the GitPageDocs project guide in English.",
114
+ es: "Visualiza o descarga la guía de GitPageDocs en inglés.",
115
+ },
116
+ };
117
+
61
118
  export const VIDEO_META_ID1 = {
62
119
  title: { pt: "Interactive vs non-interactive modes | Copilot CLI for beginners", en: "Interactive vs non-interactive modes | Copilot CLI for beginners", es: "Interactive vs non-interactive modes | Copilot CLI for beginners" },
63
120
  description: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitpagedocs/cli",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "CLI that scaffolds and maintains gitpagedocs documentation, generates docs with AI, configures GitHub Pages, and runs the MCP server.",
5
5
  "bin": {
6
6
  "gitpagedocs": "index.mjs"
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@clack/prompts": "^1.5.1",
32
- "@gitpagedocs/mcp": "^0.0.8",
33
- "@gitpagedocs/tools": "^0.0.8",
32
+ "@gitpagedocs/mcp": "^0.0.9",
33
+ "@gitpagedocs/tools": "^0.0.9",
34
34
  "tsx": "^4.21.0"
35
35
  },
36
36
  "repository": {
@@ -1,19 +1,28 @@
1
1
  /** Map doc paths to content keys and apply version badges */
2
2
 
3
+ const DOC_FILE_KEYS = new Map([
4
+ ["index.md", "index"],
5
+ ["getting-started.md", "gettingStarted"],
6
+ ["configuration.md", "configuration"],
7
+ ["deployment.md", "deployment"],
8
+ ["architecture.md", "architecture"],
9
+ ["themes.md", "themes"],
10
+ ["faq.md", "faq"],
11
+ ["project-overview.md", "projectOverview"],
12
+ ["functionalities.md", "functionalities"],
13
+ ["github-issues-projects.md", "githubIssuesProjects"],
14
+ ["git-introduction.md", "gitIntroduction"],
15
+ ["authorized-routes.md", "authorizedRoutes"],
16
+ ["cli.md", "cli"],
17
+ ["mcp.md", "mcp"],
18
+ ["navigation.md", "navigation"],
19
+ ["accessibility.md", "accessibility"],
20
+ ["focus-mode.md", "focusMode"],
21
+ ["pdf.md", "pdf"],
22
+ ]);
23
+
3
24
  export function parseDocFileToKey(fileName) {
4
- if (fileName === "index.md") return "index";
5
- if (fileName === "getting-started.md") return "gettingStarted";
6
- if (fileName === "configuration.md") return "configuration";
7
- if (fileName === "deployment.md") return "deployment";
8
- if (fileName === "architecture.md") return "architecture";
9
- if (fileName === "themes.md") return "themes";
10
- if (fileName === "faq.md") return "faq";
11
- if (fileName === "project-overview.md") return "projectOverview";
12
- if (fileName === "functionalities.md") return "functionalities";
13
- if (fileName === "github-issues-projects.md") return "githubIssuesProjects";
14
- if (fileName === "git-introduction.md") return "gitIntroduction";
15
- if (fileName === "authorized-routes.md") return "authorizedRoutes";
16
- return undefined;
25
+ return DOC_FILE_KEYS.get(fileName);
17
26
  }
18
27
 
19
28
  export function parseHtmlFileToKey(fileName) {
@@ -1,5 +1,5 @@
1
1
  import { existsSync } from "node:fs";
2
- import { mkdir, writeFile } from "node:fs/promises";
2
+ import { copyFile, mkdir, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import {
5
5
  parseDocFileToKey,
@@ -11,6 +11,7 @@ import {
11
11
  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
+ import { PDF_GUIDE_FILENAME } from "../data/path-mappings.mjs";
14
15
  import { compactSiteIcons, factorRouteDefaults } from "@gitpagedocs/tools/config-format";
15
16
 
16
17
  const DEFAULT_ICON_SVG = `<?xml version="1.0" encoding="utf-8"?>
@@ -160,4 +161,18 @@ export async function writeConfigOnlyOutput(options) {
160
161
 
161
162
 
162
163
  await writeVersionedDocs(root, outputDir, artifacts);
164
+ await writePdfArtifacts(options);
165
+ }
166
+
167
+ async function writePdfArtifacts({ root, pkgRoot, outputDir, artifacts }) {
168
+ const source = path.join(pkgRoot, "content", "assets", PDF_GUIDE_FILENAME);
169
+ for (const [versionId, versionConfig] of Object.entries(artifacts.versionConfigs)) {
170
+ const bundledPath = `gitpagedocs/docs/versions/${versionId}/en/${PDF_GUIDE_FILENAME}`;
171
+ const routes = versionConfig["routes-pdf"] ?? [];
172
+ const usesBundledGuide = routes.some((route) => Object.values(route.pdf?.pathPdf ?? {}).includes(bundledPath));
173
+ if (!usesBundledGuide) continue;
174
+ const destination = path.join(root, normalizeToOutputPath(outputDir, bundledPath));
175
+ await mkdir(path.dirname(destination), { recursive: true });
176
+ await copyFile(source, destination);
177
+ }
163
178
  }