@veluai/velu 0.2.13 → 0.2.15
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 +80 -80
- package/dist/cli.js +37 -37
- package/package.json +64 -64
- package/runtime/velu-ui/base.css +320 -320
- package/runtime/velu-ui/components/Accordion.jsx +64 -64
- package/runtime/velu-ui/components/ApiClient.jsx +207 -207
- package/runtime/velu-ui/components/ApiField.jsx +87 -87
- package/runtime/velu-ui/components/ApiPath.jsx +63 -63
- package/runtime/velu-ui/components/ApiReferencePage.jsx +384 -384
- package/runtime/velu-ui/components/ApiSamples.jsx +36 -36
- package/runtime/velu-ui/components/ApiSidebar.jsx +122 -122
- package/runtime/velu-ui/components/AskBar.jsx +71 -71
- package/runtime/velu-ui/components/Callout.jsx +114 -114
- package/runtime/velu-ui/components/Card.jsx +131 -131
- package/runtime/velu-ui/components/Chatbot.jsx +885 -885
- package/runtime/velu-ui/components/CodeBlock.jsx +375 -375
- package/runtime/velu-ui/components/Columns.jsx +56 -56
- package/runtime/velu-ui/components/ContextMenu.jsx +298 -273
- package/runtime/velu-ui/components/ErrorCard.jsx +138 -138
- package/runtime/velu-ui/components/Field.jsx +81 -81
- package/runtime/velu-ui/components/Image.jsx +163 -163
- package/runtime/velu-ui/components/Logo.jsx +31 -31
- package/runtime/velu-ui/components/MethodBadge.jsx +31 -31
- package/runtime/velu-ui/components/NavSelect.jsx +108 -108
- package/runtime/velu-ui/components/NotFound.jsx +63 -63
- package/runtime/velu-ui/components/PageFeedback.jsx +219 -219
- package/runtime/velu-ui/components/PageFooter.jsx +145 -145
- package/runtime/velu-ui/components/PageHeader.jsx +422 -422
- package/runtime/velu-ui/components/PageNav.jsx +77 -77
- package/runtime/velu-ui/components/PoweredBy.jsx +51 -51
- package/runtime/velu-ui/components/Prompt.jsx +115 -115
- package/runtime/velu-ui/components/Search.jsx +460 -460
- package/runtime/velu-ui/components/Sidebar.jsx +254 -254
- package/runtime/velu-ui/components/SocialLinks.jsx +90 -90
- package/runtime/velu-ui/components/Steps.jsx +65 -65
- package/runtime/velu-ui/components/ThemeToggle.jsx +48 -48
- package/runtime/velu-ui/components/Toc.jsx +537 -537
- package/runtime/velu-ui/components/TocBar.jsx +195 -195
- package/runtime/velu-ui/components/Tree.jsx +87 -87
- package/runtime/velu-ui/components/TryItBar.jsx +102 -102
- package/runtime/velu-ui/components/accordion.css +92 -92
- package/runtime/velu-ui/components/api-page.css +208 -208
- package/runtime/velu-ui/components/api.css +635 -635
- package/runtime/velu-ui/components/ask-bar.css +94 -94
- package/runtime/velu-ui/components/card.css +105 -105
- package/runtime/velu-ui/components/chatbot.css +622 -622
- package/runtime/velu-ui/components/code-block.css +263 -263
- package/runtime/velu-ui/components/context-menu.css +173 -173
- package/runtime/velu-ui/components/docs-layout.css +822 -822
- package/runtime/velu-ui/components/field.css +82 -82
- package/runtime/velu-ui/components/image.css +237 -237
- package/runtime/velu-ui/components/nav-select.css +157 -157
- package/runtime/velu-ui/components/not-found.css +94 -94
- package/runtime/velu-ui/components/page-feedback.css +241 -241
- package/runtime/velu-ui/components/page-footer.css +130 -130
- package/runtime/velu-ui/components/page-header.css +558 -558
- package/runtime/velu-ui/components/page-nav.css +50 -50
- package/runtime/velu-ui/components/powered-by.css +92 -92
- package/runtime/velu-ui/components/prompt.css +99 -99
- package/runtime/velu-ui/components/search.css +307 -307
- package/runtime/velu-ui/components/sidebar.css +205 -205
- package/runtime/velu-ui/components/steps.css +77 -77
- package/runtime/velu-ui/components/theme-toggle.css +102 -102
- package/runtime/velu-ui/components/toc-bar.css +234 -234
- package/runtime/velu-ui/components/tree.css +49 -49
- package/runtime/velu-ui/index.js +54 -54
- package/runtime/velu-ui/lib/api-send.js +92 -92
- package/runtime/velu-ui/lib/brand-icons.jsx +103 -103
- package/runtime/velu-ui/lib/component-schemas.js +100 -100
- package/runtime/velu-ui/lib/copyText.js +64 -64
- package/runtime/velu-ui/lib/docs-assistant.js +250 -250
- package/runtime/velu-ui/lib/lang-icons.jsx +147 -147
- package/runtime/velu-ui/lib/pagefind.js +113 -113
- package/runtime/velu-ui/lib/prism-langs.js +957 -957
- package/runtime/velu-ui/lib/prism-loader.js +74 -74
- package/runtime/velu-ui/lib/resolveIcon.jsx +29 -29
- package/runtime/velu-ui/lib/scrollIntoNearestView.js +66 -66
- package/runtime/velu-ui/mdx-components.jsx +105 -105
- package/runtime/velu-ui/primitives/Cluster.jsx +49 -49
- package/runtime/velu-ui/primitives/Stack.jsx +63 -63
- package/runtime/velu-ui/primitives/Switcher.jsx +57 -57
- package/runtime/velu-ui/primitives/stack.css +3 -3
- package/runtime/velu-ui/primitives/switcher.css +25 -25
- package/runtime/velu-ui/styles.css +46 -46
- package/runtime/velu-ui/tokens.css +4 -4
- package/schema/velu.schema.json +423 -423
- package/src/lib/extract-mdx-error.js +170 -170
- package/src/lib/issues.js +159 -159
- package/src/lib/known-components.js +34 -34
- package/src/navigation.js +443 -443
- package/src/runtime/App.jsx +1669 -1668
- package/src/runtime/ErrorBoundary.jsx +54 -54
- package/src/runtime/client-entry.jsx +22 -22
- package/src/runtime/server-entry.jsx +16 -16
- package/src/template.html +48 -48
- package/templates/starter/ai-tools/claude-code.mdx +26 -26
- package/templates/starter/ai-tools/cursor.mdx +17 -17
- package/templates/starter/api-reference/introduction.mdx +43 -43
- package/templates/starter/development.mdx +19 -19
- package/templates/starter/essentials/code.mdx +29 -29
- package/templates/starter/essentials/images.mdx +29 -29
- package/templates/starter/essentials/markdown.mdx +25 -25
- package/templates/starter/essentials/navigation.mdx +39 -39
- package/templates/starter/essentials/settings.mdx +30 -30
- package/templates/starter/favicon.svg +6 -6
- package/templates/starter/index.mdx +31 -31
- package/templates/starter/openapi.json +160 -160
- package/templates/starter/quickstart.mdx +31 -31
- package/templates/starter/velu.json +41 -41
|
@@ -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,22 +1,22 @@
|
|
|
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
|
-
hydrateRoot(
|
|
8
|
-
document.getElementById('root'),
|
|
9
|
-
<BrowserRouter>
|
|
10
|
-
<App />
|
|
11
|
-
</BrowserRouter>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
// Dev only: the SSR-inlined critical CSS (<style data-velu-ssr>) exists just
|
|
15
|
-
// to avoid FOUC on first paint. By now Vite has injected its own HMR-managed
|
|
16
|
-
// stylesheet from the `velu-ui/styles.css` import above, so drop the stale
|
|
17
|
-
// inline copy — otherwise it shadows hot CSS updates and edits don't apply.
|
|
18
|
-
if (import.meta.hot) {
|
|
19
|
-
for (const el of document.querySelectorAll('style[data-velu-ssr]')) {
|
|
20
|
-
el.remove();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
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
|
+
hydrateRoot(
|
|
8
|
+
document.getElementById('root'),
|
|
9
|
+
<BrowserRouter>
|
|
10
|
+
<App />
|
|
11
|
+
</BrowserRouter>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
// Dev only: the SSR-inlined critical CSS (<style data-velu-ssr>) exists just
|
|
15
|
+
// to avoid FOUC on first paint. By now Vite has injected its own HMR-managed
|
|
16
|
+
// stylesheet from the `velu-ui/styles.css` import above, so drop the stale
|
|
17
|
+
// inline copy — otherwise it shadows hot CSS updates and edits don't apply.
|
|
18
|
+
if (import.meta.hot) {
|
|
19
|
+
for (const el of document.querySelectorAll('style[data-velu-ssr]')) {
|
|
20
|
+
el.remove();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
-
export async function render(url) {
|
|
11
|
-
return renderToString(
|
|
12
|
-
<StaticRouter location={url}>
|
|
13
|
-
<App />
|
|
14
|
-
</StaticRouter>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
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
|
+
export async function render(url) {
|
|
11
|
+
return renderToString(
|
|
12
|
+
<StaticRouter location={url}>
|
|
13
|
+
<App />
|
|
14
|
+
</StaticRouter>
|
|
15
|
+
);
|
|
16
|
+
}
|
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
|
-

|
|
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
|
+

|
|
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>
|