docula 0.41.1 → 0.50.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.
- package/README.md +110 -0
- package/dist/docula.d.ts +19 -1
- package/dist/docula.js +559 -126
- package/package.json +6 -2
- package/{template → templates/classic}/css/base.css +10 -0
- package/{template → templates/classic}/css/multipage.css +7 -0
- package/{template → templates/classic}/docs.hbs +1 -1
- package/{template/index.hbs → templates/classic/home.hbs} +7 -1
- package/templates/classic/includes/multipage/api-reference.hbs +1 -0
- package/templates/classic/includes/multipage/documentation.hbs +1 -0
- package/{template → templates/classic}/includes/multipage/hero.hbs +1 -2
- package/{template → templates/classic}/includes/multipage/home.hbs +3 -3
- package/{template → templates/classic}/includes/singlepage/content.hbs +3 -3
- package/templates/modern/api.hbs +30 -0
- package/templates/modern/changelog-entry.hbs +36 -0
- package/templates/modern/changelog.hbs +38 -0
- package/templates/modern/css/highlight/highlight.min.js +1433 -0
- package/templates/modern/css/highlight/styles/base16/docula.css +123 -0
- package/templates/modern/css/home.css +96 -0
- package/templates/modern/css/styles.css +697 -0
- package/templates/modern/docs.hbs +30 -0
- package/templates/modern/home.hbs +51 -0
- package/templates/modern/includes/api-reference.hbs +1 -0
- package/templates/modern/includes/doc.hbs +18 -0
- package/templates/modern/includes/documentation.hbs +1 -0
- package/templates/modern/includes/footer.hbs +6 -0
- package/templates/modern/includes/header-bar.hbs +57 -0
- package/templates/modern/includes/header.hbs +15 -0
- package/templates/modern/includes/hero.hbs +11 -0
- package/templates/modern/includes/home.hbs +46 -0
- package/templates/modern/includes/scripts.hbs +161 -0
- package/templates/modern/includes/sidebar.hbs +22 -0
- package/templates/modern/includes/theme-toggle.hbs +5 -0
- package/template/releases.hbs +0 -86
- /package/{template → templates/classic}/api.hbs +0 -0
- /package/{template → templates/classic}/changelog-entry.hbs +0 -0
- /package/{template → templates/classic}/changelog.hbs +0 -0
- /package/{template → templates/classic}/css/highlight/highlight.min.js +0 -0
- /package/{template → templates/classic}/css/highlight/styles/base16/dracula.min.css +0 -0
- /package/{template → templates/classic}/css/landing.css +0 -0
- /package/{template → templates/classic}/css/singlepage.css +0 -0
- /package/{template → templates/classic}/includes/footer.hbs +0 -0
- /package/{template → templates/classic}/includes/header.hbs +0 -0
- /package/{template → templates/classic}/includes/multipage/doc.hbs +0 -0
- /package/{template → templates/classic}/includes/multipage/header.hbs +0 -0
- /package/{template → templates/classic}/includes/multipage/scripts.hbs +0 -0
- /package/{template → templates/classic}/includes/multipage/sidebar.hbs +0 -0
- /package/{template → templates/classic}/includes/scripts.hbs +0 -0
- /package/{template → templates/classic}/includes/singlepage/hero.hbs +0 -0
package/README.md
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
- [Using Your own Template](#using-your-own-template)
|
|
17
17
|
- [Building Multiple Pages](#building-multiple-pages)
|
|
18
18
|
- [Public Folder](#public-folder)
|
|
19
|
+
- [API Reference](#api-reference)
|
|
20
|
+
- [LLM Files](#llm-files)
|
|
19
21
|
- [Announcements](#announcements)
|
|
20
22
|
- [Changelog](#changelog)
|
|
21
23
|
- [Alert, Info, Warn Styling](#alert-info-warn-styling)
|
|
@@ -32,6 +34,7 @@
|
|
|
32
34
|
* Full TypeScript support with typed configuration and IDE autocompletion.
|
|
33
35
|
* Support for single page with readme or multiple markdown pages in a docs folder.
|
|
34
36
|
* Will generate a sitemap.xml and robots.txt for your site.
|
|
37
|
+
* Automatically generates `llms.txt` and `llms-full.txt` for LLM-friendly indexing of docs, API reference, and changelog content.
|
|
35
38
|
* Uses Github release notes to generate a changelog / releases page.
|
|
36
39
|
* Uses Github to show contributors and link to their profiles.
|
|
37
40
|
* Simple search is provided by default out of the box.
|
|
@@ -138,7 +141,11 @@ When both config files exist, Docula loads them in this order (first found wins)
|
|
|
138
141
|
| `siteUrl` | `string` | - | Website URL |
|
|
139
142
|
| `port` | `number` | `3000` | Port for local development server |
|
|
140
143
|
| `singlePage` | `boolean` | `true` | Single page or multi-page site |
|
|
144
|
+
| `homePage` | `boolean` | `true` | When `false`, Docula uses the first docs page as `/index.html` instead of rendering `home.hbs` |
|
|
141
145
|
| `sections` | `DoculaSection[]` | - | Documentation sections |
|
|
146
|
+
| `openApiUrl` | `string` | - | OpenAPI spec URL for API documentation (auto-detected if `api/swagger.json` exists) |
|
|
147
|
+
| `enableReleaseChangelog` | `boolean` | `true` | Convert GitHub releases to changelog entries |
|
|
148
|
+
| `enableLlmsTxt` | `boolean` | `true` | Generate `llms.txt` and `llms-full.txt` in the build output |
|
|
142
149
|
|
|
143
150
|
# Using Your own Template
|
|
144
151
|
|
|
@@ -172,6 +179,14 @@ title: Getting Started
|
|
|
172
179
|
order: 2
|
|
173
180
|
```
|
|
174
181
|
|
|
182
|
+
If you want your docs to be the root home page (`/`) instead of rendering the template home page, set `homePage: false`:
|
|
183
|
+
|
|
184
|
+
```js
|
|
185
|
+
export const options = {
|
|
186
|
+
homePage: false,
|
|
187
|
+
};
|
|
188
|
+
```
|
|
189
|
+
|
|
175
190
|
# Public Folder
|
|
176
191
|
|
|
177
192
|
If you have static assets like images, fonts, or other files that need to be copied directly to your built site, you can use a `public` folder. Any files placed in the `public` folder within your site directory will be automatically copied to the root of your `dist` output folder during the build process.
|
|
@@ -228,6 +243,101 @@ This is useful for:
|
|
|
228
243
|
- Custom fonts
|
|
229
244
|
- Any other static assets that need to be served from your site
|
|
230
245
|
|
|
246
|
+
# API Reference
|
|
247
|
+
|
|
248
|
+
Docula can generate an API Reference page from an OpenAPI (Swagger) specification. The page is rendered using [Docutopia](https://www.npmjs.com/package/@docutopia/react) and is available at `/api`.
|
|
249
|
+
|
|
250
|
+
## Auto-Detection
|
|
251
|
+
|
|
252
|
+
If your site directory contains an `api/swagger.json` file, Docula will automatically detect it and generate the API Reference page — no configuration needed:
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
site
|
|
256
|
+
├───api
|
|
257
|
+
│ └───swagger.json
|
|
258
|
+
├───docs
|
|
259
|
+
├───logo.svg
|
|
260
|
+
├───favicon.ico
|
|
261
|
+
└───docula.config.mjs
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Explicit Configuration
|
|
265
|
+
|
|
266
|
+
You can also set the `openApiUrl` option in your config to point to any OpenAPI spec, either a local path or a remote URL:
|
|
267
|
+
|
|
268
|
+
```js
|
|
269
|
+
export const options = {
|
|
270
|
+
openApiUrl: '/api/swagger.json',
|
|
271
|
+
// or a remote URL:
|
|
272
|
+
// openApiUrl: 'https://petstore.swagger.io/v2/swagger.json',
|
|
273
|
+
};
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
When `openApiUrl` is set explicitly, it takes priority over auto-detection.
|
|
277
|
+
|
|
278
|
+
## Spec Requirements
|
|
279
|
+
|
|
280
|
+
The file must be a valid OpenAPI 3.x or Swagger 2.0 JSON specification. A minimal example:
|
|
281
|
+
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"openapi": "3.0.0",
|
|
285
|
+
"info": {
|
|
286
|
+
"title": "My API",
|
|
287
|
+
"version": "1.0.0"
|
|
288
|
+
},
|
|
289
|
+
"paths": {}
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
# LLM Files
|
|
294
|
+
|
|
295
|
+
Docula generates two LLM-focused files in the output directory by default:
|
|
296
|
+
|
|
297
|
+
- `/llms.txt` - a compact index of your docs, API reference, and changelog URLs.
|
|
298
|
+
- `/llms-full.txt` - expanded content including markdown bodies for docs/changelog and local OpenAPI spec text.
|
|
299
|
+
|
|
300
|
+
## What Gets Included
|
|
301
|
+
|
|
302
|
+
`/llms.txt` includes:
|
|
303
|
+
- Site title and description
|
|
304
|
+
- A link to `/llms-full.txt`
|
|
305
|
+
- Documentation links (absolute URLs)
|
|
306
|
+
- API Reference link when API docs are generated
|
|
307
|
+
- Changelog landing page and the latest 20 changelog entries
|
|
308
|
+
|
|
309
|
+
`/llms-full.txt` includes:
|
|
310
|
+
- Site title and description
|
|
311
|
+
- Full markdown body for each docs page
|
|
312
|
+
- Full markdown body for each changelog entry
|
|
313
|
+
- Full local OpenAPI spec text when available (for example `site/api/swagger.json`)
|
|
314
|
+
|
|
315
|
+
If `openApiUrl` points to a remote URL, `/llms-full.txt` includes only the URL reference instead of fetching content over the network.
|
|
316
|
+
|
|
317
|
+
## Configuration
|
|
318
|
+
|
|
319
|
+
To disable generation:
|
|
320
|
+
|
|
321
|
+
```js
|
|
322
|
+
export const options = {
|
|
323
|
+
enableLlmsTxt: false,
|
|
324
|
+
};
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## Custom Overrides
|
|
328
|
+
|
|
329
|
+
You can override generated output by providing custom files in your site directory:
|
|
330
|
+
|
|
331
|
+
- `site/llms.txt`
|
|
332
|
+
- `site/llms-full.txt`
|
|
333
|
+
|
|
334
|
+
If present, Docula copies these files to output as-is.
|
|
335
|
+
|
|
336
|
+
## Notes
|
|
337
|
+
|
|
338
|
+
- These files are generated in the output root (`dist/llms.txt` and `dist/llms-full.txt`).
|
|
339
|
+
- They are not added to `sitemap.xml`.
|
|
340
|
+
|
|
231
341
|
# Announcements
|
|
232
342
|
|
|
233
343
|
You can display an announcement banner on your home page by creating an `announcement.md` file in your site directory. This is useful for highlighting important updates, new releases, or any time-sensitive information.
|
package/dist/docula.d.ts
CHANGED
|
@@ -10,7 +10,11 @@ type DoculaSection = {
|
|
|
10
10
|
|
|
11
11
|
declare class DoculaOptions {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Name of the built-in template to use (e.g., "modern", "classic")
|
|
14
|
+
*/
|
|
15
|
+
template: string;
|
|
16
|
+
/**
|
|
17
|
+
* Path to the template directory. When set, overrides the `template` option.
|
|
14
18
|
*/
|
|
15
19
|
templatePath: string;
|
|
16
20
|
/**
|
|
@@ -55,6 +59,20 @@ declare class DoculaOptions {
|
|
|
55
59
|
* Supports both external URLs (https://...) and relative paths (/openapi.json)
|
|
56
60
|
*/
|
|
57
61
|
openApiUrl?: string;
|
|
62
|
+
/**
|
|
63
|
+
* When true, GitHub releases are converted to changelog entries and merged
|
|
64
|
+
* with file-based changelog entries. Requires a changelog template to exist.
|
|
65
|
+
*/
|
|
66
|
+
enableReleaseChangelog: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* When false, the first document becomes the home page (index.html)
|
|
69
|
+
* and the home.hbs template is not rendered.
|
|
70
|
+
*/
|
|
71
|
+
homePage: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* When true, generates llms.txt and llms-full.txt files for the built site.
|
|
74
|
+
*/
|
|
75
|
+
enableLlmsTxt: boolean;
|
|
58
76
|
constructor(options?: Record<string, unknown>);
|
|
59
77
|
parseOptions(options: Record<string, any>): void;
|
|
60
78
|
}
|