ardo 1.1.1 → 1.2.0

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
@@ -27,18 +27,18 @@ pnpm add -D typescript vite tailwindcss
27
27
  Create a `press.config.ts` in your project root:
28
28
 
29
29
  ```typescript
30
- import { defineConfig } from 'ardo/config'
30
+ import { defineConfig } from "ardo/config"
31
31
 
32
32
  export default defineConfig({
33
- title: 'My Documentation',
34
- description: 'Built with Ardo',
33
+ title: "My Documentation",
34
+ description: "Built with Ardo",
35
35
 
36
36
  themeConfig: {
37
- nav: [{ text: 'Guide', link: '/guide/getting-started' }],
37
+ nav: [{ text: "Guide", link: "/guide/getting-started" }],
38
38
  sidebar: [
39
39
  {
40
- text: 'Guide',
41
- items: [{ text: 'Getting Started', link: '/guide/getting-started' }],
40
+ text: "Guide",
41
+ items: [{ text: "Getting Started", link: "/guide/getting-started" }],
42
42
  },
43
43
  ],
44
44
  },
@@ -50,10 +50,10 @@ export default defineConfig({
50
50
  Add the plugin to your `vite.config.ts`:
51
51
 
52
52
  ```typescript
53
- import { defineConfig } from 'vite'
54
- import { tanstackStart } from '@tanstack/react-start/plugin/vite'
55
- import react from '@vitejs/plugin-react'
56
- import { ardoPlugin } from 'ardo/vite'
53
+ import { defineConfig } from "vite"
54
+ import { tanstackStart } from "@tanstack/react-start/plugin/vite"
55
+ import react from "@vitejs/plugin-react"
56
+ import { ardoPlugin } from "ardo/vite"
57
57
 
58
58
  export default defineConfig({
59
59
  plugins: [
@@ -74,7 +74,7 @@ export default defineConfig({
74
74
  Access configuration and page data in your components:
75
75
 
76
76
  ```tsx
77
- import { useConfig, useSidebar, usePageData, useTOC } from 'ardo/runtime'
77
+ import { useConfig, useSidebar, usePageData, useTOC } from "ardo/runtime"
78
78
 
79
79
  function MyComponent() {
80
80
  const config = useConfig()
@@ -91,7 +91,7 @@ function MyComponent() {
91
91
  Use pre-built components for your documentation:
92
92
 
93
93
  ```tsx
94
- import { DocPage, Layout, Header, Sidebar, TOC } from 'ardo/theme'
94
+ import { DocPage, Layout, Header, Sidebar, TOC } from "ardo/theme"
95
95
 
96
96
  function App() {
97
97
  return (
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { S as SidebarItem } from './types-ChK5MqjO.js';
3
+ import { S as SidebarItem } from './types-C22M-Kor.js';
4
4
 
5
5
  interface LayoutProps {
6
6
  /** Header content */
@@ -74,7 +74,7 @@ interface SocialLinkProps {
74
74
  /** URL to link to */
75
75
  href: string;
76
76
  /** Social icon type */
77
- icon: 'github' | 'twitter' | 'discord' | 'linkedin' | 'youtube' | 'npm';
77
+ icon: "github" | "twitter" | "discord" | "linkedin" | "youtube" | "npm";
78
78
  /** Accessible label */
79
79
  ariaLabel?: string;
80
80
  /** Additional CSS classes */
@@ -290,18 +290,18 @@ interface CodeGroupProps {
290
290
  }
291
291
  declare function CodeGroup({ children }: CodeGroupProps): react_jsx_runtime.JSX.Element;
292
292
 
293
- type ContainerType = 'tip' | 'warning' | 'danger' | 'info' | 'note';
293
+ type ContainerType = "tip" | "warning" | "danger" | "info" | "note";
294
294
  interface ContainerProps {
295
295
  type: ContainerType;
296
296
  title?: string;
297
297
  children: ReactNode;
298
298
  }
299
299
  declare function Container({ type, title, children }: ContainerProps): react_jsx_runtime.JSX.Element;
300
- declare function Tip({ title, children }: Omit<ContainerProps, 'type'>): react_jsx_runtime.JSX.Element;
301
- declare function Warning({ title, children }: Omit<ContainerProps, 'type'>): react_jsx_runtime.JSX.Element;
302
- declare function Danger({ title, children }: Omit<ContainerProps, 'type'>): react_jsx_runtime.JSX.Element;
303
- declare function Info({ title, children }: Omit<ContainerProps, 'type'>): react_jsx_runtime.JSX.Element;
304
- declare function Note({ title, children }: Omit<ContainerProps, 'type'>): react_jsx_runtime.JSX.Element;
300
+ declare function Tip({ title, children }: Omit<ContainerProps, "type">): react_jsx_runtime.JSX.Element;
301
+ declare function Warning({ title, children }: Omit<ContainerProps, "type">): react_jsx_runtime.JSX.Element;
302
+ declare function Danger({ title, children }: Omit<ContainerProps, "type">): react_jsx_runtime.JSX.Element;
303
+ declare function Info({ title, children }: Omit<ContainerProps, "type">): react_jsx_runtime.JSX.Element;
304
+ declare function Note({ title, children }: Omit<ContainerProps, "type">): react_jsx_runtime.JSX.Element;
305
305
 
306
306
  interface TabsProps {
307
307
  defaultValue?: string;
@@ -73,4 +73,4 @@ export {
73
73
  resolveConfig,
74
74
  loadConfig
75
75
  };
76
- //# sourceMappingURL=chunk-VQKQKRWH.js.map
76
+ //# sourceMappingURL=chunk-3U63LMDZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/config/index.ts"],"sourcesContent":["import type {\n PressConfig,\n ResolvedConfig,\n ThemeConfig,\n MarkdownConfig,\n TypeDocConfig,\n SidebarItem,\n NavItem,\n SocialLink,\n PageFrontmatter,\n TOCItem,\n PageData,\n HeadConfig,\n} from \"./types\"\nimport path from \"path\"\n\nexport type {\n PressConfig,\n ResolvedConfig,\n ThemeConfig,\n MarkdownConfig,\n TypeDocConfig,\n SidebarItem,\n NavItem,\n SocialLink,\n PageFrontmatter,\n TOCItem,\n PageData,\n HeadConfig,\n}\n\nexport function defineConfig(config: PressConfig): PressConfig {\n return config\n}\n\nconst defaultThemeConfig: ThemeConfig = {\n nav: [],\n sidebar: [],\n socialLinks: [],\n search: {\n enabled: true,\n placeholder: \"Search...\",\n },\n outline: {\n level: 2,\n label: \"On this page\",\n },\n}\n\nconst defaultMarkdownConfig: MarkdownConfig = {\n theme: {\n light: \"github-light\",\n dark: \"github-dark\",\n },\n lineNumbers: false,\n anchor: true,\n toc: {\n level: [2, 3],\n },\n}\n\nexport function resolveConfig(config: PressConfig, root: string): ResolvedConfig {\n const srcDir = config.srcDir ?? \"content\"\n const contentDir = path.resolve(root, srcDir)\n\n return {\n title: config.title,\n description: config.description ?? \"\",\n base: config.base ?? \"/\",\n srcDir,\n outDir: config.outDir ?? \"dist\",\n lang: config.lang ?? \"en\",\n head: config.head ?? [],\n themeConfig: {\n ...defaultThemeConfig,\n ...config.themeConfig,\n },\n markdown: {\n ...defaultMarkdownConfig,\n ...config.markdown,\n },\n vite: config.vite,\n root,\n contentDir,\n }\n}\n\nexport async function loadConfig(root: string): Promise<ResolvedConfig> {\n const configPath = path.resolve(root, \"press.config.ts\")\n\n try {\n const configModule = await import(configPath)\n const config = configModule.default as PressConfig\n return resolveConfig(config, root)\n } catch {\n return resolveConfig(\n {\n title: \"TanStack Press\",\n description: \"Documentation powered by TanStack Press\",\n },\n root\n )\n }\n}\n"],"mappings":";AAcA,OAAO,UAAU;AAiBV,SAAS,aAAa,QAAkC;AAC7D,SAAO;AACT;AAEA,IAAM,qBAAkC;AAAA,EACtC,KAAK,CAAC;AAAA,EACN,SAAS,CAAC;AAAA,EACV,aAAa,CAAC;AAAA,EACd,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;AAEA,IAAM,wBAAwC;AAAA,EAC5C,OAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,KAAK;AAAA,IACH,OAAO,CAAC,GAAG,CAAC;AAAA,EACd;AACF;AAEO,SAAS,cAAc,QAAqB,MAA8B;AAC/E,QAAM,SAAS,OAAO,UAAU;AAChC,QAAM,aAAa,KAAK,QAAQ,MAAM,MAAM;AAE5C,SAAO;AAAA,IACL,OAAO,OAAO;AAAA,IACd,aAAa,OAAO,eAAe;AAAA,IACnC,MAAM,OAAO,QAAQ;AAAA,IACrB;AAAA,IACA,QAAQ,OAAO,UAAU;AAAA,IACzB,MAAM,OAAO,QAAQ;AAAA,IACrB,MAAM,OAAO,QAAQ,CAAC;AAAA,IACtB,aAAa;AAAA,MACX,GAAG;AAAA,MACH,GAAG,OAAO;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,MACR,GAAG;AAAA,MACH,GAAG,OAAO;AAAA,IACZ;AAAA,IACA,MAAM,OAAO;AAAA,IACb;AAAA,IACA;AAAA,EACF;AACF;AAEA,eAAsB,WAAW,MAAuC;AACtE,QAAM,aAAa,KAAK,QAAQ,MAAM,iBAAiB;AAEvD,MAAI;AACF,UAAM,eAAe,MAAM,OAAO;AAClC,UAAM,SAAS,aAAa;AAC5B,WAAO,cAAc,QAAQ,IAAI;AAAA,EACnC,QAAQ;AACN,WAAO;AAAA,MACL;AAAA,QACE,OAAO;AAAA,QACP,aAAa;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  resolveConfig
3
- } from "./chunk-VQKQKRWH.js";
3
+ } from "./chunk-3U63LMDZ.js";
4
+ import {
5
+ generateApiDocs
6
+ } from "./chunk-YN6PP526.js";
4
7
 
5
8
  // src/markdown/pipeline.ts
6
9
  import { unified } from "unified";
@@ -493,6 +496,7 @@ function ${componentName}() {
493
496
  title: (frontmatter.title as string) || '${defaultTitle}',
494
497
  description: frontmatter.description as string | undefined,
495
498
  frontmatter,
499
+ content: '',
496
500
  toc,
497
501
  filePath: '${relativePath}',
498
502
  relativePath: '${relativePath}',
@@ -674,6 +678,20 @@ import { tanstackStart } from "@tanstack/react-start/plugin/vite";
674
678
  import react from "@vitejs/plugin-react";
675
679
  import fs2 from "fs/promises";
676
680
  import path2 from "path";
681
+ import { execSync } from "child_process";
682
+ function detectGitHubRepoName(cwd) {
683
+ try {
684
+ const remoteUrl = execSync("git remote get-url origin", {
685
+ cwd,
686
+ encoding: "utf-8",
687
+ stdio: ["pipe", "pipe", "pipe"]
688
+ }).trim();
689
+ const match = remoteUrl.match(/github\.com[/:][\w-]+\/([\w.-]+?)(?:\.git)?$/);
690
+ return match?.[1];
691
+ } catch {
692
+ return void 0;
693
+ }
694
+ }
677
695
  var VIRTUAL_MODULE_ID = "virtual:ardo/config";
678
696
  var RESOLVED_VIRTUAL_MODULE_ID = "\0" + VIRTUAL_MODULE_ID;
679
697
  var VIRTUAL_SIDEBAR_ID = "virtual:ardo/sidebar";
@@ -697,12 +715,12 @@ function getShikiHighlighter(config) {
697
715
  }
698
716
  function ardoPlugin(options = {}) {
699
717
  let resolvedConfig;
700
- const { routes, prerender, ...pressConfig } = options;
718
+ const { routes, prerender, typedoc, githubPages = true, ...pressConfig } = options;
701
719
  const mainPlugin = {
702
720
  name: "ardo",
703
721
  enforce: "pre",
704
- config() {
705
- return {
722
+ config(userConfig, env) {
723
+ const result = {
706
724
  optimizeDeps: {
707
725
  exclude: ["ardo/theme/styles.css"]
708
726
  },
@@ -710,6 +728,14 @@ function ardoPlugin(options = {}) {
710
728
  noExternal: ["ardo"]
711
729
  }
712
730
  };
731
+ if (githubPages && env.command === "build" && !userConfig.base) {
732
+ const repoName = detectGitHubRepoName(userConfig.root || process.cwd());
733
+ if (repoName) {
734
+ result.base = `/${repoName}/`;
735
+ console.log(`[ardo] GitHub Pages detected, using base: ${result.base}`);
736
+ }
737
+ }
738
+ return result;
713
739
  },
714
740
  async configResolved(config) {
715
741
  const root = config.root;
@@ -784,6 +810,37 @@ export default function MarkdownContent() {
784
810
  })
785
811
  );
786
812
  }
813
+ if (typedoc) {
814
+ const defaultTypedocConfig = {
815
+ enabled: true,
816
+ entryPoints: ["./src/index.ts"],
817
+ out: "api-reference",
818
+ excludePrivate: true,
819
+ excludeInternal: true
820
+ };
821
+ const typedocConfig = typedoc === true ? defaultTypedocConfig : { ...defaultTypedocConfig, ...typedoc };
822
+ let hasGenerated = false;
823
+ const typedocPlugin = {
824
+ name: "ardo:typedoc",
825
+ async buildStart() {
826
+ if (!hasGenerated && typedocConfig.enabled) {
827
+ console.log("[ardo] Generating API documentation with TypeDoc...");
828
+ const startTime = Date.now();
829
+ try {
830
+ const contentDir = pressConfig.srcDir ?? "./content";
831
+ const docs = await generateApiDocs(typedocConfig, contentDir);
832
+ const duration = Date.now() - startTime;
833
+ console.log(`[ardo] Generated ${docs.length} API documentation pages in ${duration}ms`);
834
+ hasGenerated = true;
835
+ } catch (error) {
836
+ console.error("[ardo] TypeDoc generation failed:", error);
837
+ throw error;
838
+ }
839
+ }
840
+ }
841
+ };
842
+ plugins.unshift(typedocPlugin);
843
+ }
787
844
  const tanstackPlugin = tanstackStart({
788
845
  prerender: {
789
846
  enabled: prerender?.enabled ?? true,
@@ -1064,4 +1121,4 @@ export {
1064
1121
  getPageDataForRoute,
1065
1122
  generateSidebar2 as generateSidebar
1066
1123
  };
1067
- //# sourceMappingURL=chunk-ROS3IS2H.js.map
1124
+ //# sourceMappingURL=chunk-5ZESKKTO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/markdown/pipeline.ts","../src/markdown/containers.ts","../src/markdown/toc.ts","../src/markdown/shiki.ts","../src/markdown/links.ts","../src/vite/routes-plugin.ts","../src/vite/plugin.ts","../src/runtime/loader.ts","../src/runtime/sidebar.ts"],"sourcesContent":["import { unified } from \"unified\"\nimport remarkParse from \"remark-parse\"\nimport remarkGfm from \"remark-gfm\"\nimport remarkFrontmatter from \"remark-frontmatter\"\nimport remarkDirective from \"remark-directive\"\nimport remarkRehype from \"remark-rehype\"\nimport rehypeStringify from \"rehype-stringify\"\nimport matter from \"gray-matter\"\nimport type { MarkdownConfig, TOCItem, PageFrontmatter } from \"../config/types\"\nimport { remarkContainers } from \"./containers\"\nimport { remarkExtractToc, type TocExtraction } from \"./toc\"\nimport { createShikiHighlighter, rehypeShikiFromHighlighter, type ShikiHighlighter } from \"./shiki\"\nimport { rehypeLinks } from \"./links\"\n\nexport interface TransformResult {\n html: string\n frontmatter: PageFrontmatter\n toc: TOCItem[]\n}\n\nexport interface TransformOptions {\n basePath?: string\n highlighter?: ShikiHighlighter\n}\n\nexport async function transformMarkdown(\n content: string,\n config: MarkdownConfig,\n options: TransformOptions = {}\n): Promise<TransformResult> {\n const { data: frontmatter, content: markdownContent } = matter(content)\n const { basePath = \"/\", highlighter: providedHighlighter } = options\n\n const tocExtraction: TocExtraction = { toc: [] }\n const highlighter = providedHighlighter ?? (await createShikiHighlighter(config))\n\n const processor = unified()\n .use(remarkParse)\n .use(remarkFrontmatter, [\"yaml\"])\n .use(remarkGfm)\n .use(remarkDirective)\n .use(remarkContainers)\n .use(remarkExtractToc, { tocExtraction, levels: config.toc?.level ?? [2, 3] })\n .use(remarkRehype, { allowDangerousHtml: true })\n .use(rehypeShikiFromHighlighter, { highlighter, config })\n .use(rehypeLinks, { basePath })\n .use(rehypeStringify, { allowDangerousHtml: true })\n\n if (config.remarkPlugins) {\n for (const plugin of config.remarkPlugins) {\n processor.use(plugin as Parameters<typeof processor.use>[0])\n }\n }\n\n if (config.rehypePlugins) {\n for (const plugin of config.rehypePlugins) {\n processor.use(plugin as Parameters<typeof processor.use>[0])\n }\n }\n\n const result = await processor.process(markdownContent)\n\n return {\n html: String(result),\n frontmatter: frontmatter as PageFrontmatter,\n toc: tocExtraction.toc,\n }\n}\n\nexport async function transformMarkdownToReact(\n content: string,\n config: MarkdownConfig\n): Promise<TransformResult> {\n return transformMarkdown(content, config)\n}\n","import type { Root } from \"mdast\"\nimport type { ContainerDirective } from \"mdast-util-directive\"\nimport { visit } from \"unist-util-visit\"\n\nconst containerTypes = [\n \"tip\",\n \"warning\",\n \"danger\",\n \"info\",\n \"note\",\n \"details\",\n \"code-group\",\n] as const\ntype ContainerType = (typeof containerTypes)[number]\n\nconst defaultTitles: Record<ContainerType, string> = {\n tip: \"TIP\",\n warning: \"WARNING\",\n danger: \"DANGER\",\n info: \"INFO\",\n note: \"NOTE\",\n details: \"Details\",\n \"code-group\": \"\",\n}\n\nexport function remarkContainers() {\n return function (tree: Root) {\n visit(tree, \"containerDirective\", (node: ContainerDirective) => {\n const type = node.name as ContainerType\n\n if (!containerTypes.includes(type)) {\n return\n }\n\n const data = node.data || (node.data = {})\n\n const titleNode = node.children[0]\n let customTitle: string | undefined\n\n if (\n titleNode &&\n titleNode.type === \"paragraph\" &&\n titleNode.children[0]?.type === \"text\" &&\n titleNode.data?.directiveLabel\n ) {\n customTitle = (titleNode.children[0] as { value: string }).value\n node.children.shift()\n }\n\n const title = customTitle || defaultTitles[type]\n\n if (type === \"code-group\") {\n data.hName = \"div\"\n data.hProperties = {\n className: [\"press-code-group\"],\n }\n\n const tabs: Array<{ label: string; content: unknown }> = []\n\n for (const child of node.children) {\n if (child.type === \"code\") {\n const codeNode = child as { lang?: string; meta?: string; value: string }\n const meta = codeNode.meta || \"\"\n const labelMatch = meta.match(/\\[([^\\]]+)\\]/)\n const label = labelMatch ? labelMatch[1] : codeNode.lang || \"Code\"\n tabs.push({ label, content: child })\n }\n }\n\n const tabsHtml = tabs\n .map(\n (tab, i) =>\n `<button class=\"press-code-group-tab${i === 0 ? \" active\" : \"\"}\" data-index=\"${i}\">${escapeHtml(tab.label)}</button>`\n )\n .join(\"\")\n\n node.children = [\n {\n type: \"html\",\n value: `<div class=\"press-code-group-tabs\">${tabsHtml}</div>`,\n } as unknown as (typeof node.children)[number],\n {\n type: \"html\",\n value: '<div class=\"press-code-group-panels\">',\n } as unknown as (typeof node.children)[number],\n ...tabs.map(\n (tab, i) =>\n ({\n type: \"html\",\n value: `<div class=\"press-code-group-panel${i === 0 ? \" active\" : \"\"}\" data-index=\"${i}\">`,\n }) as unknown as (typeof node.children)[number]\n ),\n ...node.children.flatMap((child: (typeof node.children)[number], _i: number) => [\n child,\n {\n type: \"html\",\n value: \"</div>\",\n } as unknown as (typeof node.children)[number],\n ]),\n {\n type: \"html\",\n value: \"</div>\",\n } as unknown as (typeof node.children)[number],\n ]\n\n return\n }\n\n if (type === \"details\") {\n data.hName = \"details\"\n data.hProperties = {\n className: [\"press-details\"],\n }\n\n node.children.unshift({\n type: \"html\",\n value: `<summary class=\"press-details-summary\">${escapeHtml(title)}</summary>`,\n } as unknown as (typeof node.children)[number])\n\n return\n }\n\n data.hName = \"div\"\n data.hProperties = {\n className: [\"press-container\", `press-container-${type}`],\n }\n\n node.children.unshift({\n type: \"html\",\n value: `<p class=\"press-container-title\">${escapeHtml(title)}</p>`,\n } as unknown as (typeof node.children)[number])\n })\n }\n}\n\nfunction escapeHtml(text: string): string {\n return text\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\")\n}\n","import type { Root, Heading } from \"mdast\"\nimport { visit } from \"unist-util-visit\"\nimport type { TOCItem } from \"../config/types\"\n\nexport interface TocExtraction {\n toc: TOCItem[]\n}\n\ninterface TocOptions {\n tocExtraction: TocExtraction\n levels: [number, number]\n}\n\nexport function remarkExtractToc(options: TocOptions) {\n const { tocExtraction, levels } = options\n const [minLevel, maxLevel] = levels\n\n return function (tree: Root) {\n const headings: Array<{ text: string; level: number; id: string }> = []\n\n visit(tree, \"heading\", (node: Heading) => {\n if (node.depth < minLevel || node.depth > maxLevel) {\n return\n }\n\n const text = getHeadingText(node)\n const id = slugify(text)\n\n headings.push({\n text,\n level: node.depth,\n id,\n })\n\n // Add id to the heading node for anchor links\n const data = node.data || (node.data = {})\n const hProperties = (data.hProperties || (data.hProperties = {})) as Record<string, string>\n hProperties.id = id\n })\n\n tocExtraction.toc = buildTocTree(headings, minLevel)\n }\n}\n\nfunction getHeadingText(node: Heading): string {\n const textParts: string[] = []\n\n function extractText(child: unknown) {\n if (!child || typeof child !== \"object\") return\n\n const typedChild = child as { type?: string; value?: string; children?: unknown[] }\n\n if (typedChild.type === \"text\") {\n textParts.push(typedChild.value || \"\")\n } else if (typedChild.type === \"inlineCode\") {\n textParts.push(typedChild.value || \"\")\n } else if (Array.isArray(typedChild.children)) {\n typedChild.children.forEach(extractText)\n }\n }\n\n node.children.forEach(extractText)\n return textParts.join(\"\")\n}\n\nfunction slugify(text: string): string {\n return text\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")\n}\n\nfunction buildTocTree(\n headings: Array<{ text: string; level: number; id: string }>,\n _minLevel: number\n): TOCItem[] {\n const result: TOCItem[] = []\n const stack: Array<{ item: TOCItem; level: number }> = []\n\n for (const heading of headings) {\n const item: TOCItem = {\n id: heading.id,\n text: heading.text,\n level: heading.level,\n }\n\n while (stack.length > 0 && stack[stack.length - 1].level >= heading.level) {\n stack.pop()\n }\n\n if (stack.length === 0) {\n result.push(item)\n } else {\n const parent = stack[stack.length - 1].item\n if (!parent.children) {\n parent.children = []\n }\n parent.children.push(item)\n }\n\n stack.push({ item, level: heading.level })\n }\n\n return result\n}\n\nexport function flattenToc(toc: TOCItem[]): TOCItem[] {\n const result: TOCItem[] = []\n\n function flatten(items: TOCItem[]) {\n for (const item of items) {\n result.push(item)\n if (item.children) {\n flatten(item.children)\n }\n }\n }\n\n flatten(toc)\n return result\n}\n","import { createHighlighter, type Highlighter, type BundledTheme } from \"shiki\"\nimport type { Root, Element, Text } from \"hast\"\nimport { visit } from \"unist-util-visit\"\nimport type { MarkdownConfig } from \"../config/types\"\n\nexport type ShikiHighlighter = Highlighter\n\nexport async function createShikiHighlighter(config: MarkdownConfig): Promise<ShikiHighlighter> {\n const themeConfig = config.theme ?? {\n light: \"github-light\",\n dark: \"github-dark\",\n }\n\n const themes: BundledTheme[] =\n typeof themeConfig === \"string\" ? [themeConfig] : [themeConfig.light, themeConfig.dark]\n\n const highlighter = await createHighlighter({\n themes,\n langs: [\n \"javascript\",\n \"typescript\",\n \"jsx\",\n \"tsx\",\n \"json\",\n \"html\",\n \"css\",\n \"markdown\",\n \"bash\",\n \"shell\",\n \"yaml\",\n \"python\",\n \"rust\",\n \"go\",\n \"sql\",\n \"diff\",\n ],\n })\n\n return highlighter\n}\n\ninterface RehypeShikiOptions {\n highlighter: ShikiHighlighter\n config: MarkdownConfig\n}\n\nexport function rehypeShikiFromHighlighter(options: RehypeShikiOptions) {\n const { highlighter, config } = options\n\n const themeConfig = config.theme ?? {\n light: \"github-light\",\n dark: \"github-dark\",\n }\n\n return function (tree: Root) {\n visit(tree, \"element\", (node: Element, index, parent) => {\n if (\n node.tagName !== \"pre\" ||\n !node.children[0] ||\n (node.children[0] as Element).tagName !== \"code\"\n ) {\n return\n }\n\n const codeNode = node.children[0] as Element\n const className = (codeNode.properties?.className as string[]) || []\n const langClass = className.find((c) => c.startsWith(\"language-\"))\n const lang = langClass ? langClass.replace(\"language-\", \"\") : \"text\"\n\n const codeContent = getTextContent(codeNode)\n\n if (!codeContent.trim()) {\n return\n }\n\n try {\n let html: string\n\n if (typeof themeConfig === \"string\") {\n html = highlighter.codeToHtml(codeContent, {\n lang,\n theme: themeConfig,\n })\n } else {\n html = highlighter.codeToHtml(codeContent, {\n lang,\n themes: {\n light: themeConfig.light,\n dark: themeConfig.dark,\n },\n defaultColor: false,\n })\n }\n\n const metaString = (codeNode.properties?.metastring as string) || \"\"\n const lineNumbers = config.lineNumbers || metaString.includes(\"showLineNumbers\")\n const highlightLines = parseHighlightLines(metaString)\n const title = parseTitle(metaString)\n\n const wrapperHtml = buildCodeBlockHtml(html, {\n lang,\n lineNumbers,\n highlightLines,\n title,\n })\n\n if (parent && typeof index === \"number\") {\n const newNode: Element = {\n type: \"element\",\n tagName: \"div\",\n properties: {\n className: [\"press-code-block\"],\n \"data-lang\": lang,\n },\n children: [\n {\n type: \"raw\",\n value: wrapperHtml,\n } as unknown as Element,\n ],\n }\n parent.children[index] = newNode\n }\n } catch {\n // If highlighting fails, leave the node unchanged\n }\n })\n }\n}\n\nfunction getTextContent(node: Element | Text): string {\n if (node.type === \"text\") {\n return node.value\n }\n if (\"children\" in node) {\n return node.children.map((child) => getTextContent(child as Element | Text)).join(\"\")\n }\n return \"\"\n}\n\nfunction parseHighlightLines(meta: string): number[] {\n const match = meta.match(/\\{([\\d,-]+)\\}/)\n if (!match) return []\n\n const ranges = match[1].split(\",\")\n const lines: number[] = []\n\n for (const range of ranges) {\n if (range.includes(\"-\")) {\n const [start, end] = range.split(\"-\").map(Number)\n for (let i = start; i <= end; i++) {\n lines.push(i)\n }\n } else {\n lines.push(Number(range))\n }\n }\n\n return lines\n}\n\nfunction parseTitle(meta: string): string | undefined {\n const match = meta.match(/title=\"([^\"]+)\"/)\n return match ? match[1] : undefined\n}\n\ninterface CodeBlockOptions {\n lang: string\n lineNumbers: boolean\n highlightLines: number[]\n title?: string\n}\n\nfunction buildCodeBlockHtml(shikiHtml: string, options: CodeBlockOptions): string {\n const { lang, lineNumbers, highlightLines, title } = options\n\n let html = \"\"\n\n if (title) {\n html += `<div class=\"press-code-title\">${escapeHtml(title)}</div>`\n }\n\n html += `<div class=\"press-code-wrapper\" data-lang=\"${lang}\">`\n\n if (lineNumbers || highlightLines.length > 0) {\n const lines = shikiHtml.split(\"\\n\")\n const processedHtml = lines\n .map((line, i) => {\n const lineNum = i + 1\n const isHighlighted = highlightLines.includes(lineNum)\n const classes = [\"press-code-line\"]\n if (isHighlighted) classes.push(\"highlighted\")\n\n let prefix = \"\"\n if (lineNumbers) {\n prefix = `<span class=\"press-line-number\">${lineNum}</span>`\n }\n\n return `<span class=\"${classes.join(\" \")}\">${prefix}${line}</span>`\n })\n .join(\"\\n\")\n\n html += processedHtml\n } else {\n html += shikiHtml\n }\n\n html += `<button class=\"press-copy-button\" data-code=\"${encodeURIComponent(extractCodeFromHtml(shikiHtml))}\">\n <span class=\"press-copy-icon\">Copy</span>\n <span class=\"press-copied-icon\" style=\"display:none\">Copied!</span>\n </button>`\n\n html += \"</div>\"\n\n return html\n}\n\nfunction extractCodeFromHtml(html: string): string {\n return html\n .replace(/<[^>]+>/g, \"\")\n .replace(/&lt;/g, \"<\")\n .replace(/&gt;/g, \">\")\n .replace(/&amp;/g, \"&\")\n .replace(/&quot;/g, '\"')\n .replace(/&#39;/g, \"'\")\n}\n\nfunction escapeHtml(text: string): string {\n return text\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\")\n}\n","import { visit } from \"unist-util-visit\"\nimport type { Root, Element } from \"hast\"\n\nexport interface RehypeLinkOptions {\n basePath: string\n}\n\n/**\n * Rehype plugin that rewrites internal links to include the basePath.\n * This is needed for static sites deployed to subpaths (e.g., GitHub Pages).\n */\nexport function rehypeLinks(options: RehypeLinkOptions) {\n const { basePath } = options\n\n // Normalize basePath: ensure it starts with / and doesn't end with /\n const normalizedBase = basePath === \"/\" ? \"\" : basePath.replace(/\\/$/, \"\")\n\n return (tree: Root) => {\n if (!normalizedBase) {\n // No basePath to add\n return\n }\n\n visit(tree, \"element\", (node: Element) => {\n if (node.tagName === \"a\") {\n const href = node.properties?.href\n\n if (typeof href === \"string\") {\n // Only rewrite internal links that start with /\n // Don't rewrite: external URLs, anchors, relative paths, or already prefixed paths\n if (href.startsWith(\"/\") && !href.startsWith(\"//\") && !href.startsWith(normalizedBase)) {\n node.properties = node.properties || {}\n node.properties.href = normalizedBase + href\n }\n }\n }\n })\n }\n}\n","import type { Plugin } from \"vite\"\nimport type { ResolvedConfig } from \"../config/types\"\nimport fs from \"fs/promises\"\nimport fsSync from \"fs\"\nimport path from \"path\"\n\nexport interface PressRoutesPluginOptions {\n /** Directory where routes should be generated */\n routesDir?: string\n /** Source directory for content (default: 'content') */\n srcDir?: string\n /**\n * Layout mode for generated routes.\n * - 'docPage': Routes use DocPage which includes Layout (backward compatible)\n * - 'layoutRoute': Routes use DocContent without Layout (for use with _layout.tsx)\n * Default: 'layoutRoute'\n */\n layoutMode?: \"docPage\" | \"layoutRoute\"\n}\n\ninterface RouteInfo {\n /** Path relative to content dir without extension (e.g., 'guide/getting-started') */\n slug: string\n /** Full path to the markdown file */\n mdPath: string\n /** Path relative to content dir with extension (e.g., 'guide/getting-started.md') */\n relativePath: string\n}\n\n/**\n * Vite plugin that generates individual route files for each markdown file\n * in the content directory. Routes include SEO head() configuration\n * using frontmatter data.\n */\nexport function pressRoutesPlugin(\n getConfig: () => ResolvedConfig,\n options: PressRoutesPluginOptions = {}\n): Plugin {\n const { layoutMode = \"layoutRoute\" } = options\n\n let routesDir: string\n let contentDir: string\n let isDevMode = false\n let hasCleanedRoutes = false\n\n function scanContentDirSync(dir: string, rootDir: string): RouteInfo[] {\n const routes: RouteInfo[] = []\n\n try {\n const entries = fsSync.readdirSync(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n const children = scanContentDirSync(fullPath, rootDir)\n routes.push(...children)\n } else if (entry.name.endsWith(\".md\") && entry.name !== \"index.md\") {\n const relativePath = path.relative(rootDir, fullPath)\n const slug = relativePath.replace(/\\.md$/, \"\").replace(/\\\\/g, \"/\")\n\n routes.push({\n slug,\n mdPath: fullPath,\n relativePath: relativePath.replace(/\\\\/g, \"/\"),\n })\n } else if (entry.name === \"index.md\") {\n const parentDir = path.dirname(fullPath)\n const relativePath = path.relative(rootDir, fullPath)\n\n // Skip root index.md (handled by manual index.tsx)\n if (parentDir !== rootDir) {\n const slug = path.relative(rootDir, parentDir).replace(/\\\\/g, \"/\")\n\n routes.push({\n slug,\n mdPath: fullPath,\n relativePath: relativePath.replace(/\\\\/g, \"/\"),\n })\n }\n }\n }\n } catch {\n // Content dir may not exist\n }\n\n return routes\n }\n\n function generateRouteCode(route: RouteInfo): string {\n const { slug, relativePath } = route\n\n // Calculate relative path from route file to content file\n // Route at routes/${slug}.tsx needs to reach content/${relativePath}\n const depthToProjectRoot = slug.split(\"/\").length + 1\n const toProjectRoot = \"../\".repeat(depthToProjectRoot)\n const contentImportPath = `${toProjectRoot}content/${relativePath}`\n\n // Generate component name from slug\n const componentName =\n slug\n .split(\"/\")\n .map((part) => part.replace(/[-_]/g, \" \").replace(/\\b\\w/g, (c) => c.toUpperCase()))\n .join(\"\")\n .replace(/\\s/g, \"\") + \"Page\"\n\n // Generate route path for TanStack Router (no route group, direct path)\n const routePath = `/${slug}`\n\n // Generate default title from slug\n const defaultTitle = slug\n .split(\"/\")\n .pop()!\n .replace(/[-_]/g, \" \")\n .replace(/\\b\\w/g, (c) => c.toUpperCase())\n\n // Choose component based on layout mode\n const contentComponent = layoutMode === \"docPage\" ? \"DocPage\" : \"DocContent\"\n\n return `// This file is auto-generated by ardo. Do not edit manually.\nimport { createFileRoute } from '@tanstack/react-router'\nimport { ${contentComponent} } from 'ardo/theme'\nimport { PressProvider } from 'ardo/runtime'\nimport config from 'virtual:ardo/config'\nimport sidebar from 'virtual:ardo/sidebar'\nimport Content, { frontmatter, toc } from '${contentImportPath}'\n\nexport const Route = createFileRoute('${routePath}')({\n head: () => ({\n meta: [\n { title: (frontmatter.title as string) ? \\`\\${frontmatter.title} | \\${config.title}\\` : config.title },\n ...(frontmatter.description ? [{ name: 'description', content: frontmatter.description as string }] : []),\n // OpenGraph\n { property: 'og:title', content: (frontmatter.title as string) || '${defaultTitle}' },\n ...(frontmatter.description ? [{ property: 'og:description', content: frontmatter.description as string }] : []),\n { property: 'og:type', content: 'article' },\n // Twitter\n { name: 'twitter:card', content: 'summary' },\n { name: 'twitter:title', content: (frontmatter.title as string) || '${defaultTitle}' },\n ...(frontmatter.description ? [{ name: 'twitter:description', content: frontmatter.description as string }] : []),\n ],\n }),\n component: ${componentName},\n})\n\nfunction ${componentName}() {\n const pageData = {\n title: (frontmatter.title as string) || '${defaultTitle}',\n description: frontmatter.description as string | undefined,\n frontmatter,\n content: '',\n toc,\n filePath: '${relativePath}',\n relativePath: '${relativePath}',\n }\n\n return (\n <PressProvider config={config} sidebar={sidebar} currentPage={pageData}>\n <${contentComponent}>\n <Content />\n </${contentComponent}>\n </PressProvider>\n )\n}\n`\n }\n\n function writeRouteFileSync(route: RouteInfo): boolean {\n const routeFilePath = path.join(routesDir, `${route.slug}.tsx`)\n const code = generateRouteCode(route)\n\n // Only write if content changed\n try {\n const existingContent = fsSync.readFileSync(routeFilePath, \"utf-8\")\n if (existingContent === code) {\n return false\n }\n } catch {\n // File doesn't exist, will be created\n }\n\n fsSync.mkdirSync(path.dirname(routeFilePath), { recursive: true })\n fsSync.writeFileSync(routeFilePath, code, \"utf-8\")\n return true\n }\n\n function generateAllRoutesSync(): void {\n const routes = scanContentDirSync(contentDir, contentDir)\n\n let writtenCount = 0\n for (const route of routes) {\n if (writeRouteFileSync(route)) {\n writtenCount++\n }\n }\n\n if (writtenCount > 0) {\n console.log(`[ardo] Generated ${writtenCount} content route files`)\n }\n }\n\n async function ensureDirectoryExists(dir: string): Promise<void> {\n try {\n await fs.mkdir(dir, { recursive: true })\n } catch {\n // Directory may already exist\n }\n }\n\n async function writeRouteFile(route: RouteInfo): Promise<boolean> {\n const routeFilePath = path.join(routesDir, `${route.slug}.tsx`)\n const routeFileDir = path.dirname(routeFilePath)\n\n await ensureDirectoryExists(routeFileDir)\n\n const code = generateRouteCode(route)\n\n // Only write if content changed to avoid triggering unnecessary rebuilds\n try {\n const existingContent = await fs.readFile(routeFilePath, \"utf-8\")\n if (existingContent === code) {\n return false // No change\n }\n } catch {\n // File doesn't exist, will be created\n }\n\n await fs.writeFile(routeFilePath, code, \"utf-8\")\n return true // File was written\n }\n\n async function cleanGeneratedRoutes(): Promise<void> {\n const pressRoutesDir = routesDir\n\n try {\n const entries = await fs.readdir(pressRoutesDir, { withFileTypes: true, recursive: true })\n\n for (const entry of entries) {\n if (entry.isFile() && entry.name.endsWith(\".tsx\") && entry.name !== \"_layout.tsx\") {\n const fullPath = path.join(entry.parentPath ?? pressRoutesDir, entry.name)\n\n // Read the file to check if it's auto-generated\n try {\n const content = await fs.readFile(fullPath, \"utf-8\")\n if (content.startsWith(\"// This file is auto-generated by ardo\")) {\n await fs.unlink(fullPath)\n }\n } catch {\n // File might have been deleted already\n }\n }\n }\n } catch {\n // Directory doesn't exist yet, nothing to clean\n }\n }\n\n async function scanContentDir(dir: string, rootDir: string): Promise<RouteInfo[]> {\n const routes: RouteInfo[] = []\n const entries = await fs.readdir(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n const children = await scanContentDir(fullPath, rootDir)\n routes.push(...children)\n } else if (entry.name.endsWith(\".md\") && entry.name !== \"index.md\") {\n const relativePath = path.relative(rootDir, fullPath)\n const slug = relativePath.replace(/\\.md$/, \"\").replace(/\\\\/g, \"/\")\n\n routes.push({\n slug,\n mdPath: fullPath,\n relativePath: relativePath.replace(/\\\\/g, \"/\"),\n })\n } else if (entry.name === \"index.md\") {\n const parentDir = path.dirname(fullPath)\n const relativePath = path.relative(rootDir, fullPath)\n\n // Skip root index.md (handled by manual index.tsx)\n if (parentDir !== rootDir) {\n const slug = path.relative(rootDir, parentDir).replace(/\\\\/g, \"/\")\n\n routes.push({\n slug,\n mdPath: fullPath,\n relativePath: relativePath.replace(/\\\\/g, \"/\"),\n })\n }\n }\n }\n\n return routes\n }\n\n async function generateAllRoutes(): Promise<void> {\n // Clean old generated routes first (only in dev mode, and only once)\n if (isDevMode && !hasCleanedRoutes) {\n await cleanGeneratedRoutes()\n hasCleanedRoutes = true\n }\n\n const routes = await scanContentDir(contentDir, contentDir)\n\n let writtenCount = 0\n for (const route of routes) {\n if (await writeRouteFile(route)) {\n writtenCount++\n }\n }\n\n if (writtenCount > 0) {\n console.log(`[ardo] Generated ${writtenCount} content route files`)\n }\n }\n\n return {\n name: \"ardo:routes\",\n enforce: \"pre\",\n\n config(userConfig, env) {\n // Generate routes early, before TanStack Router scans the files\n const root = userConfig.root || process.cwd()\n const srcDir = path.join(root, \"src\")\n routesDir = options.routesDir || path.join(srcDir, \"routes\")\n isDevMode = env.command === \"serve\"\n\n // Use srcDir from options to resolve contentDir early\n contentDir = path.resolve(root, options.srcDir || \"content\")\n\n // Generate content routes SYNCHRONOUSLY\n // TanStack Router scans routes during config phase, so routes must exist by then\n try {\n generateAllRoutesSync()\n } catch (err) {\n console.warn(\"[ardo] Could not generate routes in config phase:\", err)\n }\n },\n\n configResolved(viteConfig) {\n // Update paths if they weren't set in config hook\n if (!routesDir) {\n routesDir = options.routesDir || path.join(viteConfig.root, \"src\", \"routes\")\n isDevMode = viteConfig.command === \"serve\"\n }\n },\n\n async buildStart() {\n // Re-generate content routes in buildStart for full async support\n const config = getConfig()\n contentDir = config.contentDir\n await generateAllRoutes()\n },\n\n configureServer(server) {\n // Watch for changes in content directory\n server.watcher.add(contentDir)\n\n server.watcher.on(\"change\", async (changedPath) => {\n if (changedPath.startsWith(contentDir) && changedPath.endsWith(\".md\")) {\n await generateAllRoutes()\n }\n })\n\n server.watcher.on(\"add\", async (addedPath) => {\n if (addedPath.startsWith(contentDir) && addedPath.endsWith(\".md\")) {\n await generateAllRoutes()\n }\n })\n\n server.watcher.on(\"unlink\", async (removedPath) => {\n if (removedPath.startsWith(contentDir) && removedPath.endsWith(\".md\")) {\n // Re-generate routes (will clean up orphaned route files)\n hasCleanedRoutes = false // Allow cleaning again\n await generateAllRoutes()\n }\n })\n },\n }\n}\n","import type { Plugin, UserConfig } from \"vite\"\nimport type { PressConfig, ResolvedConfig } from \"../config/types\"\nimport type { TypeDocConfig } from \"../typedoc/types\"\nimport { resolveConfig } from \"../config/index\"\nimport { transformMarkdown } from \"../markdown/pipeline\"\nimport { createShikiHighlighter, type ShikiHighlighter } from \"../markdown/shiki\"\nimport { pressRoutesPlugin, type PressRoutesPluginOptions } from \"./routes-plugin\"\nimport { generateApiDocs } from \"../typedoc/generator\"\nimport { tanstackStart } from \"@tanstack/react-start/plugin/vite\"\nimport react from \"@vitejs/plugin-react\"\nimport fs from \"fs/promises\"\nimport path from \"path\"\nimport { execSync } from \"child_process\"\n\n/**\n * Detects the GitHub repository name from git remote URL.\n * Returns the repo name (e.g., 'ardo' from 'github.com/sebastian-software/ardo')\n * or undefined if not a GitHub repo.\n */\nfunction detectGitHubRepoName(cwd: string): string | undefined {\n try {\n const remoteUrl = execSync(\"git remote get-url origin\", {\n cwd,\n encoding: \"utf-8\",\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n }).trim()\n\n // Parse GitHub URL (supports both HTTPS and SSH)\n // https://github.com/user/repo.git\n // git@github.com:user/repo.git\n const match = remoteUrl.match(/github\\.com[/:][\\w-]+\\/([\\w.-]+?)(?:\\.git)?$/)\n return match?.[1]\n } catch {\n return undefined\n }\n}\n\nconst VIRTUAL_MODULE_ID = \"virtual:ardo/config\"\nconst RESOLVED_VIRTUAL_MODULE_ID = \"\\0\" + VIRTUAL_MODULE_ID\n\nconst VIRTUAL_SIDEBAR_ID = \"virtual:ardo/sidebar\"\nconst RESOLVED_VIRTUAL_SIDEBAR_ID = \"\\0\" + VIRTUAL_SIDEBAR_ID\n\nexport interface ArdoPluginOptions extends Partial<PressConfig> {\n /** Options for the routes generator plugin */\n routes?: PressRoutesPluginOptions | false\n /** Options for TanStack Start prerendering */\n prerender?: {\n enabled?: boolean\n crawlLinks?: boolean\n }\n /**\n * Auto-detect GitHub repository and set base path for GitHub Pages.\n * When true, automatically sets `base: '/repo-name/'` if deploying to GitHub Pages.\n * @default true\n */\n githubPages?: boolean\n}\n\n// Use globalThis to cache the Shiki highlighter as a true singleton across all plugin instances\nconst SHIKI_CACHE_KEY = \"__ardo_shiki_highlighter__\"\nlet shikiHighlighterPromise: Promise<ShikiHighlighter> | null = null\n\nfunction getShikiHighlighter(config: ResolvedConfig): Promise<ShikiHighlighter> {\n // Check if already cached on globalThis\n if ((globalThis as Record<string, unknown>)[SHIKI_CACHE_KEY]) {\n return Promise.resolve(\n (globalThis as Record<string, unknown>)[SHIKI_CACHE_KEY] as ShikiHighlighter\n )\n }\n // Use promise caching to prevent multiple concurrent creations\n if (!shikiHighlighterPromise) {\n shikiHighlighterPromise = createShikiHighlighter(config.markdown).then((highlighter) => {\n ;(globalThis as Record<string, unknown>)[SHIKI_CACHE_KEY] = highlighter\n return highlighter\n })\n }\n return shikiHighlighterPromise\n}\n\nexport function ardoPlugin(options: ArdoPluginOptions = {}): Plugin[] {\n let resolvedConfig: ResolvedConfig\n\n // Extract ardo-specific options from the rest (which is PressConfig)\n const { routes, prerender, typedoc, githubPages = true, ...pressConfig } = options\n\n const mainPlugin: Plugin = {\n name: \"ardo\",\n enforce: \"pre\",\n\n config(userConfig, env): UserConfig {\n const result: UserConfig = {\n optimizeDeps: {\n exclude: [\"ardo/theme/styles.css\"],\n },\n ssr: {\n noExternal: [\"ardo\"],\n },\n }\n\n // Auto-detect GitHub Pages base path for production builds\n if (githubPages && env.command === \"build\" && !userConfig.base) {\n const repoName = detectGitHubRepoName(userConfig.root || process.cwd())\n if (repoName) {\n result.base = `/${repoName}/`\n console.log(`[ardo] GitHub Pages detected, using base: ${result.base}`)\n }\n }\n\n return result\n },\n\n async configResolved(config) {\n const root = config.root\n const defaultConfig: PressConfig = {\n title: pressConfig.title ?? \"Ardo\",\n description: pressConfig.description ?? \"Documentation powered by Ardo\",\n }\n resolvedConfig = resolveConfig({ ...defaultConfig, ...pressConfig }, root)\n },\n\n resolveId(id) {\n if (id === VIRTUAL_MODULE_ID) {\n return RESOLVED_VIRTUAL_MODULE_ID\n }\n if (id === VIRTUAL_SIDEBAR_ID) {\n return RESOLVED_VIRTUAL_SIDEBAR_ID\n }\n },\n\n async load(id) {\n if (id === RESOLVED_VIRTUAL_MODULE_ID) {\n const clientConfig = {\n title: resolvedConfig.title,\n description: resolvedConfig.description,\n base: resolvedConfig.base,\n lang: resolvedConfig.lang,\n themeConfig: resolvedConfig.themeConfig,\n }\n return `export default ${JSON.stringify(clientConfig)}`\n }\n\n if (id === RESOLVED_VIRTUAL_SIDEBAR_ID) {\n const sidebar = await generateSidebar(resolvedConfig)\n return `export default ${JSON.stringify(sidebar)}`\n }\n },\n }\n\n const markdownPlugin: Plugin = {\n name: \"ardo:markdown\",\n enforce: \"pre\",\n\n async transform(code, id) {\n if (!id.endsWith(\".md\")) {\n return\n }\n\n const highlighter = await getShikiHighlighter(resolvedConfig)\n\n const result = await transformMarkdown(code, resolvedConfig.markdown, {\n basePath: resolvedConfig.base,\n highlighter,\n })\n\n const componentCode = `\nimport { createElement } from 'react'\n\nexport const frontmatter = ${JSON.stringify(result.frontmatter)}\nexport const toc = ${JSON.stringify(result.toc)}\n\nexport default function MarkdownContent() {\n return createElement('div', {\n className: 'press-content',\n dangerouslySetInnerHTML: { __html: ${JSON.stringify(result.html)} }\n })\n}\n`\n\n return {\n code: componentCode,\n map: null,\n }\n },\n }\n\n const plugins: Plugin[] = [mainPlugin, markdownPlugin]\n\n // Add routes plugin unless explicitly disabled\n // Note: Routes plugin must come AFTER typedoc in the array so that\n // typedoc runs first in buildStart and generates markdown files\n if (routes !== false) {\n plugins.unshift(\n pressRoutesPlugin(() => resolvedConfig, {\n srcDir: pressConfig.srcDir,\n ...routes,\n })\n )\n }\n\n // Add TypeDoc plugin if enabled\n // Note: unshift adds to front, so typedoc will be before routes in the array\n // This ensures typedoc buildStart runs before routes buildStart\n if (typedoc) {\n const defaultTypedocConfig: TypeDocConfig = {\n enabled: true,\n entryPoints: [\"./src/index.ts\"],\n out: \"api-reference\",\n excludePrivate: true,\n excludeInternal: true,\n }\n\n const typedocConfig: TypeDocConfig =\n typedoc === true ? defaultTypedocConfig : { ...defaultTypedocConfig, ...typedoc }\n\n let hasGenerated = false\n\n const typedocPlugin: Plugin = {\n name: \"ardo:typedoc\",\n\n async buildStart() {\n if (!hasGenerated && typedocConfig.enabled) {\n console.log(\"[ardo] Generating API documentation with TypeDoc...\")\n const startTime = Date.now()\n try {\n const contentDir = pressConfig.srcDir ?? \"./content\"\n const docs = await generateApiDocs(typedocConfig, contentDir)\n const duration = Date.now() - startTime\n console.log(`[ardo] Generated ${docs.length} API documentation pages in ${duration}ms`)\n hasGenerated = true\n } catch (error) {\n console.error(\"[ardo] TypeDoc generation failed:\", error)\n throw error\n }\n }\n },\n }\n\n plugins.unshift(typedocPlugin)\n }\n\n // Add TanStack Start plugin\n const tanstackPlugin = tanstackStart({\n prerender: {\n enabled: prerender?.enabled ?? true,\n crawlLinks: prerender?.crawlLinks ?? false,\n },\n })\n const tanstackPlugins = (\n Array.isArray(tanstackPlugin) ? tanstackPlugin : [tanstackPlugin]\n ).filter((p): p is Plugin => p != null)\n plugins.push(...tanstackPlugins)\n\n // Add React plugin\n const reactPlugin = react()\n const reactPlugins = (Array.isArray(reactPlugin) ? reactPlugin : [reactPlugin]).filter(\n (p): p is Plugin => p != null\n )\n plugins.push(...reactPlugins)\n\n return plugins\n}\n\nasync function generateSidebar(config: ResolvedConfig) {\n const { contentDir, themeConfig } = config\n\n if (themeConfig.sidebar && !Array.isArray(themeConfig.sidebar)) {\n return themeConfig.sidebar\n }\n\n if (themeConfig.sidebar && Array.isArray(themeConfig.sidebar) && themeConfig.sidebar.length > 0) {\n return themeConfig.sidebar\n }\n\n try {\n const sidebar = await scanDirectory(contentDir, contentDir, config.base)\n return sidebar\n } catch {\n return []\n }\n}\n\nasync function scanDirectory(\n dir: string,\n rootDir: string,\n _basePath: string\n): Promise<Array<{ text: string; link?: string; items?: unknown[] }>> {\n const entries = await fs.readdir(dir, { withFileTypes: true })\n const items: Array<{ text: string; link?: string; items?: unknown[]; order?: number }> = []\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n const relativePath = path.relative(rootDir, fullPath)\n\n if (entry.isDirectory()) {\n const children = await scanDirectory(fullPath, rootDir, _basePath)\n if (children.length > 0) {\n const indexPath = path.join(fullPath, \"index.md\")\n let link: string | undefined\n\n try {\n await fs.access(indexPath)\n // Don't include basePath - TanStack Router handles it automatically\n link = \"/\" + relativePath.replace(/\\\\/g, \"/\")\n } catch {\n // No index.md\n }\n\n items.push({\n text: formatTitle(entry.name),\n link,\n items: children,\n })\n }\n } else if (entry.name.endsWith(\".md\") && entry.name !== \"index.md\") {\n const fileContent = await fs.readFile(fullPath, \"utf-8\")\n const frontmatterMatch = fileContent.match(/^---\\n([\\s\\S]*?)\\n---/)\n\n let title = formatTitle(entry.name.replace(/\\.md$/, \"\"))\n let order: number | undefined\n\n if (frontmatterMatch) {\n const frontmatterText = frontmatterMatch[1]\n const titleMatch = frontmatterText.match(/title:\\s*[\"']?([^\"'\\n]+)[\"']?/)\n const orderMatch = frontmatterText.match(/order:\\s*(\\d+)/)\n\n if (titleMatch) {\n title = titleMatch[1].trim()\n }\n if (orderMatch) {\n order = parseInt(orderMatch[1], 10)\n }\n }\n\n // Don't include basePath - TanStack Router handles it automatically\n const link = \"/\" + relativePath.replace(/\\.md$/, \"\").replace(/\\\\/g, \"/\")\n\n items.push({\n text: title,\n link,\n order,\n })\n }\n }\n\n items.sort((a, b) => {\n if (a.order !== undefined && b.order !== undefined) {\n return a.order - b.order\n }\n if (a.order !== undefined) return -1\n if (b.order !== undefined) return 1\n return a.text.localeCompare(b.text)\n })\n\n return items.map(({ order: _order, ...item }) => item)\n}\n\nfunction formatTitle(name: string): string {\n return name.replace(/[-_]/g, \" \").replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\nexport default ardoPlugin\n","import fs from \"fs/promises\"\nimport path from \"path\"\nimport type { PageData, PageFrontmatter, TOCItem, ResolvedConfig } from \"../config/types\"\nimport { transformMarkdown } from \"../markdown/pipeline\"\n\nexport interface LoadDocOptions {\n slug: string\n contentDir: string\n config: ResolvedConfig\n}\n\nexport interface LoadDocResult {\n content: string\n frontmatter: PageFrontmatter\n toc: TOCItem[]\n filePath: string\n relativePath: string\n lastUpdated?: number\n}\n\nexport async function loadDoc(options: LoadDocOptions): Promise<LoadDocResult | null> {\n const { slug, contentDir, config } = options\n\n const possiblePaths = [\n path.join(contentDir, `${slug}.md`),\n path.join(contentDir, slug, \"index.md\"),\n ]\n\n let filePath: string | null = null\n let fileContent: string | null = null\n\n for (const tryPath of possiblePaths) {\n try {\n fileContent = await fs.readFile(tryPath, \"utf-8\")\n filePath = tryPath\n break\n } catch {\n continue\n }\n }\n\n if (!filePath || !fileContent) {\n return null\n }\n\n const result = await transformMarkdown(fileContent, config.markdown)\n const relativePath = path.relative(contentDir, filePath)\n\n let lastUpdated: number | undefined\n try {\n const stat = await fs.stat(filePath)\n lastUpdated = stat.mtimeMs\n } catch {\n // Ignore stat errors\n }\n\n return {\n content: result.html,\n frontmatter: result.frontmatter,\n toc: result.toc,\n filePath,\n relativePath,\n lastUpdated,\n }\n}\n\nexport async function loadAllDocs(contentDir: string, config: ResolvedConfig): Promise<PageData[]> {\n const docs: PageData[] = []\n\n async function scanDir(dir: string) {\n const entries = await fs.readdir(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n await scanDir(fullPath)\n } else if (entry.name.endsWith(\".md\")) {\n const fileContent = await fs.readFile(fullPath, \"utf-8\")\n const result = await transformMarkdown(fileContent, config.markdown)\n const relativePath = path.relative(contentDir, fullPath)\n\n let lastUpdated: number | undefined\n try {\n const stat = await fs.stat(fullPath)\n lastUpdated = stat.mtimeMs\n } catch {\n // Ignore stat errors\n }\n\n docs.push({\n title: result.frontmatter.title || formatTitle(entry.name.replace(/\\.md$/, \"\")),\n description: result.frontmatter.description,\n frontmatter: result.frontmatter,\n content: result.html,\n toc: result.toc,\n filePath: fullPath,\n relativePath,\n lastUpdated,\n })\n }\n }\n }\n\n await scanDir(contentDir)\n return docs\n}\n\nfunction formatTitle(name: string): string {\n return name.replace(/[-_]/g, \" \").replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\nexport function getSlugFromPath(relativePath: string): string {\n return relativePath\n .replace(/\\.md$/, \"\")\n .replace(/\\/index$/, \"\")\n .replace(/\\\\/g, \"/\")\n}\n\nexport function getPageDataForRoute(docs: PageData[], slug: string): PageData | undefined {\n return docs.find((doc) => {\n const docSlug = getSlugFromPath(doc.relativePath)\n return docSlug === slug || docSlug === `${slug}/index`\n })\n}\n","import fs from \"fs/promises\"\nimport type { Dirent } from \"fs\"\nimport path from \"path\"\nimport matter from \"gray-matter\"\nimport type { SidebarItem, ResolvedConfig } from \"../config/types\"\n\nexport interface SidebarGenerationOptions {\n contentDir: string\n basePath: string\n config: ResolvedConfig\n}\n\nexport async function generateSidebar(options: SidebarGenerationOptions): Promise<SidebarItem[]> {\n const { contentDir, basePath, config } = options\n\n const configSidebar = config.themeConfig.sidebar\n\n if (configSidebar) {\n if (Array.isArray(configSidebar) && configSidebar.length > 0) {\n return configSidebar\n }\n if (!Array.isArray(configSidebar)) {\n return []\n }\n }\n\n return await scanDirectoryForSidebar(contentDir, contentDir, basePath)\n}\n\nasync function scanDirectoryForSidebar(\n dir: string,\n rootDir: string,\n _basePath: string\n): Promise<SidebarItem[]> {\n let entries: Dirent[]\n\n try {\n entries = (await fs.readdir(dir, { withFileTypes: true })) as Dirent[]\n } catch {\n return []\n }\n\n interface SidebarItemWithOrder extends SidebarItem {\n order?: number\n }\n\n const items: SidebarItemWithOrder[] = []\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n const relativePath = path.relative(rootDir, fullPath)\n\n if (entry.name.startsWith(\".\") || entry.name.startsWith(\"_\")) {\n continue\n }\n\n if (entry.isDirectory()) {\n const children = await scanDirectoryForSidebar(fullPath, rootDir, _basePath)\n\n if (children.length > 0) {\n const indexPath = path.join(fullPath, \"index.md\")\n let link: string | undefined\n let title = formatTitle(entry.name)\n let order: number | undefined\n\n try {\n const indexContent = await fs.readFile(indexPath, \"utf-8\")\n const { data: frontmatter } = matter(indexContent)\n\n if (frontmatter.title) {\n title = frontmatter.title\n }\n if (typeof frontmatter.order === \"number\") {\n order = frontmatter.order\n }\n\n // Don't include basePath - TanStack Router handles it automatically\n link = normalizePath(relativePath)\n } catch {\n // No index.md file\n }\n\n items.push({\n text: title,\n link,\n collapsed: false,\n items: children,\n order,\n })\n }\n } else if (entry.name.endsWith(\".md\") && entry.name !== \"index.md\") {\n const fileContent = await fs.readFile(fullPath, \"utf-8\")\n const { data: frontmatter } = matter(fileContent)\n\n if (frontmatter.sidebar === false) {\n continue\n }\n\n const title = frontmatter.title || formatTitle(entry.name.replace(/\\.md$/, \"\"))\n const order = typeof frontmatter.order === \"number\" ? frontmatter.order : undefined\n\n // Don't include basePath - TanStack Router handles it automatically\n const link = normalizePath(relativePath.replace(/\\.md$/, \"\"))\n\n items.push({\n text: title,\n link,\n order,\n })\n }\n }\n\n items.sort((a, b) => {\n if (a.order !== undefined && b.order !== undefined) {\n return a.order - b.order\n }\n if (a.order !== undefined) return -1\n if (b.order !== undefined) return 1\n return a.text.localeCompare(b.text)\n })\n\n return items.map(({ order: _order, ...item }) => item)\n}\n\nfunction formatTitle(name: string): string {\n return name\n .replace(/^\\d+-/, \"\")\n .replace(/[-_]/g, \" \")\n .replace(/\\b\\w/g, (c) => c.toUpperCase())\n}\n\nfunction normalizePath(p: string): string {\n return \"/\" + p.replace(/\\\\/g, \"/\").replace(/^\\/+/, \"\")\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe;AACxB,OAAO,iBAAiB;AACxB,OAAO,eAAe;AACtB,OAAO,uBAAuB;AAC9B,OAAO,qBAAqB;AAC5B,OAAO,kBAAkB;AACzB,OAAO,qBAAqB;AAC5B,OAAO,YAAY;;;ACLnB,SAAS,aAAa;AAEtB,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGA,IAAM,gBAA+C;AAAA,EACnD,KAAK;AAAA,EACL,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,cAAc;AAChB;AAEO,SAAS,mBAAmB;AACjC,SAAO,SAAU,MAAY;AAC3B,UAAM,MAAM,sBAAsB,CAAC,SAA6B;AAC9D,YAAM,OAAO,KAAK;AAElB,UAAI,CAAC,eAAe,SAAS,IAAI,GAAG;AAClC;AAAA,MACF;AAEA,YAAM,OAAO,KAAK,SAAS,KAAK,OAAO,CAAC;AAExC,YAAM,YAAY,KAAK,SAAS,CAAC;AACjC,UAAI;AAEJ,UACE,aACA,UAAU,SAAS,eACnB,UAAU,SAAS,CAAC,GAAG,SAAS,UAChC,UAAU,MAAM,gBAChB;AACA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apeHtml","visit","fs","path","fs","path","path","fs","formatTitle","fs","path","matter","generateSidebar","formatTitle"]}
@@ -5,7 +5,7 @@ import {
5
5
  useSidebar,
6
6
  useTOC,
7
7
  useThemeConfig
8
- } from "./chunk-MTQQUBGW.js";
8
+ } from "./chunk-EOV2OUTW.js";
9
9
 
10
10
  // src/theme/Layout.tsx
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1132,4 +1132,4 @@ export {
1132
1132
  TabPanel,
1133
1133
  TabPanels
1134
1134
  };
1135
- //# sourceMappingURL=chunk-4YR57UTL.js.map
1135
+ //# sourceMappingURL=chunk-BPJODFL7.js.map