@veluai/velu 0.2.25 → 0.2.27

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.
Files changed (114) hide show
  1. package/README.md +80 -80
  2. package/dist/cli.js +44 -44
  3. package/package.json +64 -64
  4. package/runtime/velu-ui/base.css +320 -320
  5. package/runtime/velu-ui/components/Accordion.jsx +64 -64
  6. package/runtime/velu-ui/components/ApiClient.jsx +207 -207
  7. package/runtime/velu-ui/components/ApiField.jsx +87 -87
  8. package/runtime/velu-ui/components/ApiPath.jsx +63 -63
  9. package/runtime/velu-ui/components/ApiReferencePage.jsx +384 -384
  10. package/runtime/velu-ui/components/ApiSamples.jsx +36 -36
  11. package/runtime/velu-ui/components/ApiSidebar.jsx +125 -125
  12. package/runtime/velu-ui/components/AskBar.jsx +71 -71
  13. package/runtime/velu-ui/components/Callout.jsx +114 -114
  14. package/runtime/velu-ui/components/Card.jsx +131 -131
  15. package/runtime/velu-ui/components/ChangelogFilters.jsx +75 -75
  16. package/runtime/velu-ui/components/Chatbot.jsx +972 -972
  17. package/runtime/velu-ui/components/CodeBlock.jsx +375 -375
  18. package/runtime/velu-ui/components/Columns.jsx +56 -56
  19. package/runtime/velu-ui/components/ContextMenu.jsx +327 -327
  20. package/runtime/velu-ui/components/ErrorCard.jsx +138 -138
  21. package/runtime/velu-ui/components/Field.jsx +81 -81
  22. package/runtime/velu-ui/components/Image.jsx +163 -163
  23. package/runtime/velu-ui/components/Logo.jsx +31 -31
  24. package/runtime/velu-ui/components/MethodBadge.jsx +31 -31
  25. package/runtime/velu-ui/components/NavSelect.jsx +108 -108
  26. package/runtime/velu-ui/components/NotFound.jsx +63 -63
  27. package/runtime/velu-ui/components/PageFeedback.jsx +219 -219
  28. package/runtime/velu-ui/components/PageFooter.jsx +145 -145
  29. package/runtime/velu-ui/components/PageHeader.jsx +422 -422
  30. package/runtime/velu-ui/components/PageNav.jsx +77 -77
  31. package/runtime/velu-ui/components/PoweredBy.jsx +51 -51
  32. package/runtime/velu-ui/components/Prompt.jsx +115 -115
  33. package/runtime/velu-ui/components/Search.jsx +460 -460
  34. package/runtime/velu-ui/components/Sidebar.jsx +246 -246
  35. package/runtime/velu-ui/components/SocialLinks.jsx +90 -90
  36. package/runtime/velu-ui/components/Steps.jsx +65 -65
  37. package/runtime/velu-ui/components/ThemeToggle.jsx +48 -48
  38. package/runtime/velu-ui/components/Toc.jsx +537 -537
  39. package/runtime/velu-ui/components/TocBar.jsx +195 -195
  40. package/runtime/velu-ui/components/Tree.jsx +87 -87
  41. package/runtime/velu-ui/components/TryItBar.jsx +102 -102
  42. package/runtime/velu-ui/components/Update.jsx +92 -92
  43. package/runtime/velu-ui/components/accordion.css +92 -92
  44. package/runtime/velu-ui/components/api-page.css +208 -208
  45. package/runtime/velu-ui/components/api.css +635 -635
  46. package/runtime/velu-ui/components/ask-bar.css +103 -103
  47. package/runtime/velu-ui/components/card.css +105 -105
  48. package/runtime/velu-ui/components/changelog-filters.css +43 -43
  49. package/runtime/velu-ui/components/chatbot.css +687 -687
  50. package/runtime/velu-ui/components/code-block.css +263 -263
  51. package/runtime/velu-ui/components/context-menu.css +199 -199
  52. package/runtime/velu-ui/components/docs-layout.css +822 -822
  53. package/runtime/velu-ui/components/field.css +82 -82
  54. package/runtime/velu-ui/components/image.css +237 -237
  55. package/runtime/velu-ui/components/nav-select.css +157 -157
  56. package/runtime/velu-ui/components/not-found.css +94 -94
  57. package/runtime/velu-ui/components/page-feedback.css +261 -261
  58. package/runtime/velu-ui/components/page-footer.css +130 -130
  59. package/runtime/velu-ui/components/page-header.css +558 -558
  60. package/runtime/velu-ui/components/page-nav.css +50 -50
  61. package/runtime/velu-ui/components/powered-by.css +92 -92
  62. package/runtime/velu-ui/components/prompt.css +99 -99
  63. package/runtime/velu-ui/components/search.css +307 -307
  64. package/runtime/velu-ui/components/sidebar.css +205 -205
  65. package/runtime/velu-ui/components/steps.css +77 -77
  66. package/runtime/velu-ui/components/theme-toggle.css +102 -102
  67. package/runtime/velu-ui/components/toc-bar.css +234 -234
  68. package/runtime/velu-ui/components/tree.css +49 -49
  69. package/runtime/velu-ui/components/update.css +111 -111
  70. package/runtime/velu-ui/index.js +58 -58
  71. package/runtime/velu-ui/lib/api-send.js +118 -118
  72. package/runtime/velu-ui/lib/brand-icons.jsx +103 -103
  73. package/runtime/velu-ui/lib/component-schemas.js +100 -100
  74. package/runtime/velu-ui/lib/copyText.js +64 -64
  75. package/runtime/velu-ui/lib/docs-assistant.js +273 -273
  76. package/runtime/velu-ui/lib/lang-icons.jsx +147 -147
  77. package/runtime/velu-ui/lib/page-feedback.js +72 -72
  78. package/runtime/velu-ui/lib/pagefind.js +116 -116
  79. package/runtime/velu-ui/lib/prism-langs.js +957 -957
  80. package/runtime/velu-ui/lib/prism-loader.js +74 -74
  81. package/runtime/velu-ui/lib/resolveIcon.jsx +29 -29
  82. package/runtime/velu-ui/lib/scrollIntoNearestView.js +66 -66
  83. package/runtime/velu-ui/mdx-components.jsx +107 -107
  84. package/runtime/velu-ui/primitives/Cluster.jsx +49 -49
  85. package/runtime/velu-ui/primitives/Stack.jsx +63 -63
  86. package/runtime/velu-ui/primitives/Switcher.jsx +57 -57
  87. package/runtime/velu-ui/primitives/stack.css +3 -3
  88. package/runtime/velu-ui/primitives/switcher.css +25 -25
  89. package/runtime/velu-ui/styles.css +48 -48
  90. package/runtime/velu-ui/tokens.css +4 -4
  91. package/schema/velu.schema.json +419 -419
  92. package/src/lib/extract-mdx-error.js +170 -170
  93. package/src/lib/issues.js +159 -159
  94. package/src/lib/known-components.js +35 -35
  95. package/src/navigation.js +459 -459
  96. package/src/runtime/App.jsx +1754 -1754
  97. package/src/runtime/ErrorBoundary.jsx +54 -54
  98. package/src/runtime/client-entry.jsx +27 -27
  99. package/src/runtime/server-entry.jsx +24 -24
  100. package/src/template.html +48 -48
  101. package/templates/starter/ai-tools/claude-code.mdx +26 -26
  102. package/templates/starter/ai-tools/cursor.mdx +17 -17
  103. package/templates/starter/api-reference/introduction.mdx +43 -43
  104. package/templates/starter/development.mdx +19 -19
  105. package/templates/starter/essentials/code.mdx +29 -29
  106. package/templates/starter/essentials/images.mdx +29 -29
  107. package/templates/starter/essentials/markdown.mdx +25 -25
  108. package/templates/starter/essentials/navigation.mdx +39 -39
  109. package/templates/starter/essentials/settings.mdx +30 -30
  110. package/templates/starter/favicon.svg +6 -6
  111. package/templates/starter/index.mdx +31 -31
  112. package/templates/starter/openapi.json +160 -160
  113. package/templates/starter/quickstart.mdx +31 -31
  114. package/templates/starter/velu.json +40 -40
@@ -1,54 +1,54 @@
1
- import React from 'react';
2
- import { ErrorCard } from 'velu-ui';
3
- import { extractMdxError } from '../lib/extract-mdx-error.js';
4
- import { CATEGORY_LABEL } from '../lib/issues.js';
5
- import { KNOWN_COMPONENTS } from '../lib/known-components.js';
6
-
7
- /**
8
- * Catches render-time errors from the current page (unknown component, a
9
- * component that threw on a bad prop, etc.) and renders a branded ErrorCard in
10
- * its place — leaving the surrounding chrome (header, sidebar, TOC) mounted.
11
- *
12
- * This is the CLIENT-side safety net: when the reader navigates (react-router,
13
- * no full reload) to a page that throws, the chrome stays put and only the
14
- * body shows the card. On a direct load / reload of a broken page the error
15
- * happens during SSR instead — React's renderToString doesn't recover through
16
- * error boundaries, so the dev server catches it there and serves the
17
- * full-page branded error (and logs it to the terminal).
18
- *
19
- * In `App.jsx` it's keyed by `pathname`, so navigating to another page (or
20
- * fixing the file and reloading) remounts it and clears the error.
21
- */
22
- export default class ErrorBoundary extends React.Component {
23
- constructor(props) {
24
- super(props);
25
- this.state = { error: null };
26
- }
27
-
28
- static getDerivedStateFromError(error) {
29
- return { error };
30
- }
31
-
32
- render() {
33
- const { error } = this.state;
34
- if (!error) return this.props.children;
35
-
36
- const issue = extractMdxError(error, {
37
- knownComponents: KNOWN_COMPONENTS,
38
- file: this.props.file || null,
39
- });
40
- return (
41
- <ErrorCard
42
- label={CATEGORY_LABEL[issue.category] || issue.category}
43
- title={issue.title}
44
- file={issue.file}
45
- line={issue.line}
46
- column={issue.column}
47
- frame={issue.frame}
48
- detail={issue.detail}
49
- hint={issue.hint}
50
- suggestion={issue.suggestion}
51
- />
52
- );
53
- }
54
- }
1
+ import React from 'react';
2
+ import { ErrorCard } from 'velu-ui';
3
+ import { extractMdxError } from '../lib/extract-mdx-error.js';
4
+ import { CATEGORY_LABEL } from '../lib/issues.js';
5
+ import { KNOWN_COMPONENTS } from '../lib/known-components.js';
6
+
7
+ /**
8
+ * Catches render-time errors from the current page (unknown component, a
9
+ * component that threw on a bad prop, etc.) and renders a branded ErrorCard in
10
+ * its place — leaving the surrounding chrome (header, sidebar, TOC) mounted.
11
+ *
12
+ * This is the CLIENT-side safety net: when the reader navigates (react-router,
13
+ * no full reload) to a page that throws, the chrome stays put and only the
14
+ * body shows the card. On a direct load / reload of a broken page the error
15
+ * happens during SSR instead — React's renderToString doesn't recover through
16
+ * error boundaries, so the dev server catches it there and serves the
17
+ * full-page branded error (and logs it to the terminal).
18
+ *
19
+ * In `App.jsx` it's keyed by `pathname`, so navigating to another page (or
20
+ * fixing the file and reloading) remounts it and clears the error.
21
+ */
22
+ export default class ErrorBoundary extends React.Component {
23
+ constructor(props) {
24
+ super(props);
25
+ this.state = { error: null };
26
+ }
27
+
28
+ static getDerivedStateFromError(error) {
29
+ return { error };
30
+ }
31
+
32
+ render() {
33
+ const { error } = this.state;
34
+ if (!error) return this.props.children;
35
+
36
+ const issue = extractMdxError(error, {
37
+ knownComponents: KNOWN_COMPONENTS,
38
+ file: this.props.file || null,
39
+ });
40
+ return (
41
+ <ErrorCard
42
+ label={CATEGORY_LABEL[issue.category] || issue.category}
43
+ title={issue.title}
44
+ file={issue.file}
45
+ line={issue.line}
46
+ column={issue.column}
47
+ frame={issue.frame}
48
+ detail={issue.detail}
49
+ hint={issue.hint}
50
+ suggestion={issue.suggestion}
51
+ />
52
+ );
53
+ }
54
+ }
@@ -1,27 +1,27 @@
1
- import React from 'react';
2
- import { hydrateRoot } from 'react-dom/client';
3
- import { BrowserRouter } from 'react-router-dom';
4
- import 'velu-ui/styles.css';
5
- import App from './App.jsx';
6
-
7
- // Subpath hosting: Vite sets BASE_URL from the build's `base` (e.g. "/docs/").
8
- // React Router wants a basename WITHOUT the trailing slash ("/docs"); the root
9
- // case ("/") becomes undefined so the router behaves as if mounted at origin.
10
- const basename = (import.meta.env.BASE_URL || '/').replace(/\/$/, '') || undefined;
11
-
12
- hydrateRoot(
13
- document.getElementById('root'),
14
- <BrowserRouter basename={basename}>
15
- <App />
16
- </BrowserRouter>
17
- );
18
-
19
- // Dev only: the SSR-inlined critical CSS (<style data-velu-ssr>) exists just
20
- // to avoid FOUC on first paint. By now Vite has injected its own HMR-managed
21
- // stylesheet from the `velu-ui/styles.css` import above, so drop the stale
22
- // inline copy — otherwise it shadows hot CSS updates and edits don't apply.
23
- if (import.meta.hot) {
24
- for (const el of document.querySelectorAll('style[data-velu-ssr]')) {
25
- el.remove();
26
- }
27
- }
1
+ import React from 'react';
2
+ import { hydrateRoot } from 'react-dom/client';
3
+ import { BrowserRouter } from 'react-router-dom';
4
+ import 'velu-ui/styles.css';
5
+ import App from './App.jsx';
6
+
7
+ // Subpath hosting: Vite sets BASE_URL from the build's `base` (e.g. "/docs/").
8
+ // React Router wants a basename WITHOUT the trailing slash ("/docs"); the root
9
+ // case ("/") becomes undefined so the router behaves as if mounted at origin.
10
+ const basename = (import.meta.env.BASE_URL || '/').replace(/\/$/, '') || undefined;
11
+
12
+ hydrateRoot(
13
+ document.getElementById('root'),
14
+ <BrowserRouter basename={basename}>
15
+ <App />
16
+ </BrowserRouter>
17
+ );
18
+
19
+ // Dev only: the SSR-inlined critical CSS (<style data-velu-ssr>) exists just
20
+ // to avoid FOUC on first paint. By now Vite has injected its own HMR-managed
21
+ // stylesheet from the `velu-ui/styles.css` import above, so drop the stale
22
+ // inline copy — otherwise it shadows hot CSS updates and edits don't apply.
23
+ if (import.meta.hot) {
24
+ for (const el of document.querySelectorAll('style[data-velu-ssr]')) {
25
+ el.remove();
26
+ }
27
+ }
@@ -1,24 +1,24 @@
1
- import React from 'react';
2
- import { renderToString } from 'react-dom/server';
3
- import { StaticRouter } from 'react-router-dom/server';
4
- // Side-effect import: stubbed to empty during SSR, but it registers the
5
- // stylesheet in Vite's SSR module graph so dev-server.js can collect and
6
- // inline it into <head> (flicker-free SSR).
7
- import 'velu-ui/styles.css';
8
- import App from './App.jsx';
9
-
10
- // Subpath hosting: mirror the client's basename (from Vite's BASE_URL). The
11
- // prerender is driven by root-relative route paths ("/foo"), so the location
12
- // handed to StaticRouter must carry the basename prefix ("/docs/foo") for it to
13
- // match — and so the rendered <Link> hrefs come out prefixed too, matching what
14
- // the hydrated BrowserRouter produces.
15
- const basename = (import.meta.env.BASE_URL || '/').replace(/\/$/, '');
16
-
17
- export async function render(url) {
18
- const location = basename ? `${basename}${url}` : url;
19
- return renderToString(
20
- <StaticRouter basename={basename || undefined} location={location}>
21
- <App />
22
- </StaticRouter>
23
- );
24
- }
1
+ import React from 'react';
2
+ import { renderToString } from 'react-dom/server';
3
+ import { StaticRouter } from 'react-router-dom/server';
4
+ // Side-effect import: stubbed to empty during SSR, but it registers the
5
+ // stylesheet in Vite's SSR module graph so dev-server.js can collect and
6
+ // inline it into <head> (flicker-free SSR).
7
+ import 'velu-ui/styles.css';
8
+ import App from './App.jsx';
9
+
10
+ // Subpath hosting: mirror the client's basename (from Vite's BASE_URL). The
11
+ // prerender is driven by root-relative route paths ("/foo"), so the location
12
+ // handed to StaticRouter must carry the basename prefix ("/docs/foo") for it to
13
+ // match — and so the rendered <Link> hrefs come out prefixed too, matching what
14
+ // the hydrated BrowserRouter produces.
15
+ const basename = (import.meta.env.BASE_URL || '/').replace(/\/$/, '');
16
+
17
+ export async function render(url) {
18
+ const location = basename ? `${basename}${url}` : url;
19
+ return renderToString(
20
+ <StaticRouter basename={basename || undefined} location={location}>
21
+ <App />
22
+ </StaticRouter>
23
+ );
24
+ }
package/src/template.html CHANGED
@@ -1,48 +1,48 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title><!--app-title--></title>
7
- <link rel="preconnect" href="https://fonts.googleapis.com" />
8
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
- <link
10
- rel="stylesheet"
11
- href="https://fonts.googleapis.com/css2?family=Google+Sans+Code:wght@400;500&family=Google+Sans+Flex:opsz,wght@6..144,1..1000&family=Outfit:wght@300;400;500&display=swap"
12
- />
13
- <script>
14
- // Anti-flash: set the theme BEFORE first paint so CSS vars resolve
15
- // correctly on frame 1. Two-state; first visit follows the OS, an
16
- // explicit choice (localStorage) is remembered and overrides the OS.
17
- (function () {
18
- try {
19
- var KEY = 'velu-theme';
20
- var mq = matchMedia('(prefers-color-scheme: dark)');
21
- var saved = localStorage.getItem(KEY);
22
- var theme =
23
- saved === 'light' || saved === 'dark'
24
- ? saved
25
- : mq.matches
26
- ? 'dark'
27
- : 'light';
28
- document.documentElement.dataset.theme = theme;
29
- // Track the OS only until the user makes an explicit choice.
30
- mq.addEventListener('change', function () {
31
- var s = localStorage.getItem(KEY);
32
- if (s !== 'light' && s !== 'dark')
33
- document.documentElement.dataset.theme = mq.matches
34
- ? 'dark'
35
- : 'light';
36
- });
37
- } catch (e) {
38
- document.documentElement.dataset.theme = 'light';
39
- }
40
- })();
41
- </script>
42
- <!--app-head-->
43
- </head>
44
- <body>
45
- <div id="root"><!--app-html--></div>
46
- <script type="module" src="/src/runtime/client-entry.jsx"></script>
47
- </body>
48
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title><!--app-title--></title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
+ <link
10
+ rel="stylesheet"
11
+ href="https://fonts.googleapis.com/css2?family=Google+Sans+Code:wght@400;500&family=Google+Sans+Flex:opsz,wght@6..144,1..1000&family=Outfit:wght@300;400;500&display=swap"
12
+ />
13
+ <script>
14
+ // Anti-flash: set the theme BEFORE first paint so CSS vars resolve
15
+ // correctly on frame 1. Two-state; first visit follows the OS, an
16
+ // explicit choice (localStorage) is remembered and overrides the OS.
17
+ (function () {
18
+ try {
19
+ var KEY = 'velu-theme';
20
+ var mq = matchMedia('(prefers-color-scheme: dark)');
21
+ var saved = localStorage.getItem(KEY);
22
+ var theme =
23
+ saved === 'light' || saved === 'dark'
24
+ ? saved
25
+ : mq.matches
26
+ ? 'dark'
27
+ : 'light';
28
+ document.documentElement.dataset.theme = theme;
29
+ // Track the OS only until the user makes an explicit choice.
30
+ mq.addEventListener('change', function () {
31
+ var s = localStorage.getItem(KEY);
32
+ if (s !== 'light' && s !== 'dark')
33
+ document.documentElement.dataset.theme = mq.matches
34
+ ? 'dark'
35
+ : 'light';
36
+ });
37
+ } catch (e) {
38
+ document.documentElement.dataset.theme = 'light';
39
+ }
40
+ })();
41
+ </script>
42
+ <!--app-head-->
43
+ </head>
44
+ <body>
45
+ <div id="root"><!--app-html--></div>
46
+ <script type="module" src="/src/runtime/client-entry.jsx"></script>
47
+ </body>
48
+ </html>
@@ -1,26 +1,26 @@
1
- ---
2
- title: Claude Code
3
- description: Work on your docs with Claude Code.
4
- ---
5
-
6
- Claude Code can read your `velu.json` and `.mdx` files to draft pages,
7
- restructure navigation, and keep content consistent.
8
-
9
- <Callout type="tip">
10
- Keep page paths and `navigation` in sync — ask Claude to add a page
11
- and wire it into the right group in one step.
12
- </Callout>
13
-
14
- ## Suggested workflow
15
-
16
- <Steps>
17
- <Step title="Describe the page">
18
- Tell Claude the title and what it should cover.
19
- </Step>
20
- <Step title="Review the draft">
21
- Claude writes the `.mdx` and adds it to `navigation`.
22
- </Step>
23
- <Step title="Preview">
24
- `velu dev` reloads so you can read it in place.
25
- </Step>
26
- </Steps>
1
+ ---
2
+ title: Claude Code
3
+ description: Work on your docs with Claude Code.
4
+ ---
5
+
6
+ Claude Code can read your `velu.json` and `.mdx` files to draft pages,
7
+ restructure navigation, and keep content consistent.
8
+
9
+ <Callout type="tip">
10
+ Keep page paths and `navigation` in sync — ask Claude to add a page
11
+ and wire it into the right group in one step.
12
+ </Callout>
13
+
14
+ ## Suggested workflow
15
+
16
+ <Steps>
17
+ <Step title="Describe the page">
18
+ Tell Claude the title and what it should cover.
19
+ </Step>
20
+ <Step title="Review the draft">
21
+ Claude writes the `.mdx` and adds it to `navigation`.
22
+ </Step>
23
+ <Step title="Preview">
24
+ `velu dev` reloads so you can read it in place.
25
+ </Step>
26
+ </Steps>
@@ -1,17 +1,17 @@
1
- ---
2
- title: Cursor
3
- description: Edit your docs in Cursor.
4
- ---
5
-
6
- Cursor's editor understands your project structure, so it can complete
7
- `navigation` entries and scaffold pages from a prompt.
8
-
9
- <Callout type="note">
10
- Point Cursor at `velu.json` when asking it to reorganize the sidebar
11
- — that's the single source of truth for structure.
12
- </Callout>
13
-
14
- ## Tips
15
-
16
- - Reference an existing page as a style example when drafting a new one.
17
- - Ask for a whole group at once, then refine page by page.
1
+ ---
2
+ title: Cursor
3
+ description: Edit your docs in Cursor.
4
+ ---
5
+
6
+ Cursor's editor understands your project structure, so it can complete
7
+ `navigation` entries and scaffold pages from a prompt.
8
+
9
+ <Callout type="note">
10
+ Point Cursor at `velu.json` when asking it to reorganize the sidebar
11
+ — that's the single source of truth for structure.
12
+ </Callout>
13
+
14
+ ## Tips
15
+
16
+ - Reference an existing page as a style example when drafting a new one.
17
+ - Ask for a whole group at once, then refine page by page.
@@ -1,43 +1,43 @@
1
- ---
2
- title: Introduction
3
- description: How this API reference is generated.
4
- ---
5
-
6
- The endpoints in this tab are generated automatically from an OpenAPI
7
- spec (`openapi.json`). Each operation becomes its own page — with
8
- parameters, request body, and responses — and an interactive **Try It**
9
- playground you can use to send real requests.
10
-
11
- <Callout type="note">
12
- This is a second tab ("API Reference"). Tabs let you keep guides and
13
- reference docs in separate top-level sections of the same site. Point
14
- the tab's `openapi` field at your own spec to replace this example.
15
- </Callout>
16
-
17
- ## How it works
18
-
19
- Add an `openapi` field to a tab (or group) in `velu.json`:
20
-
21
- ```json
22
- {
23
- "tab": "API Reference",
24
- "openapi": "/openapi.json"
25
- }
26
- ```
27
-
28
- Velu reads the spec, groups the operations by their tag, and renders a
29
- page per endpoint. No hand-written endpoint pages required.
30
-
31
- ## The example API
32
-
33
- This starter points at a live demo API — a small **product catalog**
34
- backed by [dummyjson.com](https://dummyjson.com). Open any endpoint in
35
- the sidebar, hit **Try It**, and send a real request:
36
-
37
- - **Get a product** — try `id` = `1`
38
- - **Search products** — try `q` = `phone`
39
- - **Add a product** — the body is pre-filled; Send returns a created product
40
-
41
- Requests are routed through the dev server's proxy so they aren't blocked
42
- by CORS. Set `api.playground.proxy` to `false` to send straight from the
43
- browser.
1
+ ---
2
+ title: Introduction
3
+ description: How this API reference is generated.
4
+ ---
5
+
6
+ The endpoints in this tab are generated automatically from an OpenAPI
7
+ spec (`openapi.json`). Each operation becomes its own page — with
8
+ parameters, request body, and responses — and an interactive **Try It**
9
+ playground you can use to send real requests.
10
+
11
+ <Callout type="note">
12
+ This is a second tab ("API Reference"). Tabs let you keep guides and
13
+ reference docs in separate top-level sections of the same site. Point
14
+ the tab's `openapi` field at your own spec to replace this example.
15
+ </Callout>
16
+
17
+ ## How it works
18
+
19
+ Add an `openapi` field to a tab (or group) in `velu.json`:
20
+
21
+ ```json
22
+ {
23
+ "tab": "API Reference",
24
+ "openapi": "/openapi.json"
25
+ }
26
+ ```
27
+
28
+ Velu reads the spec, groups the operations by their tag, and renders a
29
+ page per endpoint. No hand-written endpoint pages required.
30
+
31
+ ## The example API
32
+
33
+ This starter points at a live demo API — a small **product catalog**
34
+ backed by [dummyjson.com](https://dummyjson.com). Open any endpoint in
35
+ the sidebar, hit **Try It**, and send a real request:
36
+
37
+ - **Get a product** — try `id` = `1`
38
+ - **Search products** — try `q` = `phone`
39
+ - **Add a product** — the body is pre-filled; Send returns a created product
40
+
41
+ Requests are routed through the dev server's proxy so they aren't blocked
42
+ by CORS. Set `api.playground.proxy` to `false` to send straight from the
43
+ browser.
@@ -1,19 +1,19 @@
1
- ---
2
- title: Development
3
- description: Preview your docs locally as you write.
4
- ---
5
-
6
- `velu dev` serves your project with server-side rendering and live
7
- reload, so what you see locally matches production.
8
-
9
- <Callout type="note">
10
- The dev server reads `velu.json` from the folder you point it at.
11
- Run it from your project root, or pass the path: `velu dev ./docs`.
12
- </Callout>
13
-
14
- ## What reloads automatically
15
-
16
- - Editing any `.mdx` page reloads that page.
17
- - Editing `velu.json` (colors, font, favicon, navigation) re-renders
18
- the whole site.
19
- - Adding or removing a page file updates the route map.
1
+ ---
2
+ title: Development
3
+ description: Preview your docs locally as you write.
4
+ ---
5
+
6
+ `velu dev` serves your project with server-side rendering and live
7
+ reload, so what you see locally matches production.
8
+
9
+ <Callout type="note">
10
+ The dev server reads `velu.json` from the folder you point it at.
11
+ Run it from your project root, or pass the path: `velu dev ./docs`.
12
+ </Callout>
13
+
14
+ ## What reloads automatically
15
+
16
+ - Editing any `.mdx` page reloads that page.
17
+ - Editing `velu.json` (colors, font, favicon, navigation) re-renders
18
+ the whole site.
19
+ - Adding or removing a page file updates the route map.
@@ -1,29 +1,29 @@
1
- ---
2
- title: Code blocks
3
- description: Syntax-highlighted code and groups.
4
- ---
5
-
6
- Fenced code blocks are upgraded to a rich code component with a copy
7
- button and a language label.
8
-
9
- ```js
10
- export function greet(name) {
11
- return `Hello, ${name}!`;
12
- }
13
- ```
14
-
15
- ## Code groups
16
-
17
- Show the same example in several languages with a `CodeGroup`. Each
18
- alternative is a `<CodeBlock>` with a `title` (the tab label) and a
19
- `language` (drives syntax highlighting and the tab's language icon):
20
-
21
- <CodeGroup>
22
- <CodeBlock title="index.js" language="javascript">
23
- {`fetch('/api/hello').then((r) => r.json());`}
24
- </CodeBlock>
25
- <CodeBlock title="main.py" language="python">
26
- {`import requests
27
- requests.get('/api/hello').json()`}
28
- </CodeBlock>
29
- </CodeGroup>
1
+ ---
2
+ title: Code blocks
3
+ description: Syntax-highlighted code and groups.
4
+ ---
5
+
6
+ Fenced code blocks are upgraded to a rich code component with a copy
7
+ button and a language label.
8
+
9
+ ```js
10
+ export function greet(name) {
11
+ return `Hello, ${name}!`;
12
+ }
13
+ ```
14
+
15
+ ## Code groups
16
+
17
+ Show the same example in several languages with a `CodeGroup`. Each
18
+ alternative is a `<CodeBlock>` with a `title` (the tab label) and a
19
+ `language` (drives syntax highlighting and the tab's language icon):
20
+
21
+ <CodeGroup>
22
+ <CodeBlock title="index.js" language="javascript">
23
+ {`fetch('/api/hello').then((r) => r.json());`}
24
+ </CodeBlock>
25
+ <CodeBlock title="main.py" language="python">
26
+ {`import requests
27
+ requests.get('/api/hello').json()`}
28
+ </CodeBlock>
29
+ </CodeGroup>
@@ -1,29 +1,29 @@
1
- ---
2
- title: Images
3
- description: Add images and visual media.
4
- ---
5
-
6
- Use standard Markdown images, or the `Image` component for captions
7
- and framing.
8
-
9
- ```md
10
- ![Alt text](/images/diagram.png)
11
- ```
12
-
13
- <Callout type="tip">
14
- Put assets in a folder like `/images` at your project root and
15
- reference them with an absolute path.
16
- </Callout>
17
-
18
- ## Cards with media
19
-
20
- Cards can hold images, prose, or anything else:
21
-
22
- <CardGroup>
23
- <Card title="Light & dark" icon="moon">
24
- Assets and colors adapt to the active theme.
25
- </Card>
26
- <Card title="Responsive" icon="smartphone">
27
- Layout reflows cleanly from desktop to mobile.
28
- </Card>
29
- </CardGroup>
1
+ ---
2
+ title: Images
3
+ description: Add images and visual media.
4
+ ---
5
+
6
+ Use standard Markdown images, or the `Image` component for captions
7
+ and framing.
8
+
9
+ ```md
10
+ ![Alt text](/images/diagram.png)
11
+ ```
12
+
13
+ <Callout type="tip">
14
+ Put assets in a folder like `/images` at your project root and
15
+ reference them with an absolute path.
16
+ </Callout>
17
+
18
+ ## Cards with media
19
+
20
+ Cards can hold images, prose, or anything else:
21
+
22
+ <CardGroup>
23
+ <Card title="Light & dark" icon="moon">
24
+ Assets and colors adapt to the active theme.
25
+ </Card>
26
+ <Card title="Responsive" icon="smartphone">
27
+ Layout reflows cleanly from desktop to mobile.
28
+ </Card>
29
+ </CardGroup>