|
| 1 | +--- |
| 2 | +title: Features |
| 3 | +description: Overview of Chronicle features |
| 4 | +order: 2 |
| 5 | +--- |
| 6 | + |
| 7 | +# Features |
| 8 | + |
| 9 | +Chronicle is a self-hosted documentation platform built with Vite + Nitro. Here's what it offers. |
| 10 | + |
| 11 | +## Content |
| 12 | + |
| 13 | +- **MDX support** — write documentation in MDX with React component embedding |
| 14 | +- **Frontmatter** — `title`, `description`, `order`, `icon`, `lastModified` |
| 15 | +- **Directory metadata** — `meta.json` for folder titles, ordering, and sidebar config |
| 16 | +- **Remark plugins** — directives, admonitions, image resolution, link resolution, mermaid, reading time |
| 17 | +- **Syntax highlighting** — powered by Shiki via Apsara CodeBlock |
| 18 | +- **Versioning** — multiple documentation versions with URL-based routing |
| 19 | + |
| 20 | +## API Reference |
| 21 | + |
| 22 | +- **OpenAPI / Swagger support** — auto-generates API reference pages from specs (OpenAPI 3.x and Swagger 2.0) |
| 23 | +- **Read-only overview** — field names, types, required badges, examples, response schemas |
| 24 | +- **Playground dialog** — test requests with editable fields, JSON body editor, auth switching |
| 25 | +- **Auth types** — API Key, Bearer Token, Basic Auth (auto-detected from spec `securitySchemes`) |
| 26 | +- **Code snippets** — cURL, Python, Go, TypeScript with language switcher |
| 27 | +- **Response panel** — status code tabs with JSON syntax highlighting |
| 28 | +- **`.md` export** — every API endpoint has a `.md` URL with full documentation |
| 29 | + |
| 30 | +## Navigation |
| 31 | + |
| 32 | +- **Sidebar** — auto-generated from file structure, configurable via `meta.json` |
| 33 | +- **Breadcrumbs** — shows path hierarchy for docs and API pages |
| 34 | +- **Prev/Next** — arrow navigation between pages and API endpoints |
| 35 | +- **Search** — keyword search across all documentation |
| 36 | +- **Folder sorting** — via `order` in `meta.json` or frontmatter |
| 37 | + |
| 38 | +## Themes |
| 39 | + |
| 40 | +- **Default theme** — sidebar + content layout with sub-navigation bar |
| 41 | +- **Paper theme** — book-style single-column with reading progress |
| 42 | +- **Dark/light mode** — system preference or manual toggle |
| 43 | + |
| 44 | +## SEO & AI |
| 45 | + |
| 46 | +- **Meta tags** — auto-generated title, description, Open Graph, Twitter Card |
| 47 | +- **Sitemap** — auto-generated `sitemap.xml` |
| 48 | +- **robots.txt** — auto-generated |
| 49 | +- **llms.txt** — AI-discoverable documentation index |
| 50 | +- **`.md` URLs** — every page (docs and API) has a markdown URL for AI tools |
| 51 | +- **Open in AI** — copy as markdown, open in ChatGPT or Claude |
| 52 | + |
| 53 | +## Developer Experience |
| 54 | + |
| 55 | +- **CLI** — `chronicle dev`, `chronicle build`, `chronicle start` |
| 56 | +- **Hot reload** — instant updates during development |
| 57 | +- **Monorepo support** — works as a package in monorepos |
| 58 | +- **Docker support** — containerized deployment |
| 59 | +- **Zod-validated config** — `chronicle.yaml` with schema validation |
| 60 | + |
| 61 | +--- |
| 62 | + |
| 63 | +## Configuration |
| 64 | + |
| 65 | +### chronicle.yaml |
| 66 | + |
| 67 | +```yaml |
| 68 | +site: |
| 69 | + title: My Documentation |
| 70 | + description: Documentation powered by Chronicle |
| 71 | + |
| 72 | +content: |
| 73 | + - dir: docs |
| 74 | + label: Docs |
| 75 | + index_page: getting-started # redirect /docs to this page |
| 76 | + |
| 77 | +theme: |
| 78 | + name: default |
| 79 | + |
| 80 | +search: |
| 81 | + enabled: true |
| 82 | + |
| 83 | +api: |
| 84 | + - name: Petstore |
| 85 | + spec: ./petstore.json |
| 86 | + basePath: /apis |
| 87 | + server: |
| 88 | + url: https://petstore.swagger.io/v2 |
| 89 | + auth: |
| 90 | + type: apiKey |
| 91 | + header: api_key |
| 92 | + placeholder: "Enter your API key" |
| 93 | +``` |
| 94 | +
|
| 95 | +### meta.json |
| 96 | +
|
| 97 | +Place `meta.json` in any folder to control sidebar behavior: |
| 98 | + |
| 99 | +```json |
| 100 | +{ |
| 101 | + "title": "Getting Started", |
| 102 | + "order": 1, |
| 103 | + "pages": ["introduction", "installation", "quick-start"], |
| 104 | + "defaultOpen": true |
| 105 | +} |
| 106 | +``` |
| 107 | + |
| 108 | +| Field | Description | |
| 109 | +|---|---| |
| 110 | +| `title` | Folder display name in sidebar and breadcrumbs | |
| 111 | +| `order` | Sort order (lower = first) | |
| 112 | +| `pages` | Explicit page ordering within folder | |
| 113 | +| `root` | Mark as content root boundary | |
| 114 | +| `defaultOpen` | Sidebar folder open by default | |
| 115 | +| `icon` | Folder icon | |
| 116 | + |
| 117 | +### Page Frontmatter |
| 118 | + |
| 119 | +```mdx |
| 120 | +--- |
| 121 | +title: My Page |
| 122 | +description: Page description for SEO |
| 123 | +order: 1 |
| 124 | +icon: book |
| 125 | +lastModified: 2024-01-15 |
| 126 | +--- |
| 127 | +``` |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## Markdown URLs |
| 132 | + |
| 133 | +Every page has a `.md` URL that returns raw markdown: |
| 134 | + |
| 135 | +- **Docs pages**: `/{slug}.md` — returns the raw MDX content |
| 136 | +- **API endpoints**: `/apis/{spec}/{operationId}.md` — generates markdown with: |
| 137 | + - Authorization headers |
| 138 | + - Path, query, body parameters with types and descriptions |
| 139 | + - Request body example JSON |
| 140 | + - Response schemas per status code |
| 141 | + - cURL example |
| 142 | + |
| 143 | +### Usage |
| 144 | + |
| 145 | +```bash |
| 146 | +# Get markdown for a docs page |
| 147 | +curl https://docs.example.com/docs/getting-started.md |
| 148 | +
|
| 149 | +# Get markdown for an API endpoint |
| 150 | +curl https://docs.example.com/apis/petstore/findPetsByStatus.md |
| 151 | +``` |
| 152 | + |
| 153 | +The "Open in AI" dropdown in the navbar uses these URLs to: |
| 154 | +- **Copy as MD** — copies markdown to clipboard |
| 155 | +- **View MD** — opens markdown in new tab |
| 156 | +- **Open in ChatGPT** — sends the `.md` URL to ChatGPT |
| 157 | +- **Open in Claude** — sends the `.md` URL to Claude |
| 158 | + |
| 159 | +--- |
| 160 | + |
| 161 | +## API Reference Page |
| 162 | + |
| 163 | +### Overview Page |
| 164 | + |
| 165 | +The API overview shows: |
| 166 | +- Endpoint title and description |
| 167 | +- HTTP method badge + path with copy button |
| 168 | +- **Authorisations** — auth header fields |
| 169 | +- **Path/Query Parameters** — field name, type, required badge, description, example |
| 170 | +- **Request Body** — fields with nested object support |
| 171 | +- **Response** — status code selector, field definitions, "Show child attributes" for nested objects |
| 172 | + |
| 173 | +Right column: |
| 174 | +- Code snippet with language selector (cURL, Python, Go, TypeScript) |
| 175 | +- Response JSON panel with status code tabs |
| 176 | + |
| 177 | +### Playground Dialog |
| 178 | + |
| 179 | +Click **Test request** in the navbar to open the playground: |
| 180 | +- **Auth switching** — select between API Key, Bearer Token, Basic Auth |
| 181 | +- **Editable fields** — fill path, query, header, body parameters |
| 182 | +- **JSON editor** — toggle between form fields and raw JSON editor |
| 183 | +- **Send** — sends request via proxy, shows response with status + time |
| 184 | +- **Response headers** — switch between Body and Headers view |
| 185 | + |
| 186 | +### View Documentation |
| 187 | + |
| 188 | +If the OpenAPI spec has `externalDocs`, a **View documentation** button appears in the navbar linking to external docs. |
0 commit comments