@gitpagedocs/cli 1.1.54 → 1.1.55

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/README.md CHANGED
@@ -38,36 +38,36 @@ The AI-CLI implementation lives in `cli/ai/` (relocated from the frontend so the
38
38
 
39
39
  ```
40
40
  cli/
41
- ├── index.mjs # Node entry (bootstraps TS presentation via tsx)
42
- ├── package.json # the published `gitpagedocs` package
43
- ├── ai/ # AI documentation CLI (provider/model/paths → markdown)
44
- ├── contracts/ # Stable contracts for external tooling
45
- │ └── doc-versions.mjs
46
- │
47
- ├── presentation/ # Interface/composition root
48
- │ ├── index.ts
49
- │ ├── options/
50
- │ └── ui/
51
- │
52
- ├── application/ # Use-cases and ports
53
- │ ├── config-only/handler.mjs
54
- │ ├── home/handler.mjs
55
- │ ├── report/config-only-reporter.mjs
56
- │ ├── use-cases/dispatch-mode.ts
57
- │ └── ports/cli-runtime-ports.ts
58
- │
59
- ├── domain/ # Business rules
60
- │ └── services/sanitize-segment.mjs
61
- │
62
- ├── infrastructure/ # Side effects and adapters
63
- │ ├── config-only/runtime.mjs
64
- │ └── home/runtime.mjs
65
- │
66
- ├── builders/ # Pure config builders
67
- ├── data/ # Constants and metadata
68
- ├── content/ # Static docs content
69
- ├── runtime/ # Low-level runtime helpers
70
- └── home/ # Home templates/files
41
+ |-- index.mjs # Node entry (bootstraps TS presentation via tsx)
42
+ |-- package.json # the published `gitpagedocs` package
43
+ |-- ai/ # AI documentation CLI (provider/model/paths → markdown)
44
+ |-- contracts/ # Stable contracts for external tooling
45
+ | `-- doc-versions.mjs
46
+ |
47
+ |-- presentation/ # Interface/composition root
48
+ | |-- index.ts
49
+ | |-- options/
50
+ | `-- ui/
51
+ |
52
+ |-- application/ # Use-cases and ports
53
+ | |-- config-only/handler.mjs
54
+ | |-- home/handler.mjs
55
+ | |-- report/config-only-reporter.mjs
56
+ | |-- use-cases/dispatch-mode.ts
57
+ | `-- ports/cli-runtime-ports.ts
58
+ |
59
+ |-- domain/ # Business rules
60
+ | `-- services/sanitize-segment.mjs
61
+ |
62
+ |-- infrastructure/ # Side effects and adapters
63
+ | |-- config-only/runtime.mjs
64
+ | `-- home/runtime.mjs
65
+ |
66
+ |-- builders/ # Pure config builders
67
+ |-- data/ # Constants and metadata
68
+ |-- content/ # Static docs content
69
+ |-- runtime/ # Low-level runtime helpers
70
+ `-- home/ # Home templates/files
71
71
  ```
72
72
 
73
73
  ## SOLID Principles
@@ -5,7 +5,6 @@ import { DOCS } from "../content/docs.mjs";
5
5
  import { DOC_VERSIONS } from "../data/version-constants.mjs";
6
6
  import { buildRootConfig } from "./root-config-builder.mjs";
7
7
  import { buildVersionConfig } from "./version-config-builder.mjs";
8
- import { generateSourceViewerHtml } from "./source-viewer.mjs";
9
8
 
10
9
  /**
11
10
  * Build all config artifacts (root, layouts, versions, docs).
@@ -19,11 +18,6 @@ export function buildConfigArtifacts(options = {}) {
19
18
  const layoutsConfig = { layouts: LAYOUTS };
20
19
  const fallbackLayoutsConfig = { layouts: FALLBACK_LAYOUTS };
21
20
 
22
- const sourceViewerHtml = generateSourceViewerHtml(root);
23
- const docsHtml = {
24
- sourceViewer: { pt: sourceViewerHtml, en: sourceViewerHtml, es: sourceViewerHtml },
25
- };
26
-
27
21
  const versionConfigs = {};
28
22
  for (const versionId of DOC_VERSIONS) {
29
23
  versionConfigs[versionId] = buildVersionConfig(versionId);
@@ -34,7 +28,7 @@ export function buildConfigArtifacts(options = {}) {
34
28
  layoutsConfig,
35
29
  fallbackLayoutsConfig,
36
30
  docs: DOCS,
37
- docsHtml,
31
+ docsHtml: {},
38
32
  versionConfigs,
39
33
  };
40
34
  }
@@ -11,15 +11,16 @@ export function buildRootConfig(options = {}) {
11
11
  const useOfficialLayouts = !useLocalLayoutConfig;
12
12
  const githubOwner = options.githubOwner;
13
13
  const githubRepo = options.githubRepo;
14
- const repositorySearchHome = false;
14
+ const repositorySearchHome = true;
15
15
  const renderingUrl =
16
16
  githubOwner && githubRepo
17
17
  ? `https://${githubOwner}.github.io/${githubRepo}/`
18
18
  : "https://vidigal-code.github.io/git-page-docs/";
19
- const projectLink =
20
- githubOwner && githubRepo
21
- ? `https://github.com/${githubOwner}/${githubRepo}`
22
- : "https://github.com/Vidigal-code/git-page-docs";
19
+ const projectLink =
20
+ githubOwner && githubRepo
21
+ ? `https://github.com/${githubOwner}/${githubRepo}`
22
+ : "https://github.com/Vidigal-code/git-page-docs";
23
+ const sourceViewerPath = `${projectLink}/tree/main`;
23
24
 
24
25
  const versionEntries = DOC_VERSIONS.map((id) => ({
25
26
  id,
@@ -28,10 +29,12 @@ export function buildRootConfig(options = {}) {
28
29
  PathConfig: `gitpagedocs/docs/versions/${id}/config.json`,
29
30
  PreviewProject: "",
30
31
  UpdateDate: "",
31
- branch: "",
32
- release: "",
33
- commit: "",
34
- }));
32
+ branch: "",
33
+ release: "",
34
+ commit: "",
35
+ "source-viewer": true,
36
+ "source-viewer-path": sourceViewerPath,
37
+ }));
35
38
 
36
39
  const baseSiteConfig = getDefaultSiteConfig(DOCS, projectLink);
37
40
 
@@ -109,3 +109,28 @@ export function buildVideoRoute(versionId, routeId, videoType, pathVideo, titles
109
109
  if (authorization !== undefined) obj.authorization = authorization;
110
110
  return obj;
111
111
  }
112
+
113
+ export function buildAudioRoute(versionId, routeId, audioType, pathAudio, titles, descriptions, options = {}) {
114
+ const base = buildVideoRoute(versionId, routeId, audioType, pathAudio, titles, descriptions, options);
115
+ const audioTypeByLang = typeof audioType === "string" ? { pt: audioType, en: audioType, es: audioType } : audioType;
116
+ const pathAudioByLang = typeof pathAudio === "string" ? { pt: pathAudio, en: pathAudio, es: pathAudio } : pathAudio;
117
+ const { video, ...rest } = base;
118
+ return {
119
+ ...rest,
120
+ audio: { audioType: audioTypeByLang, pathAudio: pathAudioByLang },
121
+ };
122
+ }
123
+
124
+ export function buildSourceViewerRoute(routeId, sourceViewerPath, titles, descriptions, options = {}) {
125
+ const base = buildMdRoute("", routeId, {}, titles, descriptions, {
126
+ ...options,
127
+ fullscreenEnabled: false,
128
+ RouteguideBrand: false,
129
+ });
130
+ delete base.path;
131
+ return {
132
+ ...base,
133
+ "source-viewer": true,
134
+ "source-viewer-path": sourceViewerPath,
135
+ };
136
+ }
@@ -9,7 +9,7 @@ export function createThemeTemplate(layout, themeColors = THEME_COLORS) {
9
9
  id: layout.id,
10
10
  name: layout.name,
11
11
  author: layout.author,
12
- version: "1.0.0",
12
+ version: "1.1.54",
13
13
  mode: layout.mode,
14
14
  supportsLightAndDarkModes: layout.supportsLightAndDarkModes,
15
15
  colors,
@@ -3,8 +3,8 @@
3
3
  import {
4
4
  ROUTE_PATHS,
5
5
  VIDEO_IDS,
6
+ AUDIO_IDS,
6
7
  PAGE2_AUDIO,
7
- SOURCE_VIEWER_META,
8
8
  } from "../data/path-mappings.mjs";
9
9
  import {
10
10
  ROUTE_META_ID1,
@@ -17,9 +17,11 @@ import {
17
17
  VIDEO_META_ID2,
18
18
  VIDEO_META_ID3,
19
19
  VIDEO_META_ID4,
20
+ AUDIO_META_ID12,
21
+ SOURCE_VIEWER_META,
20
22
  DEFAULT_HIERARCHY,
21
23
  } from "../data/route-metas.mjs";
22
- import { buildMdRoute, buildHtmlRoute, buildVideoRoute } from "./route-builders.mjs";
24
+ import { buildAudioRoute, buildMdRoute, buildSourceViewerRoute, buildVideoRoute } from "./route-builders.mjs";
23
25
 
24
26
  const ROUTE_METAS = {
25
27
  1: ROUTE_META_ID1,
@@ -43,93 +45,93 @@ function buildVersionMdRoutes(versionId) {
43
45
  };
44
46
  const routeOptions = {
45
47
  ...(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
48
  };
58
49
  return buildMdRoute(versionId, id, pathByLang, meta.titles, meta.descriptions, routeOptions);
59
50
  });
60
51
  }
61
52
 
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
53
  function buildVersionVideoRoutes(versionId) {
79
54
  return [1, 2, 3, 4].map((id) =>
80
55
  buildVideoRoute(
81
56
  versionId,
82
- id,
57
+ id + 7,
83
58
  "youtube",
84
59
  VIDEO_IDS[id - 1],
85
60
  VIDEO_METAS[id].title,
86
61
  VIDEO_METAS[id].description,
87
- {
88
- authorization: {
89
- requireExternalAuth: true,
90
- allowedProviders: ["authjs", "clerk", "firebase", "jwt"],
91
- },
92
- },
93
62
  )
94
63
  );
95
64
  }
96
65
 
66
+ function buildVersionAudioRoutes(versionId) {
67
+ return [
68
+ buildAudioRoute(
69
+ versionId,
70
+ AUDIO_META_ID12.id,
71
+ "youtube",
72
+ AUDIO_IDS[0],
73
+ AUDIO_META_ID12.title,
74
+ AUDIO_META_ID12.description,
75
+ ),
76
+ ];
77
+ }
78
+
79
+ function buildVersionSourceViewerRoutes() {
80
+ return [
81
+ buildSourceViewerRoute(
82
+ SOURCE_VIEWER_META.id,
83
+ "https://github.com/Vidigal-code/git-page-docs/tree/main",
84
+ SOURCE_VIEWER_META.titles,
85
+ SOURCE_VIEWER_META.descriptions,
86
+ ),
87
+ ];
88
+ }
89
+
97
90
  function buildVersionMenus(versionId) {
98
91
  const base = `gitpagedocs/docs/versions/${versionId}`;
99
92
  const menuMd = [1, 2, 3, 4, 5, 6].map((id) => ({
100
- id: id,
93
+ id,
101
94
  pt: { title: ROUTE_METAS[id].titles.pt, "path-click": `${base}/pt/${ROUTE_PATHS[id].pt}` },
102
95
  en: { title: ROUTE_METAS[id].titles.en, "path-click": `${base}/en/${ROUTE_PATHS[id].en}` },
103
96
  es: { title: ROUTE_METAS[id].titles.es, "path-click": `${base}/es/${ROUTE_PATHS[id].es}` },
104
97
  }));
105
- const menuHtml = [
98
+ const menuVideo = [1, 2, 3, 4].map((id) => ({
99
+ id: id + 7,
100
+ pt: { title: `${VIDEO_METAS[id].title.pt.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
101
+ en: { title: `${VIDEO_METAS[id].title.en.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
102
+ es: { title: `${VIDEO_METAS[id].title.es.slice(0, 40)}...`, "path-click": `page:${id + 7}` },
103
+ }));
104
+ const menuAudio = [
106
105
  {
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` },
106
+ id: AUDIO_META_ID12.id,
107
+ pt: { title: AUDIO_META_ID12.title.pt, "path-click": `page:${AUDIO_META_ID12.id}` },
108
+ en: { title: AUDIO_META_ID12.title.en, "path-click": `page:${AUDIO_META_ID12.id}` },
109
+ es: { title: AUDIO_META_ID12.title.es, "path-click": `page:${AUDIO_META_ID12.id}` },
111
110
  },
112
111
  ];
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 };
112
+ const menuSourceViewer = [
113
+ {
114
+ id: SOURCE_VIEWER_META.id,
115
+ pt: { title: SOURCE_VIEWER_META.titles.pt, "path-click": `page:${SOURCE_VIEWER_META.id}` },
116
+ en: { title: SOURCE_VIEWER_META.titles.en, "path-click": `page:${SOURCE_VIEWER_META.id}` },
117
+ es: { title: SOURCE_VIEWER_META.titles.es, "path-click": `page:${SOURCE_VIEWER_META.id}` },
118
+ },
119
+ ];
120
+ return { md: menuMd, sourceViewer: menuSourceViewer, html: [], video: menuVideo, audio: menuAudio };
120
121
  }
121
122
 
122
123
  /**
123
124
  * 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
125
+ * @param {string} versionId - e.g. "1.1.54"
126
+ * @returns {object} Version config with routes, menus, and hierarchy
126
127
  */
127
128
  export function buildVersionConfig(versionId) {
129
+ const menus = buildVersionMenus(versionId);
130
+
128
131
  return {
129
132
  auth: {
130
133
  accessKeys: {
131
134
  "docs-key": "open-gitpagedocs-docs",
132
- "source-viewer-key": "open-source-viewer",
133
135
  },
134
136
  rolesStorageKey: "git-page-docs:route-auth:roles",
135
137
  providers: [
@@ -140,11 +142,15 @@ export function buildVersionConfig(versionId) {
140
142
  ],
141
143
  },
142
144
  "routes-md": buildVersionMdRoutes(versionId),
143
- "routes-html": buildVersionHtmlRoutes(versionId),
145
+ "routes-source-viewer": buildVersionSourceViewerRoutes(),
146
+ "routes-html": [],
144
147
  "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
+ "routes-audio": buildVersionAudioRoutes(versionId),
149
+ "menus-header-md": menus.md,
150
+ "menus-header-source-viewer": menus.sourceViewer,
151
+ "menus-header-html": menus.html,
152
+ "menus-header-video": menus.video,
153
+ "menus-header-audio": menus.audio,
148
154
  hierarchyPage: DEFAULT_HIERARCHY,
149
155
  hierarchyMenu: DEFAULT_HIERARCHY,
150
156
  };
@@ -144,7 +144,6 @@ Install globally with \`npm install -g gitpagedocs\`, or run one-off with \`npx
144
144
  - \`gitpagedocs/icon.svg\` – default icon
145
145
  - \`gitpagedocs/docs/versions/<ver>/config.json\` – per-version routes
146
146
  - \`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
147
  - \`gitpagedocs/layouts/\` – only with \`--layoutconfig\`
149
148
 
150
149
  ## Content types
@@ -152,20 +151,20 @@ Install globally with \`npm install -g gitpagedocs\`, or run one-off with \`npx
152
151
  | Type | Config key | Description |
153
152
  |------|------------|-------------|
154
153
  | Markdown | \`routes-md\` | .md files with \`path\` per language |
155
- | HTML | \`routes-html\` | \`path\` (e.g. source-viewer) or \`url\` for external |
154
+ | HTML | \`routes-html\` | local \`path\` or external \`url\` |
156
155
  | Video | \`routes-video\` | \`video.pathVideo\`, \`video.videoType\` |
157
156
  | Audio | \`routes-audio\` | \`audio.pathAudio\`, \`audio.audioType\` |
158
157
 
159
158
  ## Source code viewer
160
159
 
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
-
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
160
+ 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.
161
+
162
+ - Repository tree from \`source-viewer-path\`; branch defaults to \`main\`
163
+ - Folder navigation and file filtering
164
+ - GitHub-style directory listing
165
+ - Code rendering with line numbers
166
+ - Markdown preview/code toggle, including \`README.md\`
167
+ - Collapsible folders in the sidebar
169
168
 
170
169
  ## Config keys (site)
171
170
 
@@ -296,9 +295,9 @@ Supported adapters:
296
295
  {
297
296
  "id": 6,
298
297
  "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"
298
+ "en": "gitpagedocs/docs/versions/1.1.54/en/authorized-routes.md",
299
+ "pt": "gitpagedocs/docs/versions/1.1.54/pt/authorized-routes.md",
300
+ "es": "gitpagedocs/docs/versions/1.1.54/es/authorized-routes.md"
302
301
  },
303
302
  "authorization": {
304
303
  "accessKeyId": "docs-key",
@@ -345,9 +344,10 @@ Behavior:
345
344
 
346
345
  \`VersionControl.versions\` defines:
347
346
 
348
- - \`id\`
349
- - \`path\`
350
- - optional metadata links (\`ProjectLink\`, \`branch\`, \`release\`, \`commit\`)
347
+ - \`id\`
348
+ - \`path\`
349
+ - optional metadata links (\`ProjectLink\`, \`branch\`, \`release\`, \`commit\`)
350
+ - optional source viewer metadata (\`source-viewer\`, \`source-viewer-path\`)
351
351
 
352
352
  ## Navigation
353
353
 
@@ -366,14 +366,15 @@ Behavior:
366
366
 
367
367
  Version configs support multiple content types:
368
368
 
369
- - \`routes-md\`: Markdown routes with optional \`title\`, \`description\` (centered via \`titlePosition\`, \`descriptionPosition\`)
370
- - \`routes-html\`: HTML page paths per language
369
+ - \`routes-md\`: Markdown routes with optional \`title\`, \`description\` (centered via \`titlePosition\`, \`descriptionPosition\`)
370
+ - \`routes-source-viewer\`: Source viewer containers with \`source-viewer: true\` and \`source-viewer-path\`
371
+ - \`routes-html\`: HTML page paths per language
371
372
  - \`routes-video\`: Video config with \`video.videoType\` (youtube, vimeo, mp4, etc.) and \`video.pathVideo\`
372
373
  - \`routes-audio\`: Audio config with \`audio.audioType\` (youtube, mp3, etc.) and \`audio.pathAudio\`
373
374
  - \`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 }\`
375
+ - \`menus-header-md\`, \`menus-header-source-viewer\`, \`menus-header-html\`, \`menus-header-video\`, \`menus-header-audio\`: menus per type
376
+ - \`hierarchyPage\`: container order on page \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
377
+ - \`hierarchyMenu\`: menu section order \`{ md: 0, "source-viewer": 1, html: 2, video: 3, audio: 4 }\`
377
378
 
378
379
  Each route can include \`title\`, \`description\` (per language), \`titleCss\`, \`titlePosition: "center"\`, \`descriptionPosition: "center"\`, \`titleIsVisible\`, \`descriptionIsVisible\`.
379
380
 
@@ -389,7 +390,7 @@ Per-route options for \`routes-md\`, \`routes-html\`, \`routes-video\`, and \`ro
389
390
  ## Content types: path vs url (HTML)
390
391
 
391
392
  - **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.
393
+ - **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
394
  - **Video (\`routes-video\`)**: uses \`video.pathVideo\` and \`video.videoType\` (youtube, vimeo, mp4, etc.).
394
395
  - **Audio (\`routes-audio\`)**: uses \`audio.pathAudio\` and \`audio.audioType\` (youtube, mp3, etc.). No autoplay by default.
395
396
 
@@ -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:
148
-
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
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.
147
+
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
 
@@ -199,9 +198,10 @@ Claves principales:
199
198
 
200
199
  \`VersionControl.versions\` define:
201
200
 
202
- - \`id\`: identificador de version
203
- - \`path\`: ruta de config de version
204
- - links opcionales (\`ProjectLink\`, \`branch\`, \`release\`, \`commit\`)
201
+ - \`id\`: identificador de version
202
+ - \`path\`: ruta de config de version
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
 
@@ -220,14 +220,15 @@ Claves principales:
220
220
 
221
221
  Los configs de version soportan multiples tipos:
222
222
 
223
- - \`routes-md\`: Rutas markdown con \`title\`, \`description\` (centrados via \`titlePosition\`, \`descriptionPosition\`)
224
- - \`routes-html\`: Rutas de paginas HTML por idioma
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\`
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:
148
-
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
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.
147
+
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
 
@@ -199,9 +198,10 @@ Principais chaves:
199
198
 
200
199
  \`VersionControl.versions\` define:
201
200
 
202
- - \`id\`: identificador da versao
203
- - \`path\`: caminho do config da versao
204
- - links opcionais (\`ProjectLink\`, \`branch\`, \`release\`, \`commit\`)
201
+ - \`id\`: identificador da versao
202
+ - \`path\`: caminho do config da versao
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
 
@@ -220,14 +220,15 @@ Principais chaves:
220
220
 
221
221
  Configs de versao suportam multiplos tipos:
222
222
 
223
- - \`routes-md\`: Rotas markdown com \`title\`, \`description\` (centralizados via \`titlePosition\`, \`descriptionPosition\`)
224
- - \`routes-html\`: Caminhos de paginas HTML por idioma
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\`
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.54";
2
+
3
+ export const DOC_VERSIONS = [PACKAGE_VERSION];