@veluai/velu 0.1.13 → 0.1.14

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 (96) hide show
  1. package/README.md +80 -80
  2. package/dist/cli.js +18 -18
  3. package/package.json +3 -2
  4. package/runtime/velu-ui/components/Accordion.jsx +64 -64
  5. package/runtime/velu-ui/components/ApiClient.jsx +121 -121
  6. package/runtime/velu-ui/components/ApiField.jsx +87 -87
  7. package/runtime/velu-ui/components/ApiPath.jsx +63 -63
  8. package/runtime/velu-ui/components/ApiSidebar.jsx +122 -122
  9. package/runtime/velu-ui/components/AskBar.jsx +71 -71
  10. package/runtime/velu-ui/components/Callout.jsx +114 -114
  11. package/runtime/velu-ui/components/Card.jsx +131 -131
  12. package/runtime/velu-ui/components/Chatbot.jsx +596 -596
  13. package/runtime/velu-ui/components/CodeBlock.jsx +375 -375
  14. package/runtime/velu-ui/components/Columns.jsx +56 -56
  15. package/runtime/velu-ui/components/ErrorCard.jsx +138 -138
  16. package/runtime/velu-ui/components/Field.jsx +81 -81
  17. package/runtime/velu-ui/components/Image.jsx +163 -163
  18. package/runtime/velu-ui/components/MethodBadge.jsx +31 -31
  19. package/runtime/velu-ui/components/NavSelect.jsx +108 -108
  20. package/runtime/velu-ui/components/PageFeedback.jsx +219 -219
  21. package/runtime/velu-ui/components/PageFooter.jsx +213 -213
  22. package/runtime/velu-ui/components/PageHeader.jsx +414 -414
  23. package/runtime/velu-ui/components/PageNav.jsx +77 -77
  24. package/runtime/velu-ui/components/PoweredBy.jsx +51 -51
  25. package/runtime/velu-ui/components/Prompt.jsx +115 -115
  26. package/runtime/velu-ui/components/Search.jsx +411 -366
  27. package/runtime/velu-ui/components/Sidebar.jsx +191 -191
  28. package/runtime/velu-ui/components/Steps.jsx +65 -65
  29. package/runtime/velu-ui/components/ThemeToggle.jsx +48 -48
  30. package/runtime/velu-ui/components/Toc.jsx +537 -537
  31. package/runtime/velu-ui/components/TocBar.jsx +195 -195
  32. package/runtime/velu-ui/components/Tree.jsx +87 -87
  33. package/runtime/velu-ui/components/TryItBar.jsx +90 -90
  34. package/runtime/velu-ui/components/accordion.css +92 -92
  35. package/runtime/velu-ui/components/api.css +479 -479
  36. package/runtime/velu-ui/components/ask-bar.css +94 -94
  37. package/runtime/velu-ui/components/card.css +105 -105
  38. package/runtime/velu-ui/components/chatbot.css +617 -617
  39. package/runtime/velu-ui/components/code-block.css +263 -263
  40. package/runtime/velu-ui/components/docs-layout.css +784 -775
  41. package/runtime/velu-ui/components/field.css +82 -82
  42. package/runtime/velu-ui/components/image.css +237 -237
  43. package/runtime/velu-ui/components/nav-select.css +157 -157
  44. package/runtime/velu-ui/components/page-feedback.css +241 -241
  45. package/runtime/velu-ui/components/page-footer.css +130 -130
  46. package/runtime/velu-ui/components/page-header.css +520 -520
  47. package/runtime/velu-ui/components/page-nav.css +50 -50
  48. package/runtime/velu-ui/components/powered-by.css +66 -66
  49. package/runtime/velu-ui/components/prompt.css +99 -99
  50. package/runtime/velu-ui/components/search.css +307 -307
  51. package/runtime/velu-ui/components/sidebar.css +144 -144
  52. package/runtime/velu-ui/components/steps.css +77 -77
  53. package/runtime/velu-ui/components/theme-toggle.css +101 -101
  54. package/runtime/velu-ui/components/toc-bar.css +234 -234
  55. package/runtime/velu-ui/components/tree.css +49 -49
  56. package/runtime/velu-ui/index.js +46 -46
  57. package/runtime/velu-ui/lib/component-schemas.js +100 -100
  58. package/runtime/velu-ui/lib/copyText.js +64 -64
  59. package/runtime/velu-ui/lib/lang-icons.jsx +147 -147
  60. package/runtime/velu-ui/lib/prism-langs.js +957 -957
  61. package/runtime/velu-ui/lib/prism-loader.js +74 -74
  62. package/runtime/velu-ui/lib/resolveIcon.jsx +29 -29
  63. package/runtime/velu-ui/lib/scrollIntoNearestView.js +66 -66
  64. package/runtime/velu-ui/mdx-components.jsx +105 -105
  65. package/runtime/velu-ui/primitives/Cluster.jsx +49 -49
  66. package/runtime/velu-ui/primitives/Stack.jsx +63 -63
  67. package/runtime/velu-ui/primitives/Switcher.jsx +57 -57
  68. package/runtime/velu-ui/primitives/stack.css +3 -3
  69. package/runtime/velu-ui/primitives/switcher.css +25 -25
  70. package/runtime/velu-ui/styles.css +43 -43
  71. package/runtime/velu-ui/tokens.css +4 -4
  72. package/schema/velu.schema.json +167 -167
  73. package/src/lib/extract-mdx-error.js +170 -170
  74. package/src/lib/issues.js +159 -159
  75. package/src/lib/known-components.js +34 -34
  76. package/src/navigation.js +434 -434
  77. package/src/runtime/App.jsx +1490 -1476
  78. package/src/runtime/ErrorBoundary.jsx +54 -54
  79. package/src/runtime/client-entry.jsx +22 -22
  80. package/src/runtime/server-entry.jsx +16 -16
  81. package/src/template.html +48 -48
  82. package/templates/starter/ai-tools/claude-code.mdx +26 -26
  83. package/templates/starter/ai-tools/cursor.mdx +17 -17
  84. package/templates/starter/api-reference/endpoint/create.mdx +24 -24
  85. package/templates/starter/api-reference/endpoint/get.mdx +27 -27
  86. package/templates/starter/api-reference/introduction.mdx +28 -28
  87. package/templates/starter/development.mdx +19 -19
  88. package/templates/starter/essentials/code.mdx +29 -29
  89. package/templates/starter/essentials/images.mdx +29 -29
  90. package/templates/starter/essentials/markdown.mdx +25 -25
  91. package/templates/starter/essentials/navigation.mdx +39 -39
  92. package/templates/starter/essentials/settings.mdx +30 -30
  93. package/templates/starter/favicon.svg +6 -6
  94. package/templates/starter/index.mdx +31 -31
  95. package/templates/starter/quickstart.mdx +31 -31
  96. package/templates/starter/velu.json +33 -33
@@ -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,24 +1,24 @@
1
- ---
2
- title: Create item
3
- description: Create a new item.
4
- ---
5
-
6
- <MethodBadge method="POST" /> `/items`
7
-
8
- Creates an item and returns it.
9
-
10
- ## Body
11
-
12
- <ApiField name="name" type="string" required>
13
- Display name for the item.
14
- </ApiField>
15
-
16
- ## Response
17
-
18
- ```json
19
- {
20
- "id": "itm_2",
21
- "name": "New item",
22
- "created_at": "2024-01-01T00:00:00Z"
23
- }
24
- ```
1
+ ---
2
+ title: Create item
3
+ description: Create a new item.
4
+ ---
5
+
6
+ <MethodBadge method="POST" /> `/items`
7
+
8
+ Creates an item and returns it.
9
+
10
+ ## Body
11
+
12
+ <ApiField name="name" type="string" required>
13
+ Display name for the item.
14
+ </ApiField>
15
+
16
+ ## Response
17
+
18
+ ```json
19
+ {
20
+ "id": "itm_2",
21
+ "name": "New item",
22
+ "created_at": "2024-01-01T00:00:00Z"
23
+ }
24
+ ```
@@ -1,27 +1,27 @@
1
- ---
2
- title: Get items
3
- description: Retrieve a list of items.
4
- ---
5
-
6
- <MethodBadge method="GET" /> `/items`
7
-
8
- Returns a paginated list of items.
9
-
10
- ## Query parameters
11
-
12
- <ApiField name="limit" type="integer" default="20">
13
- Maximum number of items to return.
14
- </ApiField>
15
-
16
- <ApiField name="cursor" type="string">
17
- Pagination cursor from a previous response.
18
- </ApiField>
19
-
20
- ## Response
21
-
22
- ```json
23
- {
24
- "data": [{ "id": "itm_1", "name": "Example" }],
25
- "next_cursor": null
26
- }
27
- ```
1
+ ---
2
+ title: Get items
3
+ description: Retrieve a list of items.
4
+ ---
5
+
6
+ <MethodBadge method="GET" /> `/items`
7
+
8
+ Returns a paginated list of items.
9
+
10
+ ## Query parameters
11
+
12
+ <ApiField name="limit" type="integer" default="20">
13
+ Maximum number of items to return.
14
+ </ApiField>
15
+
16
+ <ApiField name="cursor" type="string">
17
+ Pagination cursor from a previous response.
18
+ </ApiField>
19
+
20
+ ## Response
21
+
22
+ ```json
23
+ {
24
+ "data": [{ "id": "itm_1", "name": "Example" }],
25
+ "next_cursor": null
26
+ }
27
+ ```
@@ -1,28 +1,28 @@
1
- ---
2
- title: Introduction
3
- description: How to read this API reference.
4
- ---
5
-
6
- This section documents the example API. Endpoints are grouped in the
7
- sidebar; each page shows the request, parameters, and a sample
8
- response.
9
-
10
- <Callout type="note">
11
- This is a second tab ("API Reference"). Tabs let you keep guides and
12
- reference docs in separate top-level sections of the same site.
13
- </Callout>
14
-
15
- ## Base URL
16
-
17
- ```
18
- https://api.example.com/v1
19
- ```
20
-
21
- ## Authentication
22
-
23
- Send your key as a bearer token:
24
-
25
- ```bash
26
- curl https://api.example.com/v1/items \
27
- -H "Authorization: Bearer YOUR_TOKEN"
28
- ```
1
+ ---
2
+ title: Introduction
3
+ description: How to read this API reference.
4
+ ---
5
+
6
+ This section documents the example API. Endpoints are grouped in the
7
+ sidebar; each page shows the request, parameters, and a sample
8
+ response.
9
+
10
+ <Callout type="note">
11
+ This is a second tab ("API Reference"). Tabs let you keep guides and
12
+ reference docs in separate top-level sections of the same site.
13
+ </Callout>
14
+
15
+ ## Base URL
16
+
17
+ ```
18
+ https://api.example.com/v1
19
+ ```
20
+
21
+ ## Authentication
22
+
23
+ Send your key as a bearer token:
24
+
25
+ ```bash
26
+ curl https://api.example.com/v1/items \
27
+ -H "Authorization: Bearer YOUR_TOKEN"
28
+ ```
@@ -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>