@axerity/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/axerity.default.json +135 -0
  4. package/axerity.schema.json +268 -0
  5. package/bin/axerity.js +305 -0
  6. package/mdsvex.config.js +261 -0
  7. package/package.json +103 -0
  8. package/scripts/prepare-engine.mjs +20 -0
  9. package/src/app.d.ts +17 -0
  10. package/src/app.html +39 -0
  11. package/src/content/demo/api/meta.json +5 -0
  12. package/src/content/demo/api/pet/add-pet.md +105 -0
  13. package/src/content/demo/api/pet/delete-pet.md +70 -0
  14. package/src/content/demo/api/pet/find-by-status.md +72 -0
  15. package/src/content/demo/api/pet/find-by-tags.md +64 -0
  16. package/src/content/demo/api/pet/get-pet.md +99 -0
  17. package/src/content/demo/api/pet/meta.json +15 -0
  18. package/src/content/demo/api/pet/pet-object.md +112 -0
  19. package/src/content/demo/api/pet/update-pet-with-form.md +69 -0
  20. package/src/content/demo/api/pet/update-pet.md +79 -0
  21. package/src/content/demo/api/pet/upload-image.md +79 -0
  22. package/src/content/demo/api/store/delete-order.md +62 -0
  23. package/src/content/demo/api/store/get-order.md +70 -0
  24. package/src/content/demo/api/store/inventory.md +54 -0
  25. package/src/content/demo/api/store/meta.json +5 -0
  26. package/src/content/demo/api/store/order-object.md +77 -0
  27. package/src/content/demo/api/store/place-order.md +83 -0
  28. package/src/content/demo/api/user/create-user.md +69 -0
  29. package/src/content/demo/api/user/create-with-list.md +57 -0
  30. package/src/content/demo/api/user/delete-user.md +61 -0
  31. package/src/content/demo/api/user/get-user.md +69 -0
  32. package/src/content/demo/api/user/login.md +80 -0
  33. package/src/content/demo/api/user/logout.md +45 -0
  34. package/src/content/demo/api/user/meta.json +14 -0
  35. package/src/content/demo/api/user/update-user.md +69 -0
  36. package/src/content/demo/api/user/user-object.md +85 -0
  37. package/src/content/demo/changelog.md +44 -0
  38. package/src/content/demo/components/accordion.md +70 -0
  39. package/src/content/demo/components/api.md +185 -0
  40. package/src/content/demo/components/badge.md +34 -0
  41. package/src/content/demo/components/callout.md +83 -0
  42. package/src/content/demo/components/cards.md +88 -0
  43. package/src/content/demo/components/code-group.md +55 -0
  44. package/src/content/demo/components/columns.md +42 -0
  45. package/src/content/demo/components/frame.md +51 -0
  46. package/src/content/demo/components/icon.md +54 -0
  47. package/src/content/demo/components/kbd.md +28 -0
  48. package/src/content/demo/components/meta.json +26 -0
  49. package/src/content/demo/components/roadmap.md +86 -0
  50. package/src/content/demo/components/steps.md +72 -0
  51. package/src/content/demo/components/tabs.md +146 -0
  52. package/src/content/demo/components/tooltip.md +44 -0
  53. package/src/content/demo/components/tree.md +83 -0
  54. package/src/content/demo/components/type-table.md +77 -0
  55. package/src/content/demo/components/update.md +48 -0
  56. package/src/content/demo/components/video.md +56 -0
  57. package/src/content/demo/components/webhooks.md +109 -0
  58. package/src/content/demo/components/websockets.md +101 -0
  59. package/src/content/demo/configuration/ai.md +40 -0
  60. package/src/content/demo/configuration/cli.md +46 -0
  61. package/src/content/demo/configuration/deployment.md +105 -0
  62. package/src/content/demo/configuration/index.md +92 -0
  63. package/src/content/demo/configuration/layouts.md +51 -0
  64. package/src/content/demo/configuration/meta.json +5 -0
  65. package/src/content/demo/configuration/navigation.md +167 -0
  66. package/src/content/demo/configuration/openapi.md +103 -0
  67. package/src/content/demo/configuration/search.md +36 -0
  68. package/src/content/demo/index.md +59 -0
  69. package/src/content/demo/installation.md +49 -0
  70. package/src/content/demo/meta.json +15 -0
  71. package/src/content/demo/quick-start.md +47 -0
  72. package/src/content/demo/theming/advanced.md +116 -0
  73. package/src/content/demo/theming/code.md +66 -0
  74. package/src/content/demo/theming/colors.md +103 -0
  75. package/src/content/demo/theming/index.md +88 -0
  76. package/src/content/demo/theming/layout.md +71 -0
  77. package/src/content/demo/theming/meta.json +5 -0
  78. package/src/content/demo/theming/themes.md +99 -0
  79. package/src/content/demo/theming/typography.md +83 -0
  80. package/src/content/demo/writing/code-blocks.md +154 -0
  81. package/src/content/demo/writing/diagrams.md +44 -0
  82. package/src/content/demo/writing/frontmatter.md +33 -0
  83. package/src/content/demo/writing/markdown.md +62 -0
  84. package/src/content/demo/writing/meta.json +5 -0
  85. package/src/hooks.server.ts +49 -0
  86. package/src/lib/assets/favicon.svg +1 -0
  87. package/src/lib/base.ts +12 -0
  88. package/src/lib/components/DynamicIcon.svelte +26 -0
  89. package/src/lib/components/docs/Analytics.svelte +38 -0
  90. package/src/lib/components/docs/Banner.svelte +44 -0
  91. package/src/lib/components/docs/Breadcrumbs.svelte +38 -0
  92. package/src/lib/components/docs/CopyPageMenu.svelte +119 -0
  93. package/src/lib/components/docs/DocsLayout.svelte +192 -0
  94. package/src/lib/components/docs/Footer.svelte +60 -0
  95. package/src/lib/components/docs/Mermaid.svelte +39 -0
  96. package/src/lib/components/docs/Navbar.svelte +144 -0
  97. package/src/lib/components/docs/PageMeta.svelte +35 -0
  98. package/src/lib/components/docs/PageNav.svelte +44 -0
  99. package/src/lib/components/docs/SearchDialog.svelte +182 -0
  100. package/src/lib/components/docs/Sidebar.svelte +85 -0
  101. package/src/lib/components/docs/SidebarDropdown.svelte +56 -0
  102. package/src/lib/components/docs/SidebarFooterLinks.svelte +19 -0
  103. package/src/lib/components/docs/SidebarGroup.svelte +54 -0
  104. package/src/lib/components/docs/SidebarLink.svelte +67 -0
  105. package/src/lib/components/docs/TableOfContents.svelte +77 -0
  106. package/src/lib/components/docs/ThemeToggle.svelte +19 -0
  107. package/src/lib/components/docs/VersionSwitcher.svelte +80 -0
  108. package/src/lib/components/kit/Accordion.svelte +60 -0
  109. package/src/lib/components/kit/AccordionGroup.svelte +13 -0
  110. package/src/lib/components/kit/Badge.svelte +32 -0
  111. package/src/lib/components/kit/Callout.svelte +51 -0
  112. package/src/lib/components/kit/Card.svelte +72 -0
  113. package/src/lib/components/kit/CardGroup.svelte +21 -0
  114. package/src/lib/components/kit/CodeGroup.svelte +65 -0
  115. package/src/lib/components/kit/Columns.svelte +26 -0
  116. package/src/lib/components/kit/Event.svelte +23 -0
  117. package/src/lib/components/kit/EventList.svelte +9 -0
  118. package/src/lib/components/kit/File.svelte +15 -0
  119. package/src/lib/components/kit/Folder.svelte +46 -0
  120. package/src/lib/components/kit/Frame.svelte +81 -0
  121. package/src/lib/components/kit/Icon.svelte +17 -0
  122. package/src/lib/components/kit/Kbd.svelte +11 -0
  123. package/src/lib/components/kit/Roadmap.svelte +15 -0
  124. package/src/lib/components/kit/RoadmapItem.svelte +109 -0
  125. package/src/lib/components/kit/Step.svelte +63 -0
  126. package/src/lib/components/kit/Steps.svelte +16 -0
  127. package/src/lib/components/kit/Tab.svelte +27 -0
  128. package/src/lib/components/kit/Tabs.svelte +75 -0
  129. package/src/lib/components/kit/Tooltip.svelte +33 -0
  130. package/src/lib/components/kit/Tree.svelte +11 -0
  131. package/src/lib/components/kit/TypeTable.svelte +187 -0
  132. package/src/lib/components/kit/Update.svelte +32 -0
  133. package/src/lib/components/kit/Video.svelte +64 -0
  134. package/src/lib/components/kit/accordion-context.ts +1 -0
  135. package/src/lib/components/kit/api/Api.svelte +80 -0
  136. package/src/lib/components/kit/api/ApiExamplePanel.svelte +100 -0
  137. package/src/lib/components/kit/api/ApiField.svelte +124 -0
  138. package/src/lib/components/kit/api/Channel.svelte +121 -0
  139. package/src/lib/components/kit/api/Endpoint.svelte +116 -0
  140. package/src/lib/components/kit/api/Enum.svelte +44 -0
  141. package/src/lib/components/kit/api/EnumValues.svelte +35 -0
  142. package/src/lib/components/kit/api/Expandable.svelte +70 -0
  143. package/src/lib/components/kit/api/Message.svelte +67 -0
  144. package/src/lib/components/kit/api/ObjectExample.svelte +11 -0
  145. package/src/lib/components/kit/api/RequestExample.svelte +11 -0
  146. package/src/lib/components/kit/api/ResponseExample.svelte +11 -0
  147. package/src/lib/components/kit/api/Webhook.svelte +115 -0
  148. package/src/lib/components/kit/api/api-context.ts +15 -0
  149. package/src/lib/components/kit/tabs-context.ts +8 -0
  150. package/src/lib/components/kit/tabs-store.svelte.ts +28 -0
  151. package/src/lib/config/site.ts +34 -0
  152. package/src/lib/content/index.ts +50 -0
  153. package/src/lib/content/raw.ts +21 -0
  154. package/src/lib/content/tree.ts +169 -0
  155. package/src/lib/index.ts +79 -0
  156. package/src/lib/nav-match.ts +23 -0
  157. package/src/lib/openapi/generate.ts +629 -0
  158. package/src/lib/server/og.ts +140 -0
  159. package/src/lib/state/search.svelte.ts +9 -0
  160. package/src/lib/state/theme.svelte.ts +58 -0
  161. package/src/lib/types.ts +216 -0
  162. package/src/params/docpage.ts +3 -0
  163. package/src/params/mdfile.ts +3 -0
  164. package/src/routes/+error.svelte +46 -0
  165. package/src/routes/+layout.svelte +25 -0
  166. package/src/routes/[...path=mdfile]/+server.ts +21 -0
  167. package/src/routes/[...slug=docpage]/+page.svelte +63 -0
  168. package/src/routes/[...slug=docpage]/+page.ts +44 -0
  169. package/src/routes/layout.css +897 -0
  170. package/src/routes/llms-full.txt/+server.ts +22 -0
  171. package/src/routes/llms.txt/+server.ts +20 -0
  172. package/src/routes/og/[...slug]/+server.ts +77 -0
  173. package/src/routes/rss.xml/+server.ts +65 -0
  174. package/src/routes/search.json/+server.ts +54 -0
  175. package/src/routes/sitemap.xml/+server.ts +21 -0
  176. package/static/favicon-dark.svg +6 -0
  177. package/static/favicon-light.svg +6 -0
  178. package/static/favicon.svg +14 -0
  179. package/static/fonts/geist-400.ttf +0 -0
  180. package/static/fonts/geist-600.ttf +0 -0
  181. package/static/fonts/geist-700.ttf +0 -0
  182. package/static/og-image.png +0 -0
  183. package/static/robots.txt +4 -0
  184. package/svelte.config.js +35 -0
  185. package/tsconfig.json +20 -0
  186. package/vite.config.ts +46 -0
@@ -0,0 +1,46 @@
1
+ ---
2
+ title: CLI
3
+ description: The axerity command.
4
+ icon: code
5
+ ---
6
+
7
+ # CLI
8
+
9
+ The `axerity` command scaffolds, runs, and builds your site. It carries the whole
10
+ engine, so your project only holds content and config.
11
+
12
+ ## Commands
13
+
14
+ ```bash
15
+ axerity init [dir] # scaffold a new site (defaults to the current folder)
16
+ axerity dev # start the dev server
17
+ axerity build # build the static site
18
+ axerity preview # preview the production build
19
+ ```
20
+
21
+ Run them with `npx axerity <command>`, or install globally with
22
+ `npm install -g axerity` and call `axerity` directly.
23
+
24
+ ## init
25
+
26
+ `axerity init my-docs` creates a starter site: an `axerity.json`, a `docs/`
27
+ folder with a couple of pages and a `meta.json`, and a `.gitignore`. Leave off
28
+ the folder name to scaffold into the current directory.
29
+
30
+ ## dev
31
+
32
+ `axerity dev` serves your site with live reload. Editing a Markdown file or
33
+ `axerity.json` updates the browser immediately. Pass through any Vite flag, for
34
+ example `axerity dev --port 4000`.
35
+
36
+ ## build
37
+
38
+ `axerity build` produces a static site. Every page is prerendered to HTML, and
39
+ the search index, `llms.txt`, sitemap, RSS feed, and OpenGraph images are all
40
+ written out, ready to host anywhere.
41
+
42
+ ## How it works
43
+
44
+ The CLI never touches your content. It assembles a hidden `.axerity` workspace
45
+ that pairs the packaged engine with your `docs/` folder and `axerity.json`, then
46
+ runs Vite there. Add `.axerity` to your `.gitignore`; `init` does this for you.
@@ -0,0 +1,105 @@
1
+ ---
2
+ title: Deployment
3
+ description: Build and host your docs.
4
+ icon: rocket
5
+ ---
6
+
7
+ # Deployment
8
+
9
+ `axerity build` writes a plain folder of static files to `build/`. Every page is
10
+ prerendered to HTML, and the search index, `.md` URLs, `llms.txt`, sitemap, RSS
11
+ feed, and OpenGraph images are all written out. Any static host can serve it, no
12
+ server required.
13
+
14
+ ```bash
15
+ axerity build # -> build/
16
+ ```
17
+
18
+ Most hosts write `.html` files (`installation.html`) but link to clean URLs
19
+ (`/installation`), so the one thing to get right per host is **clean URL**
20
+ handling. Each guide below covers it.
21
+
22
+ ## Vercel
23
+
24
+ Add a `vercel.json` so Vercel serves the static output instead of looking for a
25
+ SvelteKit server build:
26
+
27
+ ```json title="vercel.json"
28
+ {
29
+ "framework": null,
30
+ "buildCommand": "axerity build",
31
+ "outputDirectory": "build",
32
+ "cleanUrls": true
33
+ }
34
+ ```
35
+
36
+ Push the repo and Vercel does the rest. If pages still 404, open Project →
37
+ Settings and set the Framework Preset to **Other**.
38
+
39
+ ## Cloudflare Pages
40
+
41
+ In the Pages project settings:
42
+
43
+ - **Build command:** `npx axerity build`
44
+ - **Build output directory:** `build`
45
+ - **Framework preset:** None
46
+
47
+ Cloudflare serves clean URLs automatically.
48
+
49
+ ## Netlify
50
+
51
+ ```toml title="netlify.toml"
52
+ [build]
53
+ command = "npx axerity build"
54
+ publish = "build"
55
+ ```
56
+
57
+ Netlify serves clean URLs (pretty URLs) by default.
58
+
59
+ ## GitHub Pages
60
+
61
+ Build, then publish the `build/` folder (for example with a GitHub Action that
62
+ runs `npx axerity build` and uploads `build/` as the Pages artifact).
63
+
64
+ Project sites are served from `https://<user>.github.io/<repo>/`, a sub-path, so
65
+ set the base in `axerity.json`:
66
+
67
+ ```json title="axerity.json"
68
+ {
69
+ "basePath": "/<repo>"
70
+ }
71
+ ```
72
+
73
+ User and organization sites (served from the domain root) need no `basePath`.
74
+
75
+ ## Nginx
76
+
77
+ Serve `build/` and fall back to the `.html` file for clean URLs:
78
+
79
+ ```nginx
80
+ server {
81
+ listen 80;
82
+ server_name docs.example.com;
83
+ root /var/www/build;
84
+
85
+ location / {
86
+ try_files $uri $uri.html $uri/index.html /404.html;
87
+ }
88
+ }
89
+ ```
90
+
91
+ ## Caddy
92
+
93
+ ```caddy
94
+ docs.example.com {
95
+ root * /var/www/build
96
+ try_files {path} {path}.html {path}/index.html
97
+ file_server
98
+ }
99
+ ```
100
+
101
+ ## Any other host
102
+
103
+ Upload the contents of `build/` and point the host at it. Configure two things if
104
+ you can: serve `<name>.html` for `/<name>` (clean URLs), and use `404.html` as
105
+ the not-found page.
@@ -0,0 +1,92 @@
1
+ ---
2
+ title: The config file
3
+ description: Everything you set in axerity.json.
4
+ icon: sliders
5
+ ---
6
+
7
+ # The config file
8
+
9
+ The whole site is configured from one file at the project root: `axerity.json`.
10
+ You never edit code to change the site. Drop in Markdown, set up your
11
+ `meta.json` files for ordering, and edit `axerity.json` for everything global.
12
+
13
+ ## Editor autocomplete
14
+
15
+ The repo ships a JSON schema. Point your config at it on the first line and your
16
+ editor gives you autocomplete and validation for every field:
17
+
18
+ ```json title="axerity.json"
19
+ {
20
+ "$schema": "./axerity.schema.json"
21
+ }
22
+ ```
23
+
24
+ ## A full example
25
+
26
+ ```json title="axerity.json"
27
+ {
28
+ "$schema": "./axerity.schema.json",
29
+ "name": "Axerity",
30
+ "description": "A documentation site generator built with Svelte.",
31
+ "url": "https://axerity.com",
32
+ "github": "https://github.com/your/repo",
33
+ "editLink": "https://github.com/your/repo/edit/main/src/content/docs",
34
+ "theme": "stripe",
35
+ "layout": "boxed",
36
+ "sidebar": { "variant": "floating" },
37
+ "logo": { "light": "/logo-light.svg", "dark": "/logo-dark.svg" },
38
+ "og": { "enabled": true },
39
+ "banner": { "text": "v1.0 is out", "href": "/docs", "id": "v1", "dismissible": true },
40
+ "versions": [{ "label": "v1.0", "href": "/docs" }],
41
+ "dropdowns": [
42
+ {
43
+ "label": "Guides",
44
+ "icon": "book-open",
45
+ "href": "/docs",
46
+ "match": "/docs",
47
+ "tabs": [{ "title": "Documentation", "href": "/docs", "match": "/docs" }]
48
+ }
49
+ ],
50
+ "sidebarLinks": [{ "title": "Support", "href": "https://example.com/support" }],
51
+ "social": [{ "icon": "rss", "href": "/rss.xml" }],
52
+ "footer": { "note": "Built with Axerity", "links": [{ "title": "Status", "href": "/status" }] },
53
+ "analytics": { "plausible": "axerity.com" },
54
+ "topNav": [{ "title": "Docs", "href": "/docs" }]
55
+ }
56
+ ```
57
+
58
+ ## Fields
59
+
60
+ | Field | Type | What it does |
61
+ | -------------- | ------------------------ | ------------------------------------------------------------------------------------------- |
62
+ | `name` | string | Site name, used in the page title and navbar |
63
+ | `description` | string | Site description, used for SEO and `llms.txt` |
64
+ | `url` | string | Canonical site URL; enables absolute links in sitemap, RSS, and OpenGraph |
65
+ | `github` | string | Repo URL, shown as the GitHub icon in the navbar and footer |
66
+ | `editLink` | string | Base URL for the "Edit this page" link; the source path is appended |
67
+ | `theme` | string | A built-in [theme](/theming/themes) preset |
68
+ | `brand` | object | Custom `{ accent, radius }` that override the theme. See [Colors](/theming/colors) |
69
+ | `layout` | string | `flat` (default) or `boxed`. See [Layouts](/configuration/layouts) |
70
+ | `basePath` | string | Serve the whole site under a sub-path like `/docs`. Empty (default) is the root |
71
+ | `sidebar` | object | Sidebar appearance: `{ "variant": "flush" \| "card" \| "floating" }` |
72
+ | `logo` | object | Navbar logo `{ light, dark, alt, href }`. Local SVGs are inlined |
73
+ | `og` | object | Per-page OpenGraph image generation `{ enabled, background, foreground, … }` |
74
+ | `ogImage` | string | Static OG image path, used when `og.enabled` is off |
75
+ | `banner` | object | Announcement bar `{ text, href, id, dismissible }` |
76
+ | `analytics` | object | `{ plausible, googleAnalytics }` scripts injected on every page |
77
+ | `topNav` | array | Fallback top nav links when no dropdowns are set |
78
+ | `versions` | array | Versions shown in the navbar version switcher |
79
+ | `dropdowns` | array | Areas that swap the whole sidebar. See [Navigation](/configuration/navigation) |
80
+ | `openapi` | string, object, or array | Generate an API reference from an OpenAPI spec. See [API reference](/configuration/openapi) |
81
+ | `sidebarLinks` | array | Links pinned to the bottom of the sidebar |
82
+ | `social` | array | Social links shown in the footer `{ icon, href, label }` |
83
+ | `footer` | object | Footer `{ note, links }` |
84
+
85
+ Every field except `name` and `topNav` is optional. Leave a field out and the
86
+ related UI does not render.
87
+
88
+ ## Icons
89
+
90
+ Anywhere a config field takes an `icon`, use a [Lucide](https://lucide.dev) icon
91
+ name in kebab case, such as `book-open`, `credit-card`, or `git-branch`. Any
92
+ Lucide icon works, so you never register icons by hand.
@@ -0,0 +1,51 @@
1
+ ---
2
+ title: Layouts
3
+ description: Page width and the API layout.
4
+ icon: layout-grid
5
+ ---
6
+
7
+ # Layouts
8
+
9
+ ## Flat and boxed
10
+
11
+ The whole shell has two modes, set with `layout` in `axerity.json`:
12
+
13
+ ```json title="axerity.json"
14
+ {
15
+ "layout": "flat"
16
+ }
17
+ ```
18
+
19
+ - `flat` (default) is full width. The sidebar sits at the left edge.
20
+ - `boxed` centers the shell in a max-width container on wide screens.
21
+
22
+ ## The doc layout
23
+
24
+ Normal pages use the three column layout: sidebar on the left, content in the
25
+ middle, and a table of contents on the right. The table of contents tracks your
26
+ scroll position. It hides on narrow screens, and the sidebar becomes a drawer.
27
+
28
+ ## The API layout
29
+
30
+ Set `layout: api` in a page's frontmatter to switch to the API layout. It is
31
+ wider, drops the table of contents, and gives you a two column layout with the
32
+ content on the left and sticky request and response examples on the right.
33
+
34
+ ```md
35
+ ---
36
+ title: Create a user
37
+ layout: api
38
+ ---
39
+ ```
40
+
41
+ See the [API reference components](/api/pet/pet-object) for what you can
42
+ put on these pages.
43
+
44
+ ## On every page
45
+
46
+ Both layouts include a few things automatically:
47
+
48
+ - A breadcrumb trail above the title.
49
+ - A copy page button. See [AI and LLMs](/configuration/ai).
50
+ - Previous and next links at the bottom.
51
+ - A footer.
@@ -0,0 +1,5 @@
1
+ {
2
+ "title": "Configuration",
3
+ "icon": "sliders",
4
+ "pages": ["index", "navigation", "layouts", "search", "openapi", "ai", "cli", "deployment"]
5
+ }
@@ -0,0 +1,167 @@
1
+ ---
2
+ title: Navigation
3
+ description: Sidebar, groups, dropdowns, tabs, and ordering.
4
+ icon: list
5
+ ---
6
+
7
+ # Navigation
8
+
9
+ Your sidebar is built from the folder structure under `src/content/docs`, and
10
+ ordered by `meta.json` files. The top navigation and area switching come from
11
+ `axerity.json`.
12
+
13
+ ## Folders become sidebar sections
14
+
15
+ Each top-level folder under `src/content/docs` becomes a section. Files inside a
16
+ folder become its pages. Nest a folder inside another and it becomes a
17
+ collapsible group.
18
+
19
+ ```
20
+ content/docs/
21
+ index.md -> /docs
22
+ installation.md -> /docs/installation
23
+ components/
24
+ callout.md -> /docs/components/callout
25
+ api/
26
+ users/
27
+ get-user.md -> /docs/api/users/get-user (nested group)
28
+ ```
29
+
30
+ ## meta.json
31
+
32
+ Every folder can have a `meta.json` that sets its title, icon, and the order of
33
+ its pages.
34
+
35
+ ```json title="meta.json"
36
+ {
37
+ "title": "Getting Started",
38
+ "icon": "rocket",
39
+ "pages": ["index", "installation", "quick-start"]
40
+ }
41
+ ```
42
+
43
+ | Field | What it does |
44
+ | ------------- | ------------------------------------------------------------- |
45
+ | `title` | The section or group label |
46
+ | `icon` | A Lucide icon name shown next to the label |
47
+ | `pages` | Order of pages by slug. Anything left out is added at the end |
48
+ | `defaultOpen` | For a nested group, expand it by default |
49
+
50
+ Pages not listed in `pages` are appended in alphabetical order, so you only have
51
+ to list the ones you care about.
52
+
53
+ ## Page frontmatter
54
+
55
+ Each page sets its own metadata in frontmatter:
56
+
57
+ ```md
58
+ ---
59
+ title: Installation
60
+ description: Get Axerity running locally.
61
+ icon: download
62
+ badge: New
63
+ ---
64
+ ```
65
+
66
+ | Field | What it does |
67
+ | ------------- | ------------------------------------------------------ |
68
+ | `title` | Sidebar label and page title |
69
+ | `description` | Used for SEO, search, and prev/next |
70
+ | `icon` | Lucide icon next to the sidebar link |
71
+ | `badge` | Small pill next to the title, such as `New` |
72
+ | `layout` | `api` switches to the wide API layout |
73
+ | `method` | An HTTP method shown as a colored badge in the sidebar |
74
+
75
+ ## Dropdowns and tabs
76
+
77
+ A dropdown swaps the entire sidebar. Use it to split a site into areas like
78
+ Guides and API Reference. Each dropdown can have its own top-nav tabs.
79
+
80
+ ```json title="axerity.json"
81
+ {
82
+ "dropdowns": [
83
+ {
84
+ "label": "Guides",
85
+ "icon": "book-open",
86
+ "href": "/docs",
87
+ "match": "/docs",
88
+ "tabs": [
89
+ { "title": "Documentation", "href": "/docs", "match": "/docs" },
90
+ { "title": "Components", "href": "/docs/components/callout", "match": "/docs/components" }
91
+ ]
92
+ },
93
+ {
94
+ "label": "API Reference",
95
+ "icon": "code",
96
+ "href": "/docs/api/users/get-user",
97
+ "match": "/docs/api"
98
+ }
99
+ ]
100
+ }
101
+ ```
102
+
103
+ - `href` is where the link goes.
104
+ - `match` is the path prefix that marks a dropdown or tab as active. The longest
105
+ match wins, so nested areas take priority.
106
+ - The sidebar shows only the sections under the active dropdown, and the navbar
107
+ shows only that dropdown's tabs.
108
+
109
+ ## Sidebar links
110
+
111
+ Pin external links to the bottom of the sidebar. They stay in place while the
112
+ nav scrolls, and open in a new tab.
113
+
114
+ ```json title="axerity.json"
115
+ {
116
+ "sidebarLinks": [
117
+ { "title": "Support", "href": "https://example.com/support" },
118
+ { "title": "Dashboard", "href": "https://app.example.com" }
119
+ ]
120
+ }
121
+ ```
122
+
123
+ ## Versions
124
+
125
+ Add a version switcher to the navbar. Each entry has a `label` and an `href`.
126
+
127
+ ```json title="axerity.json"
128
+ {
129
+ "versions": [
130
+ { "label": "v2.0", "href": "/v2" },
131
+ { "label": "v1.0", "href": "/v1" }
132
+ ]
133
+ }
134
+ ```
135
+
136
+ An `href` can point anywhere, so the simplest setup sends old versions to a
137
+ separate site:
138
+
139
+ ```json title="axerity.json"
140
+ {
141
+ "versions": [
142
+ { "label": "v2.0", "href": "/" },
143
+ { "label": "v1.0", "href": "https://v1.example.com" }
144
+ ]
145
+ }
146
+ ```
147
+
148
+ ### Versioned content
149
+
150
+ When a version's `href` is a local path like `/v2`, put that version's pages in
151
+ a matching top-level folder. Each folder is its own independent content tree
152
+ with its own sidebar.
153
+
154
+ ```
155
+ content/docs/
156
+ v2/
157
+ index.md -> /v2
158
+ installation.md -> /v2/installation
159
+ v1/
160
+ index.md -> /v1
161
+ installation.md -> /v1/installation
162
+ ```
163
+
164
+ The switcher then keeps the reader on the same page across versions. Moving from
165
+ `/v2/installation` to v1 lands on `/v1/installation` when that page exists, and
166
+ falls back to the version's index when it does not. The site root redirects to
167
+ the first version in the list.
@@ -0,0 +1,103 @@
1
+ ---
2
+ title: API reference
3
+ description: Generate a full API reference from an OpenAPI spec.
4
+ icon: webhook
5
+ ---
6
+
7
+ <script>
8
+ import { Callout } from '$lib';
9
+ </script>
10
+
11
+ # API reference
12
+
13
+ Point Axerity at an OpenAPI 3 spec and it generates the whole reference for you:
14
+ a page per operation with parameters, request and response bodies, examples, auth,
15
+ and a page per schema. The pages use the same [API components](/components/api)
16
+ you would write by hand, so they match the rest of your docs.
17
+
18
+ ## Point at a spec
19
+
20
+ Add an `openapi` field to `axerity.json`. The simplest form is a path or URL:
21
+
22
+ ```json title="axerity.json"
23
+ {
24
+ "openapi": "./openapi.json"
25
+ }
26
+ ```
27
+
28
+ The spec can be a local file or a URL, in JSON or YAML:
29
+
30
+ ```json title="axerity.json"
31
+ {
32
+ "openapi": "https://api.example.com/openapi.yaml"
33
+ }
34
+ ```
35
+
36
+ Pages are written into your content tree the next time you run `axerity dev` or
37
+ `axerity build`, and they regenerate when a local spec changes.
38
+
39
+ <Callout type="info">
40
+
41
+ Generated pages are managed for you. They are added to `.gitignore` so they do
42
+ not clutter your repo, and they are rebuilt from the spec every time.
43
+
44
+ </Callout>
45
+
46
+ ## Choose where it lands
47
+
48
+ Use the object form to set the output folder and the section title:
49
+
50
+ ```json title="axerity.json"
51
+ {
52
+ "openapi": {
53
+ "spec": "./openapi.json",
54
+ "output": "api-reference",
55
+ "title": "API Reference"
56
+ }
57
+ }
58
+ ```
59
+
60
+ | Field | Type | What it does |
61
+ | -------- | ------ | ----------------------------------------------------- |
62
+ | `spec` | string | Local path or URL to an OpenAPI 3 spec (JSON or YAML) |
63
+ | `output` | string | Content folder for the generated pages |
64
+ | `title` | string | Section title (defaults to the spec's `info.title`) |
65
+
66
+ With `output: "api-reference"`, an operation tagged `Pet` lands at
67
+ `/api-reference/pet/<operationId>` and each schema at
68
+ `/api-reference/schemas/<name>`.
69
+
70
+ ## Group several specs
71
+
72
+ Pass an array to generate more than one reference, each into its own folder:
73
+
74
+ ```json title="axerity.json"
75
+ {
76
+ "openapi": [
77
+ { "spec": "./checkout.json", "output": "checkout-api", "title": "Checkout" },
78
+ { "spec": "./storefront.json", "output": "storefront-api", "title": "Storefront" }
79
+ ]
80
+ }
81
+ ```
82
+
83
+ ## Show it as a navbar tab
84
+
85
+ The generated pages are ordinary docs, so you surface them like any other area:
86
+ add a [dropdown](/configuration/navigation) that points at the output folder.
87
+ Clicking the tab swaps the sidebar to the API reference.
88
+
89
+ ```json title="axerity.json"
90
+ {
91
+ "dropdowns": [
92
+ {
93
+ "label": "API Reference",
94
+ "icon": "code",
95
+ "href": "/api-reference/pet/getpetbyid",
96
+ "match": "/api-reference"
97
+ }
98
+ ]
99
+ }
100
+ ```
101
+
102
+ Set `href` to any page inside the folder (a good landing operation), and `match`
103
+ to the folder so the tab highlights while the reader is anywhere in the reference.
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: Search
3
+ description: Full text search across your docs.
4
+ icon: search
5
+ ---
6
+
7
+ # Search
8
+
9
+ Axerity ships with full text search powered by [Orama](https://orama.com). Press
10
+ `Cmd K` or `Ctrl K`, or click the search box in the navbar, to open it.
11
+
12
+ ## How it works
13
+
14
+ The search index is built at compile time. Every page's title, description, and
15
+ text is collected into a single JSON file. When you open search the first time,
16
+ that file is fetched and loaded into Orama in the browser. Searching then runs
17
+ locally, with no server.
18
+
19
+ ## What is indexed
20
+
21
+ - Page titles, with the highest weight.
22
+ - Page descriptions from frontmatter.
23
+ - The page body text, with Markdown and code stripped out.
24
+ - The section name, shown next to each result.
25
+
26
+ There is nothing to configure. Add pages and they are searchable on the next
27
+ build.
28
+
29
+ ## Keyboard
30
+
31
+ | Key | Action |
32
+ | -------------- | ----------------- |
33
+ | `Cmd/Ctrl + K` | Open or close |
34
+ | `Up` / `Down` | Move between hits |
35
+ | `Enter` | Open the result |
36
+ | `Esc` | Close |
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: Introduction
3
+ description: A documentation site generator for Svelte.
4
+ icon: home
5
+ ---
6
+
7
+ <script>
8
+ import { Card, CardGroup, Callout } from '$lib';
9
+ </script>
10
+
11
+ # Introduction
12
+
13
+ Axerity is a documentation site generator for Svelte. You write your content in
14
+ Markdown, drop in Svelte components when you need them, and get a fast static
15
+ site with search, navigation, and a clean theme.
16
+
17
+ ## What you get
18
+
19
+ - File based content. Add a Markdown file and it shows up in the sidebar.
20
+ - A `meta.json` in each folder to set titles, icons, and ordering.
21
+ - Code blocks with syntax highlighting, copy buttons, titles, line highlighting,
22
+ and line numbers.
23
+ - Components you can use right inside Markdown: callouts, cards, tabs, steps,
24
+ accordions, type tables, and a layout for API reference pages.
25
+ - Light and dark themes, driven entirely by CSS variables.
26
+ - Full text search, built at compile time.
27
+
28
+ <Callout type="tip">
29
+
30
+ The whole site is configured from one `axerity.json` file. Drop in Markdown,
31
+ set up your `meta.json` files, and you never have to touch the code.
32
+
33
+ </Callout>
34
+
35
+ ## Get started
36
+
37
+ <CardGroup cols={2}>
38
+ <Card title="Installation" icon="download" href="/installation">
39
+
40
+ Get Axerity running locally in about a minute.
41
+
42
+ </Card>
43
+ <Card title="Quick Start" icon="rocket" href="/quick-start">
44
+
45
+ Write your first page and watch the sidebar fill in.
46
+
47
+ </Card>
48
+ <Card title="Components" icon="blocks" href="/components/callout">
49
+
50
+ Browse the components you can use in your pages.
51
+
52
+ </Card>
53
+ <Card title="API Reference" icon="code" href="/api/pet/pet-object">
54
+
55
+ See the layout built for documenting an API.
56
+
57
+ </Card>
58
+
59
+ </CardGroup>