@gitpagedocs/cli 1.1.54 → 1.1.56

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,151 +1,186 @@
1
- /** Build version config (routes, menus) for each doc version */
2
-
3
- import {
4
- ROUTE_PATHS,
5
- VIDEO_IDS,
6
- PAGE2_AUDIO,
7
- SOURCE_VIEWER_META,
8
- } from "../data/path-mappings.mjs";
9
- import {
10
- ROUTE_META_ID1,
11
- ROUTE_META_ID2,
12
- ROUTE_META_ID3,
13
- ROUTE_META_ID4,
14
- ROUTE_META_ID5,
15
- ROUTE_META_ID6,
16
- VIDEO_META_ID1,
17
- VIDEO_META_ID2,
18
- VIDEO_META_ID3,
19
- VIDEO_META_ID4,
20
- DEFAULT_HIERARCHY,
21
- } from "../data/route-metas.mjs";
22
- import { buildMdRoute, buildHtmlRoute, buildVideoRoute } from "./route-builders.mjs";
23
-
24
- const ROUTE_METAS = {
25
- 1: ROUTE_META_ID1,
26
- 2: ROUTE_META_ID2,
27
- 3: ROUTE_META_ID3,
28
- 4: ROUTE_META_ID4,
29
- 5: ROUTE_META_ID5,
30
- 6: ROUTE_META_ID6,
31
- };
32
- const VIDEO_METAS = { 1: VIDEO_META_ID1, 2: VIDEO_META_ID2, 3: VIDEO_META_ID3, 4: VIDEO_META_ID4 };
33
-
34
- function buildVersionMdRoutes(versionId) {
35
- const base = `gitpagedocs/docs/versions/${versionId}`;
36
- return [1, 2, 3, 4, 5, 6].map((id) => {
37
- const paths = ROUTE_PATHS[id];
38
- const meta = ROUTE_METAS[id];
39
- const pathByLang = {
40
- pt: `${base}/pt/${paths.pt}`,
41
- en: `${base}/en/${paths.en}`,
42
- es: `${base}/es/${paths.es}`,
43
- };
44
- const routeOptions = {
45
- ...(id === 2 ? { audio: PAGE2_AUDIO } : {}),
46
- ...(id === 3 ? { authorization: { requiredRoles: ["maintainer"] } } : {}),
47
- ...(id === 6
48
- ? {
49
- authorization: {
50
- accessKeyId: "docs-key",
51
- requiredRoles: ["maintainer"],
52
- requireExternalAuth: true,
53
- allowedProviders: ["authjs", "clerk", "firebase", "jwt"],
54
- },
55
- }
56
- : {}),
57
- };
58
- return buildMdRoute(versionId, id, pathByLang, meta.titles, meta.descriptions, routeOptions);
59
- });
60
- }
61
-
62
- function buildVersionHtmlRoutes(versionId) {
63
- const base = `gitpagedocs/docs/versions/${versionId}`;
64
- const pathByLangSource = {
65
- pt: `${base}/pt/source-viewer`,
66
- en: `${base}/en/source-viewer`,
67
- es: `${base}/es/source-viewer`,
68
- };
69
- return [
70
- buildHtmlRoute(versionId, 1, pathByLangSource, SOURCE_VIEWER_META.titles, SOURCE_VIEWER_META.descriptions, {
71
- container: "full",
72
- blockLink: true,
73
- authorization: { accessKeyId: "source-viewer-key" },
74
- }),
75
- ];
76
- }
77
-
78
- function buildVersionVideoRoutes(versionId) {
79
- return [1, 2, 3, 4].map((id) =>
80
- buildVideoRoute(
81
- versionId,
82
- id,
83
- "youtube",
84
- VIDEO_IDS[id - 1],
85
- VIDEO_METAS[id].title,
86
- VIDEO_METAS[id].description,
87
- {
88
- authorization: {
89
- requireExternalAuth: true,
90
- allowedProviders: ["authjs", "clerk", "firebase", "jwt"],
91
- },
92
- },
93
- )
94
- );
95
- }
96
-
97
- function buildVersionMenus(versionId) {
98
- const base = `gitpagedocs/docs/versions/${versionId}`;
99
- const menuMd = [1, 2, 3, 4, 5, 6].map((id) => ({
100
- id: id,
101
- pt: { title: ROUTE_METAS[id].titles.pt, "path-click": `${base}/pt/${ROUTE_PATHS[id].pt}` },
102
- en: { title: ROUTE_METAS[id].titles.en, "path-click": `${base}/en/${ROUTE_PATHS[id].en}` },
103
- es: { title: ROUTE_METAS[id].titles.es, "path-click": `${base}/es/${ROUTE_PATHS[id].es}` },
104
- }));
105
- const menuHtml = [
106
- {
107
- id: 1,
108
- pt: { title: "Código fonte", "path-click": `${base}/pt/source-viewer` },
109
- en: { title: "Source code", "path-click": `${base}/en/source-viewer` },
110
- es: { title: "Código fuente", "path-click": `${base}/es/source-viewer` },
111
- },
112
- ];
113
- const menuVideo = [1, 2, 3, 4].map((id) => ({
114
- id: id,
115
- pt: { title: VIDEO_METAS[id].title.pt.slice(0, 40) + "...", "path-click": `page:${id}` },
116
- en: { title: VIDEO_METAS[id].title.en.slice(0, 40) + "...", "path-click": `page:${id}` },
117
- es: { title: VIDEO_METAS[id].title.es.slice(0, 40) + "...", "path-click": `page:${id}` },
118
- }));
119
- return { md: menuMd, html: menuHtml, video: menuVideo };
120
- }
121
-
122
- /**
123
- * Build version config for a single doc version.
124
- * @param {string} versionId - e.g. "1.0.0", "1.1.0", "1.1.1"
125
- * @returns {object} Version config with routes-md, routes-html, routes-video, menus, hierarchy
126
- */
127
- export function buildVersionConfig(versionId) {
128
- return {
129
- auth: {
130
- accessKeys: {
131
- "docs-key": "open-gitpagedocs-docs",
132
- "source-viewer-key": "open-source-viewer",
133
- },
134
- rolesStorageKey: "git-page-docs:route-auth:roles",
135
- providers: [
136
- { type: "authjs", enabled: true, sessionEndpoint: "/api/auth/session", rolesClaimPath: "user.roles" },
137
- { type: "clerk", enabled: true, rolesClaimPath: "claims.publicMetadata.roles" },
138
- { type: "firebase", enabled: true, tokenStorageKey: "git-page-docs:firebase-token", rolesClaimPath: "roles" },
139
- { type: "jwt", enabled: true, tokenStorageKey: "git-page-docs:jwt-token", rolesClaimPath: "roles" },
140
- ],
141
- },
142
- "routes-md": buildVersionMdRoutes(versionId),
143
- "routes-html": buildVersionHtmlRoutes(versionId),
144
- "routes-video": buildVersionVideoRoutes(versionId),
145
- "menus-header-md": buildVersionMenus(versionId).md,
146
- "menus-header-html": buildVersionMenus(versionId).html,
147
- "menus-header-video": buildVersionMenus(versionId).video,
148
- hierarchyPage: DEFAULT_HIERARCHY,
149
- hierarchyMenu: DEFAULT_HIERARCHY,
150
- };
151
- }
1
+ /** Build version config (routes, menus) for each doc version */
2
+
3
+ import {
4
+ ROUTE_PATHS,
5
+ VIDEO_IDS,
6
+ AUDIO_IDS,
7
+ PAGE2_AUDIO,
8
+ } from "../data/path-mappings.mjs";
9
+ import {
10
+ ROUTE_META_ID1,
11
+ ROUTE_META_ID2,
12
+ ROUTE_META_ID3,
13
+ ROUTE_META_ID4,
14
+ ROUTE_META_ID5,
15
+ ROUTE_META_ID6,
16
+ VIDEO_META_ID1,
17
+ VIDEO_META_ID2,
18
+ VIDEO_META_ID3,
19
+ VIDEO_META_ID4,
20
+ AUDIO_META_ID12,
21
+ SOURCE_VIEWER_META,
22
+ DEFAULT_HIERARCHY,
23
+ } from "../data/route-metas.mjs";
24
+ import { buildAudioRoute, buildMdRoute, buildSourceViewerRoute, buildVideoRoute } from "./route-builders.mjs";
25
+ import { resolveSourceViewerPath } from "./project-links.mjs";
26
+
27
+ /** Demo route protections showcasing the "Authorized Routes" feature. They are
28
+ * applied only to the official (non-parameterized) scaffold — user sites
29
+ * generated with --owner/--repo stay public, since visitors of those sites
30
+ * have no discoverable unlock recipe. */
31
+ const EXTERNAL_AUTH_PROVIDERS = ["authjs", "clerk", "firebase", "jwt"];
32
+ const DOCS_ACCESS_KEY_ID = "docs-key";
33
+ const MAINTAINER_ROLE = "maintainer";
34
+ const VIDEO_ROUTE_AUTHORIZATION = {
35
+ requireExternalAuth: true,
36
+ allowedProviders: EXTERNAL_AUTH_PROVIDERS,
37
+ };
38
+
39
+ const ROUTE_METAS = {
40
+ 1: ROUTE_META_ID1,
41
+ 2: ROUTE_META_ID2,
42
+ 3: ROUTE_META_ID3,
43
+ 4: ROUTE_META_ID4,
44
+ 5: ROUTE_META_ID5,
45
+ 6: ROUTE_META_ID6,
46
+ };
47
+ const VIDEO_METAS = { 1: VIDEO_META_ID1, 2: VIDEO_META_ID2, 3: VIDEO_META_ID3, 4: VIDEO_META_ID4 };
48
+
49
+ function buildVersionMdRoutes(versionId, includeDemoAuthorization) {
50
+ const base = `gitpagedocs/docs/versions/${versionId}`;
51
+ return [1, 2, 3, 4, 5, 6].map((id) => {
52
+ const paths = ROUTE_PATHS[id];
53
+ const meta = ROUTE_METAS[id];
54
+ const pathByLang = {
55
+ pt: `${base}/pt/${paths.pt}`,
56
+ en: `${base}/en/${paths.en}`,
57
+ es: `${base}/es/${paths.es}`,
58
+ };
59
+ const routeOptions = {
60
+ ...(id === 2 ? { audio: PAGE2_AUDIO } : {}),
61
+ ...(includeDemoAuthorization && id === 3
62
+ ? { authorization: { requiredRoles: [MAINTAINER_ROLE] } }
63
+ : {}),
64
+ ...(includeDemoAuthorization && id === 6
65
+ ? {
66
+ authorization: {
67
+ accessKeyId: DOCS_ACCESS_KEY_ID,
68
+ requiredRoles: [MAINTAINER_ROLE],
69
+ requireExternalAuth: true,
70
+ allowedProviders: EXTERNAL_AUTH_PROVIDERS,
71
+ },
72
+ }
73
+ : {}),
74
+ };
75
+ return buildMdRoute(versionId, id, pathByLang, meta.titles, meta.descriptions, routeOptions);
76
+ });
77
+ }
78
+
79
+ function buildVersionVideoRoutes(versionId, includeDemoAuthorization) {
80
+ return [1, 2, 3, 4].map((id) =>
81
+ buildVideoRoute(
82
+ versionId,
83
+ id + 7,
84
+ "youtube",
85
+ VIDEO_IDS[id - 1],
86
+ VIDEO_METAS[id].title,
87
+ VIDEO_METAS[id].description,
88
+ includeDemoAuthorization ? { authorization: VIDEO_ROUTE_AUTHORIZATION } : {},
89
+ )
90
+ );
91
+ }
92
+
93
+ function buildVersionAudioRoutes(versionId) {
94
+ return [
95
+ buildAudioRoute(
96
+ versionId,
97
+ AUDIO_META_ID12.id,
98
+ "youtube",
99
+ AUDIO_IDS[0],
100
+ AUDIO_META_ID12.title,
101
+ AUDIO_META_ID12.description,
102
+ ),
103
+ ];
104
+ }
105
+
106
+ function buildVersionSourceViewerRoutes(options = {}) {
107
+ return [
108
+ buildSourceViewerRoute(
109
+ SOURCE_VIEWER_META.id,
110
+ resolveSourceViewerPath(options.githubOwner, options.githubRepo),
111
+ SOURCE_VIEWER_META.titles,
112
+ SOURCE_VIEWER_META.descriptions,
113
+ ),
114
+ ];
115
+ }
116
+
117
+ function buildVersionMenus(versionId) {
118
+ const base = `gitpagedocs/docs/versions/${versionId}`;
119
+ const menuMd = [1, 2, 3, 4, 5, 6].map((id) => ({
120
+ id,
121
+ pt: { title: ROUTE_METAS[id].titles.pt, "path-click": `${base}/pt/${ROUTE_PATHS[id].pt}` },
122
+ en: { title: ROUTE_METAS[id].titles.en, "path-click": `${base}/en/${ROUTE_PATHS[id].en}` },
123
+ es: { title: ROUTE_METAS[id].titles.es, "path-click": `${base}/es/${ROUTE_PATHS[id].es}` },
124
+ }));
125
+ const menuVideo = [1, 2, 3, 4].map((id) => ({
126
+ id: id + 7,
127
+ pt: { title: `${VIDEO_METAS[id].title.pt.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
128
+ en: { title: `${VIDEO_METAS[id].title.en.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
129
+ es: { title: `${VIDEO_METAS[id].title.es.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
130
+ }));
131
+ const menuAudio = [
132
+ {
133
+ id: AUDIO_META_ID12.id,
134
+ pt: { title: AUDIO_META_ID12.title.pt, "path-click": `page:${AUDIO_META_ID12.id}` },
135
+ en: { title: AUDIO_META_ID12.title.en, "path-click": `page:${AUDIO_META_ID12.id}` },
136
+ es: { title: AUDIO_META_ID12.title.es, "path-click": `page:${AUDIO_META_ID12.id}` },
137
+ },
138
+ ];
139
+ const menuSourceViewer = [
140
+ {
141
+ id: SOURCE_VIEWER_META.id,
142
+ pt: { title: SOURCE_VIEWER_META.titles.pt, "path-click": `page:${SOURCE_VIEWER_META.id}` },
143
+ en: { title: SOURCE_VIEWER_META.titles.en, "path-click": `page:${SOURCE_VIEWER_META.id}` },
144
+ es: { title: SOURCE_VIEWER_META.titles.es, "path-click": `page:${SOURCE_VIEWER_META.id}` },
145
+ },
146
+ ];
147
+ return { md: menuMd, sourceViewer: menuSourceViewer, html: [], video: menuVideo, audio: menuAudio };
148
+ }
149
+
150
+ /**
151
+ * Build version config for a single doc version.
152
+ * @param {string} versionId - e.g. "1.1.54"
153
+ * @param {object} [options] - { githubOwner, githubRepo } for the source-viewer link
154
+ * @returns {object} Version config with routes, menus, and hierarchy
155
+ */
156
+ export function buildVersionConfig(versionId, options = {}) {
157
+ const includeDemoAuthorization = !options.githubOwner && !options.githubRepo;
158
+ const menus = buildVersionMenus(versionId);
159
+
160
+ return {
161
+ auth: {
162
+ accessKeys: {
163
+ "docs-key": "open-gitpagedocs-docs",
164
+ },
165
+ rolesStorageKey: "git-page-docs:route-auth:roles",
166
+ providers: [
167
+ { type: "authjs", enabled: true, sessionEndpoint: "/api/auth/session", rolesClaimPath: "user.roles" },
168
+ { type: "clerk", enabled: true, rolesClaimPath: "claims.publicMetadata.roles" },
169
+ { type: "firebase", enabled: true, tokenStorageKey: "git-page-docs:firebase-token", rolesClaimPath: "roles" },
170
+ { type: "jwt", enabled: true, tokenStorageKey: "git-page-docs:jwt-token", rolesClaimPath: "roles" },
171
+ ],
172
+ },
173
+ "routes-md": buildVersionMdRoutes(versionId, includeDemoAuthorization),
174
+ "routes-source-viewer": buildVersionSourceViewerRoutes(options),
175
+ "routes-html": [],
176
+ "routes-video": buildVersionVideoRoutes(versionId, includeDemoAuthorization),
177
+ "routes-audio": buildVersionAudioRoutes(versionId),
178
+ "menus-header-md": menus.md,
179
+ "menus-header-source-viewer": menus.sourceViewer,
180
+ "menus-header-html": menus.html,
181
+ "menus-header-video": menus.video,
182
+ "menus-header-audio": menus.audio,
183
+ hierarchyPage: DEFAULT_HIERARCHY,
184
+ hierarchyMenu: DEFAULT_HIERARCHY,
185
+ };
186
+ }
@@ -1,3 +1,5 @@
1
+ import { PACKAGE_VERSION } from "../contracts/doc-versions.mjs";
2
+
1
3
  export const docsEn = {
2
4
  index: `# Git Page Docs
3
5
 
@@ -144,7 +146,6 @@ Install globally with \`npm install -g gitpagedocs\`, or run one-off with \`npx
144
146
  - \`gitpagedocs/icon.svg\` – default icon
145
147
  - \`gitpagedocs/docs/versions/<ver>/config.json\` – per-version routes
146
148
  - \`gitpagedocs/docs/versions/<ver>/{en,pt,es}/*.md\` – markdown docs
147
- - \`gitpagedocs/docs/versions/<ver>/{en,pt,es}/source-viewer\` – GitHub-style source code viewer
148
149
  - \`gitpagedocs/layouts/\` – only with \`--layoutconfig\`
149
150
 
150
151
  ## Content types
@@ -152,20 +153,20 @@ Install globally with \`npm install -g gitpagedocs\`, or run one-off with \`npx
152
153
  | Type | Config key | Description |
153
154
  |------|------------|-------------|
154
155
  | Markdown | \`routes-md\` | .md files with \`path\` per language |
155
- | HTML | \`routes-html\` | \`path\` (e.g. source-viewer) or \`url\` for external |
156
+ | HTML | \`routes-html\` | local \`path\` or external \`url\` |
156
157
  | Video | \`routes-video\` | \`video.pathVideo\`, \`video.videoType\` |
157
158
  | Audio | \`routes-audio\` | \`audio.pathAudio\`, \`audio.audioType\` |
158
159
 
159
160
  ## Source code viewer
160
161
 
161
- The CLI generates a **Source code** page per version. It scans \`src/\`, \`cli/\`, and root files (README.md, package.json, next.config.ts, etc.) and builds a GitHub-style dark viewer with:
162
+ The version config can render a **Source code** container through \`routes-source-viewer\` and \`menus-header-source-viewer\`. The viewer reads GitHub repository trees at runtime and applies the current documentation theme.
162
163
 
163
- - File tree sidebar with folder collapse/expand
164
- - Search filter for files
165
- - Syntax highlighting (TypeScript, JavaScript, JSON, CSS, Markdown)
166
- - Copy button, line numbers
167
- - README.md preview/code toggle
168
- - Expand all / Collapse all controls
164
+ - Repository tree from \`source-viewer-path\`; branch defaults to \`main\`
165
+ - Folder navigation and file filtering
166
+ - GitHub-style directory listing
167
+ - Code rendering with line numbers
168
+ - Markdown preview/code toggle, including \`README.md\`
169
+ - Collapsible folders in the sidebar
169
170
 
170
171
  ## Config keys (site)
171
172
 
@@ -180,7 +181,7 @@ The CLI generates a **Source code** page per version. It scans \`src/\`, \`cli/\
180
181
 
181
182
  ## AI assistant
182
183
 
183
- The docs ship an AI assistant in two surfaces: an in-docs **chat drawer** (the ✨ button in the sidebar, enabled via \`site.AiChatEnabled\`) and a dedicated **\`/ai\` console** page.
184
+ The docs ship an AI assistant in two surfaces: an in-docs **chat drawer** (the AI chat button in the sidebar, enabled via \`site.AiChatEnabled\`) and a dedicated **\`/ai\` console** page.
184
185
 
185
186
  - **14 providers** via one shared core: OpenAI, Anthropic, Gemini, OpenRouter, Ollama, Azure OpenAI, Mistral, DeepSeek, Cohere, Groq, xAI, Together, Fireworks, Perplexity.
186
187
  - **Model selection** — pick from each provider's catalog (\`gitpagedocs models <provider>\`) or type a custom id.
@@ -296,9 +297,9 @@ Supported adapters:
296
297
  {
297
298
  "id": 6,
298
299
  "path": {
299
- "en": "gitpagedocs/docs/versions/1.1.1/en/authorized-routes.md",
300
- "pt": "gitpagedocs/docs/versions/1.1.1/pt/authorized-routes.md",
301
- "es": "gitpagedocs/docs/versions/1.1.1/es/authorized-routes.md"
300
+ "en": "gitpagedocs/docs/versions/${PACKAGE_VERSION}/en/authorized-routes.md",
301
+ "pt": "gitpagedocs/docs/versions/${PACKAGE_VERSION}/pt/authorized-routes.md",
302
+ "es": "gitpagedocs/docs/versions/${PACKAGE_VERSION}/es/authorized-routes.md"
302
303
  },
303
304
  "authorization": {
304
305
  "accessKeyId": "docs-key",
@@ -348,6 +349,7 @@ Behavior:
348
349
  - \`id\`
349
350
  - \`path\`
350
351
  - optional metadata links (\`ProjectLink\`, \`branch\`, \`release\`, \`commit\`)
352
+ - optional source viewer metadata (\`source-viewer\`, \`source-viewer-path\`)
351
353
 
352
354
  ## Navigation
353
355
 
@@ -367,13 +369,14 @@ Behavior:
367
369
  Version configs support multiple content types:
368
370
 
369
371
  - \`routes-md\`: Markdown routes with optional \`title\`, \`description\` (centered via \`titlePosition\`, \`descriptionPosition\`)
372
+ - \`routes-source-viewer\`: Source viewer containers with \`source-viewer: true\` and \`source-viewer-path\`
370
373
  - \`routes-html\`: HTML page paths per language
371
374
  - \`routes-video\`: Video config with \`video.videoType\` (youtube, vimeo, mp4, etc.) and \`video.pathVideo\`
372
375
  - \`routes-audio\`: Audio config with \`audio.audioType\` (youtube, mp3, etc.) and \`audio.pathAudio\`
373
376
  - \`authorization\` (md/html/video): route guard by access key, roles, and external auth
374
- - \`menus-header-md\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`: menus per type
375
- - \`hierarchyPage\`: container order on page \`{ md: 0, html: 1, video: 2, audio: 3 }\`
376
- - \`hierarchyMenu\`: menu section order \`{ md: 0, html: 1, video: 2, audio: 3 }\`
377
+ - \`menus-header-md\`, \`menus-header-source-viewer\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`: menus per type
378
+ - \`hierarchyPage\`: container order on page \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
379
+ - \`hierarchyMenu\`: menu section order \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
377
380
 
378
381
  Each route can include \`title\`, \`description\` (per language), \`titleCss\`, \`titlePosition: "center"\`, \`descriptionPosition: "center"\`, \`titleIsVisible\`, \`descriptionIsVisible\`.
379
382
 
@@ -389,7 +392,7 @@ Per-route options for \`routes-md\`, \`routes-html\`, \`routes-video\`, and \`ro
389
392
  ## Content types: path vs url (HTML)
390
393
 
391
394
  - **Markdown (\`routes-md\`)**: always uses \`path\` pointing to local \`.md\` files.
392
- - **HTML (\`routes-html\`)**: uses \`path\` for local HTML files (no \`.html\` extension in config, e.g. \`source-viewer\`) or \`url\` for external URLs. When \`url\` is set, the iframe loads the external page; no local file is generated. The CLI generates a **Source code** viewer (GitHub-style) per version.
395
+ - **HTML (\`routes-html\`)**: uses \`path\` for local HTML files (no \`.html\` extension in config) or \`url\` for external URLs. When \`url\` is set, the iframe loads the external page; no local file is generated.
393
396
  - **Video (\`routes-video\`)**: uses \`video.pathVideo\` and \`video.videoType\` (youtube, vimeo, mp4, etc.).
394
397
  - **Audio (\`routes-audio\`)**: uses \`audio.pathAudio\` and \`audio.audioType\` (youtube, mp3, etc.). No autoplay by default.
395
398
 
@@ -130,7 +130,6 @@ Referencia completa de opciones CLI, claves de configuracion y funciones del run
130
130
  - \`gitpagedocs/icon.svg\` – icono por defecto
131
131
  - \`gitpagedocs/docs/versions/<ver>/config.json\` – rutas por version
132
132
  - \`gitpagedocs/docs/versions/<ver>/{en,pt,es}/*.md\` – docs en markdown
133
- - \`gitpagedocs/docs/versions/<ver>/{en,pt,es}/source-viewer\` – visor de codigo (estilo GitHub)
134
133
  - \`gitpagedocs/layouts/\` – solo con \`--layoutconfig\`
135
134
 
136
135
  ## Tipos de contenido
@@ -138,20 +137,20 @@ Referencia completa de opciones CLI, claves de configuracion y funciones del run
138
137
  | Tipo | Clave config | Descripcion |
139
138
  |------|--------------|-------------|
140
139
  | Markdown | \`routes-md\` | Archivos .md con \`path\` por idioma |
141
- | HTML | \`routes-html\` | \`path\` (ej: source-viewer) o \`url\` externa |
140
+ | HTML | \`routes-html\` | \`path\` local o \`url\` externa |
142
141
  | Video | \`routes-video\` | \`video.pathVideo\`, \`video.videoType\` |
143
142
  | Audio | \`routes-audio\` | \`audio.pathAudio\`, \`audio.audioType\` |
144
143
 
145
144
  ## Visor de codigo fuente
146
145
 
147
- La CLI genera una pagina **Codigo fuente** por version. Escanea \`src/\`, \`cli/\` y archivos raiz (README.md, package.json, next.config.ts, etc.) y construye un visor estilo GitHub en modo oscuro con:
146
+ El config de version puede renderizar un contenedor **Codigo fuente** via \`routes-source-viewer\` y \`menus-header-source-viewer\`. El viewer lee el arbol del repositorio en GitHub en tiempo de ejecucion y aplica el tema actual de la documentacion.
148
147
 
149
- - Arbol de archivos en barra lateral con expandir/colapsar carpetas
150
- - Filtro de busqueda
151
- - Resaltado de sintaxis (TypeScript, JavaScript, JSON, CSS, Markdown)
152
- - Boton copiar, numeros de linea
153
- - Alternar vista previa/codigo del README.md
154
- - Controles Expandir todo / Colapsar todo
148
+ - Arbol del repositorio desde \`source-viewer-path\`; la branch por defecto es \`main\`
149
+ - Navegacion por carpetas y filtro de archivos
150
+ - Listado de directorios estilo GitHub
151
+ - Renderizado de codigo con numeros de linea
152
+ - Alternancia vista previa/codigo para Markdown, incluido \`README.md\`
153
+ - Carpetas colapsables en la barra lateral
155
154
 
156
155
  ## Claves de config (site)
157
156
 
@@ -202,6 +201,7 @@ Claves principales:
202
201
  - \`id\`: identificador de version
203
202
  - \`path\`: ruta de config de version
204
203
  - links opcionales (\`ProjectLink\`, \`branch\`, \`release\`, \`commit\`)
204
+ - metadatos opcionales del source viewer (\`source-viewer\`, \`source-viewer-path\`)
205
205
 
206
206
  ## Navegacion y rutas
207
207
 
@@ -221,13 +221,14 @@ Claves principales:
221
221
  Los configs de version soportan multiples tipos:
222
222
 
223
223
  - \`routes-md\`: Rutas markdown con \`title\`, \`description\` (centrados via \`titlePosition\`, \`descriptionPosition\`)
224
+ - \`routes-source-viewer\`: Contenedores de codigo fuente con \`source-viewer: true\` y \`source-viewer-path\`
224
225
  - \`routes-html\`: Rutas de paginas HTML por idioma
225
226
  - \`routes-video\`: Config de video con \`video.videoType\` (youtube, vimeo, mp4, etc.) y \`video.pathVideo\`
226
227
  - \`routes-audio\`: Config de audio con \`audio.audioType\` (youtube, mp3, etc.) y \`audio.pathAudio\`
227
228
  - \`authorization\` (md/html/video): guardia de acceso por clave, roles y autenticacion externa
228
- - \`menus-header-md\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`: menus por tipo
229
- - \`hierarchyPage\`: orden de contenedores en la pagina \`{ md: 0, html: 1, video: 2, audio: 3 }\`
230
- - \`hierarchyMenu\`: orden de secciones del menu \`{ md: 0, html: 1, video: 2, audio: 3 }\`
229
+ - \`menus-header-md\`, \`menus-header-source-viewer\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`: menus por tipo
230
+ - \`hierarchyPage\`: orden de contenedores en la pagina \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
231
+ - \`hierarchyMenu\`: orden de secciones del menu \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
231
232
 
232
233
  Cada ruta puede incluir \`title\`, \`description\` (por idioma), \`titleCss\`, \`titlePosition: "center"\`, \`descriptionPosition: "center"\`, \`titleIsVisible\`, \`descriptionIsVisible\`.
233
234
 
@@ -243,7 +244,7 @@ Opciones por ruta en \`routes-md\`, \`routes-html\` y \`routes-video\`:
243
244
  ## Tipos de contenido: path vs url (HTML)
244
245
 
245
246
  - **Markdown (\`routes-md\`)**: usa \`path\` apuntando a archivos \`.md\` locales.
246
- - **HTML (\`routes-html\`)**: usa \`path\` para archivos HTML locales (sin extension .html en config, ej: \`source-viewer\`) o \`url\` para URLs externas. Con \`url\`, el iframe carga la pagina externa; no se genera archivo local. La CLI genera un visor **Codigo fuente** (estilo GitHub) por version.
247
+ - **HTML (\`routes-html\`)**: usa \`path\` para archivos HTML locales (sin extension .html en config) o \`url\` para URLs externas. Con \`url\`, el iframe carga la pagina externa; no se genera archivo local.
247
248
  - **Video (\`routes-video\`)**: usa \`video.pathVideo\` y \`video.videoType\` (youtube, vimeo, mp4, etc.).
248
249
 
249
250
  ## Variables de entorno
@@ -130,7 +130,6 @@ Referencia completa de opcoes da CLI, chaves de configuracao e recursos do runti
130
130
  - \`gitpagedocs/icon.svg\` – icone padrao
131
131
  - \`gitpagedocs/docs/versions/<ver>/config.json\` – rotas por versao
132
132
  - \`gitpagedocs/docs/versions/<ver>/{en,pt,es}/*.md\` – docs em markdown
133
- - \`gitpagedocs/docs/versions/<ver>/{en,pt,es}/source-viewer\` – visualizador de codigo (estilo GitHub)
134
133
  - \`gitpagedocs/layouts/\` – apenas com \`--layoutconfig\`
135
134
 
136
135
  ## Tipos de conteudo
@@ -138,20 +137,20 @@ Referencia completa de opcoes da CLI, chaves de configuracao e recursos do runti
138
137
  | Tipo | Chave config | Descricao |
139
138
  |------|--------------|-----------|
140
139
  | Markdown | \`routes-md\` | Arquivos .md com \`path\` por idioma |
141
- | HTML | \`routes-html\` | \`path\` (ex: source-viewer) ou \`url\` externa |
140
+ | HTML | \`routes-html\` | \`path\` local ou \`url\` externa |
142
141
  | Video | \`routes-video\` | \`video.pathVideo\`, \`video.videoType\` |
143
142
  | Audio | \`routes-audio\` | \`audio.pathAudio\`, \`audio.audioType\` |
144
143
 
145
144
  ## Visualizador de codigo fonte
146
145
 
147
- A CLI gera uma pagina **Codigo fonte** por versao. Escaneia \`src/\`, \`cli/\` e arquivos raiz (README.md, package.json, next.config.ts, etc.) e constroi um visualizador estilo GitHub em modo escuro com:
146
+ O config da versao pode renderizar um container **Codigo fonte** via \`routes-source-viewer\` e \`menus-header-source-viewer\`. O viewer le a arvore do repositorio no GitHub em tempo de execucao e aplica o tema atual da documentacao.
148
147
 
149
- - Arvore de arquivos na lateral com expandir/recolher pastas
150
- - Filtro de busca
151
- - Destaque de sintaxe (TypeScript, JavaScript, JSON, CSS, Markdown)
152
- - Botao copiar, numeros de linha
153
- - Alternar preview/codigo do README.md
154
- - Controles Expandir tudo / Recolher tudo
148
+ - Arvore do repositorio a partir de \`source-viewer-path\`; a branch padrao e \`main\`
149
+ - Navegacao por pastas e filtro de arquivos
150
+ - Listagem de diretorios no estilo GitHub
151
+ - Renderizacao de codigo com numeros de linha
152
+ - Alternancia preview/codigo para Markdown, incluindo \`README.md\`
153
+ - Pastas recolhiveis na lateral
155
154
 
156
155
  ## Chaves de config (site)
157
156
 
@@ -202,6 +201,7 @@ Principais chaves:
202
201
  - \`id\`: identificador da versao
203
202
  - \`path\`: caminho do config da versao
204
203
  - links opcionais (\`ProjectLink\`, \`branch\`, \`release\`, \`commit\`)
204
+ - metadados opcionais do source viewer (\`source-viewer\`, \`source-viewer-path\`)
205
205
 
206
206
  ## Navegacao e rotas
207
207
 
@@ -221,13 +221,14 @@ Principais chaves:
221
221
  Configs de versao suportam multiplos tipos:
222
222
 
223
223
  - \`routes-md\`: Rotas markdown com \`title\`, \`description\` (centralizados via \`titlePosition\`, \`descriptionPosition\`)
224
+ - \`routes-source-viewer\`: Containers de codigo fonte com \`source-viewer: true\` e \`source-viewer-path\`
224
225
  - \`routes-html\`: Caminhos de paginas HTML por idioma
225
226
  - \`routes-video\`: Config de video com \`video.videoType\` (youtube, vimeo, mp4, etc.) e \`video.pathVideo\`
226
227
  - \`routes-audio\`: Config de audio com \`audio.audioType\` (youtube, mp3, etc.) e \`audio.pathAudio\`
227
228
  - \`authorization\` (md/html/video): guarda de acesso por chave, papeis e autenticacao externa
228
- - \`menus-header-md\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`: menus por tipo
229
- - \`hierarchyPage\`: ordem dos containers na pagina \`{ md: 0, html: 1, video: 2, audio: 3 }\`
230
- - \`hierarchyMenu\`: ordem das secoes do menu \`{ md: 0, html: 1, video: 2, audio: 3 }\`
229
+ - \`menus-header-md\`, \`menus-header-source-viewer\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`: menus por tipo
230
+ - \`hierarchyPage\`: ordem dos containers na pagina \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
231
+ - \`hierarchyMenu\`: ordem das secoes do menu \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
231
232
 
232
233
  Cada rota pode incluir \`title\`, \`description\` (por idioma), \`titleCss\`, \`titlePosition: "center"\`, \`descriptionPosition: "center"\`, \`titleIsVisible\`, \`descriptionIsVisible\`.
233
234
 
@@ -243,7 +244,7 @@ Opcoes por rota em \`routes-md\`, \`routes-html\` e \`routes-video\`:
243
244
  ## Tipos de conteudo: path vs url (HTML)
244
245
 
245
246
  - **Markdown (\`routes-md\`)**: usa \`path\` apontando para arquivos \`.md\` locais.
246
- - **HTML (\`routes-html\`)**: usa \`path\` para arquivos HTML locais (sem extensao .html no config, ex: \`source-viewer\`) ou \`url\` para URLs externas. Com \`url\`, o iframe carrega a pagina externa; nenhum arquivo local e gerado. A CLI gera um visualizador **Codigo fonte** (estilo GitHub) por versao.
247
+ - **HTML (\`routes-html\`)**: usa \`path\` para arquivos HTML locais (sem extensao .html no config) ou \`url\` para URLs externas. Com \`url\`, o iframe carrega a pagina externa; nenhum arquivo local e gerado.
247
248
  - **Video (\`routes-video\`)**: usa \`video.pathVideo\` e \`video.videoType\` (youtube, vimeo, mp4, etc.).
248
249
 
249
250
  ## Variaveis de ambiente
@@ -1 +1,3 @@
1
- export const DOC_VERSIONS = ["1.0.0", "1.1.0", "1.1.1"];
1
+ export const PACKAGE_VERSION = "1.1.56";
2
+
3
+ export const DOC_VERSIONS = [PACKAGE_VERSION];
File without changes