sourcey 3.4.4 → 3.4.6

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Your API docs shouldn't depend on someone else's SaaS.
4
4
 
5
- Sourcey is an open source documentation platform. Point it at an OpenAPI spec, add markdown guides, get a complete docs site. Static HTML you own; no dashboard, no monthly bill, no API calls to render your own documentation. Deploy anywhere.
5
+ Sourcey is an open source documentation platform. Point it at an OpenAPI spec, an MCP server, or a Doxygen XML directory; add markdown guides; get a complete docs site. Static HTML you own; no dashboard, no monthly bill, no API calls to render your own documentation. Deploy anywhere.
6
6
 
7
7
  [![npm](https://img.shields.io/npm/v/sourcey)](https://www.npmjs.com/package/sourcey)
8
8
  [![build](https://img.shields.io/github/actions/workflow/status/sourcey/sourcey/ci.yml?branch=master)](https://github.com/sourcey/sourcey/actions)
@@ -12,36 +12,39 @@ Sourcey is an open source documentation platform. Point it at an OpenAPI spec, a
12
12
  npx sourcey init
13
13
  ```
14
14
 
15
- ![Sourcey](assets/screenshot.jpg)
15
+ ![Sourcey](assets/hero-preview.jpg)
16
16
 
17
17
  **[Live demo](https://cheesestore.github.io/)** · [Documentation](https://sourcey.com/docs) · [GitHub](https://github.com/sourcey/sourcey)
18
18
 
19
19
  ## Features
20
20
 
21
21
  - **API reference from OpenAPI** — endpoints, parameters, request/response schemas, auto-generated code samples in 10 languages (cURL, JavaScript, TypeScript, Python, Go, Ruby, Java, PHP, Rust, C#)
22
- - **Markdown guides with rich components** — steps, cards, accordions, syntax-highlighted code blocks; everything you need for prose docs alongside your API reference
22
+ - **MCP server documentation** — tools, resources, prompts rendered as browsable reference with JSON-RPC, TypeScript, and Python code samples. Color-coded method types, annotation badges, connection config cards
23
+ - **Markdown guides with rich components** — steps, cards, accordions, syntax-highlighted code blocks; prose docs alongside your API reference
24
+ - **C++ and Doxygen** — feed Doxygen XML output, get modern searchable API docs. No new parser, no four-tool Breathe/Exhale/Sphinx pipeline
25
+ - **llms.txt generation** — auto-generate llms.txt and llms-full.txt alongside your HTML. Docs serve developers and AI agents from one build
23
26
  - **TypeScript config** — `sourcey.config.ts` with `defineConfig()` autocomplete; theme, navbar, CTA buttons, footer
24
27
  - **Theme presets** — default (sidebar + TOC), minimal (single column), api-first (Stripe-style three column); colors, fonts, layout dimensions, and custom CSS on top
25
28
  - **Vite dev server** — SSR hot reload on every component and CSS change; spec and markdown changes trigger instant refresh
26
29
  - **Dark mode** — semantic design tokens, light/dark logo variants, localStorage persistence
27
- - **Client-side search** — instant fuzzy search across all pages and API operations
30
+ - **Client-side search** — instant fuzzy search across all pages and API operations; Cmd+K
28
31
  - **Static HTML output** — no framework runtime, no vendor lock-in. Deploy to GitHub Pages, Vercel, Netlify, S3, anywhere
29
32
  - **Open source** — AGPL-3.0. Self-host, fork, extend. Your docs, your infrastructure
30
33
 
31
34
  ### Sourcey vs alternatives
32
35
 
33
- | | Sourcey | Mintlify | GitBook | Fern | Redocly | VitePress |
36
+ | | Sourcey | Redocly | GitBook | Mintlify | Fern | ReadMe |
34
37
  |---|---|---|---|---|---|---|
35
- | OpenAPI reference | Native | Native | No | Native | Native | Plugin |
36
- | Markdown guides | Native | Native | Native | Native | Native | Native |
37
- | Static output you own | Yes | No | No | No | Yes | Yes |
38
- | Zero JS shipped | Yes | No | No | No | No | No (Vue SPA) |
39
- | TypeScript config | Yes | JSON | GUI | YAML | YAML | TS |
40
- | Hot reload dev server | Vite SSR | Cloud | Cloud | Cloud | Webpack | Vite SPA |
41
- | Rich components | Yes | Yes | Limited | Yes | No | Vue |
42
- | Theme presets | Yes | No | No | No | No | Yes |
43
- | Self-hosted | Yes | No | No | No | Yes | Yes |
44
- | Pricing | Free / AGPL | $150+/mo | Free / paid | Paid | Free / paid | Free |
38
+ | Open source | Yes | Partial | No | No | No | No |
39
+ | Static output | Yes | Yes | No | No | No | No |
40
+ | Zero JS shipped | Yes | No | No | No | No | No |
41
+ | MCP server docs | Native | No | No | No | No | No |
42
+ | Doxygen / C++ docs | Native | No | No | No | No | No |
43
+ | Config format | TypeScript | YAML | GUI | JSON | YAML | GUI |
44
+ | Local preview | Vite SSR | Local | Cloud | Local | Local | Cloud |
45
+ | No account required | Yes | Partial | No | No | No | No |
46
+ | Self-hosted | Yes | Yes | No | No | Yes | No |
47
+ | Pricing | Free | $10–$24 | $65–$249 | $250+ | $150+ | $79–$3,000+ |
45
48
 
46
49
  ## Install
47
50
 
@@ -105,6 +108,10 @@ export default defineConfig({
105
108
  tab: "API Reference",
106
109
  openapi: "./openapi.yaml",
107
110
  },
111
+ {
112
+ tab: "MCP Server",
113
+ mcp: "./mcp.json",
114
+ },
108
115
  ],
109
116
  },
110
117
  navbar: {
@@ -117,7 +124,7 @@ export default defineConfig({
117
124
  });
118
125
  ```
119
126
 
120
- Each tab is either an `openapi` spec or `groups` of markdown pages. Pages are referenced by slug (e.g. `"quickstart"` resolves to `quickstart.md`).
127
+ Each tab is an `openapi` spec, an `mcp` snapshot, a `doxygen` directory, or `groups` of markdown pages. Pages are referenced by slug (e.g. `"quickstart"` resolves to `quickstart.md`).
121
128
 
122
129
  ### Markdown components
123
130
 
@@ -1 +1 @@
1
- {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Page.tsx"],"names":[],"mappings":"AAiPA,wBAAgB,IAAI,iCAqCnB"}
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/components/layout/Page.tsx"],"names":[],"mappings":"AAsPA,wBAAgB,IAAI,iCAqCnB"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
2
2
  import { useContext } from "preact/hooks";
3
- import { SpecContext, PageContext, NavigationContext, SiteContext } from "../../renderer/context.js";
3
+ import { SpecContext, PageContext, NavigationContext, OptionsContext, SiteContext } from "../../renderer/context.js";
4
4
  import { Markdown } from "../ui/Markdown.js";
5
5
  import { Header } from "./Header.js";
6
6
  import { Sidebar } from "./Sidebar.js";
@@ -32,6 +32,7 @@ function SpecPageContent({ className = "" }) {
32
32
  }
33
33
  function PageNavigation() {
34
34
  const nav = useContext(NavigationContext);
35
+ const options = useContext(OptionsContext);
35
36
  const activeTab = nav.tabs.find((t) => t.slug === nav.activeTabSlug);
36
37
  if (!activeTab)
37
38
  return null;
@@ -47,7 +48,8 @@ function PageNavigation() {
47
48
  const linkClass = "group flex flex-col gap-1 px-4 py-3 rounded-lg border border-[rgb(var(--color-gray-200)/0.7)] dark:border-[rgb(var(--color-gray-800)/0.5)] hover:border-[rgb(var(--color-primary)/0.4)] dark:hover:border-[rgb(var(--color-primary-light)/0.3)] transition-colors no-underline";
48
49
  const labelClass = "text-xs text-[rgb(var(--color-gray-500))] dark:text-[rgb(var(--color-gray-400))]";
49
50
  const titleClass = "text-sm font-medium text-[rgb(var(--color-gray-700))] dark:text-[rgb(var(--color-gray-300))] group-hover:text-[rgb(var(--color-primary-ink))] dark:group-hover:text-[rgb(var(--color-primary-light))] transition-colors";
50
- return (_jsxs("nav", { class: "mt-12 flex items-stretch justify-between gap-4", children: [prev ? (_jsxs("a", { href: prev.href, class: linkClass, children: [_jsx("span", { class: labelClass, children: "\u2190 Previous" }), _jsx("span", { class: titleClass, children: prev.label })] })) : _jsx("span", {}), next ? (_jsxs("a", { href: next.href, class: `${linkClass} text-right ml-auto`, children: [_jsx("span", { class: labelClass, children: "Next \u2192" }), _jsx("span", { class: titleClass, children: next.label })] })) : null] }));
51
+ const base = options.assetBase;
52
+ return (_jsxs("nav", { class: "mt-12 flex items-stretch justify-between gap-4", children: [prev ? (_jsxs("a", { href: `${base}${prev.href}`, class: linkClass, children: [_jsx("span", { class: labelClass, children: "\u2190 Previous" }), _jsx("span", { class: titleClass, children: prev.label })] })) : _jsx("span", {}), next ? (_jsxs("a", { href: `${base}${next.href}`, class: `${linkClass} text-right ml-auto`, children: [_jsx("span", { class: labelClass, children: "Next \u2192" }), _jsx("span", { class: titleClass, children: next.label })] })) : null] }));
51
53
  }
52
54
  function ContentFooter() {
53
55
  const site = useContext(SiteContext);
@@ -55,10 +57,13 @@ function ContentFooter() {
55
57
  const links = site.footer.links;
56
58
  // Build "Edit this page" URL when repo + editBranch are configured
57
59
  let editUrl;
58
- if (site.repo && site.editBranch && page.kind === "markdown" && page.markdown?.sourcePath) {
60
+ const editPath = page.kind === "markdown"
61
+ ? (page.markdown?.editPath === undefined ? page.markdown?.sourcePath : page.markdown?.editPath)
62
+ : undefined;
63
+ if (site.repo && site.editBranch && editPath) {
59
64
  const repoBase = site.repo.replace(/\/$/, "");
60
65
  const basePath = site.editBasePath ? `${site.editBasePath.replace(/^\/|\/$/g, "")}/` : "";
61
- editUrl = `${repoBase}/edit/${site.editBranch}/${basePath}${page.markdown.sourcePath}`;
66
+ editUrl = `${repoBase}/edit/${site.editBranch}/${basePath}${editPath}`;
62
67
  }
63
68
  const linkStyle = "hover:text-[rgb(var(--color-gray-600))] dark:hover:text-[rgb(var(--color-gray-300))] transition-colors";
64
69
  return (_jsxs("div", { class: "mt-16 mb-8 flex items-center justify-between border-t border-[rgb(var(--color-gray-200)/0.7)] dark:border-[rgb(var(--color-gray-800)/0.5)] pt-6 text-xs text-[rgb(var(--color-gray-500))] dark:text-[rgb(var(--color-gray-400))]", children: [_jsxs("a", { href: "https://sourcey.com", target: "_blank", rel: "noopener noreferrer", class: `flex items-center gap-1.5 ${linkStyle}`, children: ["Built with", _jsx("img", { src: "https://sourcey.com/sourcey-logo.png", alt: "Sourcey", class: "h-4 w-4" })] }), _jsxs("div", { class: "flex items-center gap-4", children: [editUrl && (_jsxs("a", { href: editUrl, target: "_blank", rel: "noopener noreferrer", class: `${linkStyle} flex items-center gap-1`, children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "w-3 h-3 mr-0.5", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125" }) }), "Edit this page"] })), links.map((link) => (_jsx("a", { href: link.href, target: "_blank", rel: "noopener noreferrer", "aria-label": link.label ?? socialLabels[link.type] ?? link.href, class: linkStyle, children: link.type === "link"
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,C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AAsB,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CA0BzG;AA6KD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO5C"}
package/dist/config.js CHANGED
@@ -255,7 +255,11 @@ export function slugify(name) {
255
255
  }
256
256
  /** Build a path under a tab, handling empty slugs (root-level tabs). */
257
257
  export function tabPath(tabSlug, file) {
258
- return tabSlug ? `${tabSlug}/${file}` : file;
258
+ if (!tabSlug)
259
+ return file;
260
+ if (file.startsWith(`${tabSlug}/`))
261
+ return file;
262
+ return `${tabSlug}/${file}`;
259
263
  }
260
264
  export function hexToRgb(hex) {
261
265
  const h = hex.replace("#", "");
@@ -6,5 +6,9 @@ export interface DoxygenResult {
6
6
  navTab: SiteTab;
7
7
  }
8
8
  export declare function normalizeDoxygenDescription(description: string, markdown: string): string;
9
+ export declare function rewriteGeneratedDoxygenIncludePath(includePath: string): string;
10
+ export declare function rewriteGeneratedDoxygenMarkdown(markdown: string): string;
11
+ export declare function rewriteGeneratedDoxygenHref(href: string): string;
12
+ export declare function rewriteGeneratedDoxygenHtmlLinks(html: string): string;
9
13
  export declare function loadDoxygenTab(config: ResolvedDoxygenConfig, tabSlug: string, tabLabel: string): Promise<DoxygenResult>;
10
14
  //# sourceMappingURL=doxygen-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doxygen-loader.d.ts","sourceRoot":"","sources":["../../src/core/doxygen-loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CA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,GACf,OAAO,CAAC,aAAa,CAAC,CAgGxB"}
@@ -8,6 +8,47 @@ export function normalizeDoxygenDescription(description, markdown) {
8
8
  const firstParagraph = extractFirstParagraph(markdown);
9
9
  return firstParagraph || description;
10
10
  }
11
+ export function rewriteGeneratedDoxygenIncludePath(includePath) {
12
+ const normalized = includePath.replace(/\\/g, "/");
13
+ if (!normalized.startsWith("/") && !/^[A-Za-z]:\//.test(normalized)) {
14
+ return includePath;
15
+ }
16
+ const includeMarker = "/include/";
17
+ const includeIndex = normalized.lastIndexOf(includeMarker);
18
+ if (includeIndex !== -1) {
19
+ return normalized.slice(includeIndex + includeMarker.length);
20
+ }
21
+ const srcMarker = "/src/";
22
+ const srcIndex = normalized.indexOf(srcMarker);
23
+ if (srcIndex !== -1) {
24
+ return normalized.slice(srcIndex + 1);
25
+ }
26
+ const basename = normalized.split("/").pop();
27
+ return basename || includePath;
28
+ }
29
+ export function rewriteGeneratedDoxygenMarkdown(markdown) {
30
+ return markdown.replace(/^#include ([<"])([^>\n"]+)([>"])$/gm, (_match, open, includePath, close) => {
31
+ return `#include ${open}${rewriteGeneratedDoxygenIncludePath(includePath)}${close}`;
32
+ });
33
+ }
34
+ export function rewriteGeneratedDoxygenHref(href) {
35
+ const [path, hash] = href.split("#", 2);
36
+ if (!path.startsWith("api_") || !path.endsWith(".md"))
37
+ return href;
38
+ const slug = path
39
+ .slice("api_".length, -".md".length)
40
+ .replace(/--/g, "-");
41
+ return `${slug}.html${hash ? `#${hash}` : ""}`;
42
+ }
43
+ export function rewriteGeneratedDoxygenHtmlLinks(html) {
44
+ return html
45
+ .replace(/href="(api_[^"]+?\.md(?:#[^"]*)?)"/g, (_match, href) => {
46
+ return `href="${rewriteGeneratedDoxygenHref(href)}"`;
47
+ })
48
+ .replace(/<code>\[([^\]]+)\]\((api_[^)]+?\.md(?:#[^)]+)?)\)<\/code>/g, (_match, label, href) => {
49
+ return `<a href="${rewriteGeneratedDoxygenHref(href)}"><code>${label}</code></a>`;
50
+ });
51
+ }
11
52
  export async function loadDoxygenTab(config, tabSlug, tabLabel) {
12
53
  const generated = await generate({
13
54
  directory: config.xml,
@@ -19,16 +60,18 @@ export async function loadDoxygenTab(config, tabSlug, tabLabel) {
19
60
  for (const page of generated) {
20
61
  if (!page.markdown.trim())
21
62
  continue;
22
- const description = normalizeDoxygenDescription(page.description, page.markdown);
23
- const html = renderMarkdown(page.markdown);
24
- const headings = extractHeadings(page.markdown);
63
+ const markdown = rewriteGeneratedDoxygenMarkdown(page.markdown);
64
+ const description = normalizeDoxygenDescription(page.description, markdown);
65
+ const html = rewriteGeneratedDoxygenHtmlLinks(renderMarkdown(markdown));
66
+ const headings = extractHeadings(markdown);
25
67
  pages.set(page.slug, {
26
68
  title: page.title,
27
69
  description,
28
70
  slug: page.slug,
29
71
  html,
30
72
  headings,
31
- sourcePath: config.xml,
73
+ sourcePath: `api/${page.slug}.md`,
74
+ editPath: page.kind === "group" ? `api/${page.slug}.md` : null,
32
75
  });
33
76
  // Group by the last segment of namespace (e.g. "icy::http" -> "http")
34
77
  const groupKey = page.module ?? lastSegment(page.namespace) ?? "API";
@@ -74,7 +117,8 @@ export async function loadDoxygenTab(config, tabSlug, tabLabel) {
74
117
  slug: indexSlug,
75
118
  html: indexHtml,
76
119
  headings: indexHeadings,
77
- sourcePath: config.xml,
120
+ sourcePath: `api/${indexSlug}.md`,
121
+ editPath: null,
78
122
  });
79
123
  groups.unshift({
80
124
  label: tabLabel,
@@ -12,6 +12,8 @@ export interface MarkdownPage {
12
12
  headings: PageHeading[];
13
13
  /** Original file path (for error messages and dev server watching) */
14
14
  sourcePath: string;
15
+ /** Optional repo-relative path used for "Edit this page" links. Null disables the link. */
16
+ editPath?: string | null;
15
17
  }
16
18
  export type { PageHeading } from "../utils/markdown.js";
17
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-loader.d.ts","sourceRoot":"","sources":["../../src/core/markdown-loader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmC,KAAK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