docs(mdbook-htmx): config reference
@aRustyDev ci sta già lavorando.
Dal 5/1/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Configuration Reference
This document provides a complete reference for all [output.htmx] configuration options in book.toml.
Overview
mdbook-htmx is configured in the [output.htmx] section of book.toml:
[output.htmx]
version = "1.0"
htmx-version = "2.0.4"
boost = true
Schema Reference
Configuration is validated against the JSON Schema at:
https://schemas.arusty.dev/mdbook-htmx/book-config.schema.json
Core Settings
| Key | Type | Default | Description |
|---|---|---|---|
version |
string | - | Configuration schema version |
htmx-version |
string | "2.0.4" |
HTMX library version to bundle |
boost |
boolean | true |
Enable hx-boost on body |
swap-strategy |
enum | "innerHTML" |
Default hx-swap strategy |
target |
string | "#content" |
Default hx-target selector |
push-url |
boolean | true |
Update browser URL on navigation |
template-engine |
enum | "tera" |
Template engine |
theme |
string | - | Path to custom theme directory |
output-mode |
enum | "both" |
Output mode |
Version
Schema version for configuration compatibility:
[output.htmx]
version = "1.0"
HTMX Version
Controls which HTMX library version is bundled:
[output.htmx]
htmx-version = "2.0.4"
Swap Strategy
Default hx-swap strategy for content replacement:
| Value | Description |
|---|---|
innerHTML |
Replace inner HTML of target (default) |
outerHTML |
Replace entire target element |
beforebegin |
Insert before target |
afterbegin |
Insert at start of target |
beforeend |
Insert at end of target |
afterend |
Insert after target |
delete |
Delete target |
none |
No swap |
[output.htmx]
swap-strategy = "innerHTML"
Template Engine
Supported template engines:
| Value | Description |
|---|---|
tera |
Tera (Jinja2-like, default) |
handlebars |
Handlebars |
nunjucks |
Nunjucks |
liquid |
Liquid |
[output.htmx]
template-engine = "tera"
Output Mode
Controls what files are generated:
| Value | Description |
|---|---|
full |
Complete pages with layout |
fragments |
Content-only partials |
both |
Both full pages and fragments (default) |
[output.htmx]
output-mode = "both"
Navigation ([output.htmx.navigation])
| Key | Type | Default | Description |
|---|---|---|---|
sidebar-collapse |
boolean | true |
Enable collapsible sidebar sections |
header-nav |
boolean | true |
Show in-page header navigation |
breadcrumbs |
boolean | true |
Show breadcrumb trail |
prev-next |
boolean | true |
Show previous/next navigation |
[output.htmx.navigation]
sidebar-collapse = true
header-nav = true
breadcrumbs = true
prev-next = true
Authentication ([output.htmx.authn])
| Key | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | false |
Enable authentication features |
signin-page |
string | "/auth/signin" |
Public sign-in page path |
signin-partial |
string | "partials/signin.html" |
Sign-in partial template |
signout-page |
string | "/auth/signout" |
Sign-out page path |
session-header |
string | "X-User-Session" |
HTTP header for session token |
user-header |
string | "X-User-ID" |
HTTP header for user identity |
provider |
enum | - | Auth provider hint |
Provider Values
| Value | Description |
|---|---|
jwt |
JSON Web Token |
session |
Server-side sessions |
oauth2 |
OAuth 2.0 |
saml |
SAML 2.0 |
[output.htmx.authn]
enabled = true
signin-page = "/auth/signin"
signin-partial = "partials/signin.html"
signout-page = "/auth/signout"
session-header = "X-User-Session"
user-header = "X-User-ID"
provider = "jwt"
Authorization ([output.htmx.authz])
| Key | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | false |
Enable authorization features |
frontmatter-key |
string | "auth" |
Frontmatter key for auth rules |
default-access |
enum | "public" |
Default access level |
denied-partial |
string | "partials/access-denied.html" |
Access denied template |
provider |
enum | "manifest" |
Authorization provider hint |
Default Access Levels
| Value | Description |
|---|---|
public |
Anyone can access (default) |
authenticated |
Logged-in users only |
roles |
Specific roles only |
Provider Values
| Value | Description |
|---|---|
manifest |
Manifest-based (default) |
spicedb |
SpiceDB/Zanzibar |
openfga |
OpenFGA |
opa |
Open Policy Agent |
[output.htmx.authz]
enabled = true
frontmatter-key = "auth"
default-access = "public"
denied-partial = "partials/access-denied.html"
provider = "manifest"
Search ([output.htmx.search])
| Key | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable search index generation |
index-format |
enum | "json" |
Search index format |
heading-split-level |
integer | 3 |
Max heading level to index (1-6) |
include-body |
boolean | true |
Include full body text |
max-body-length |
integer | 10000 |
Max body text length per page |
scope-indexes |
boolean | true |
Generate per-scope indexes |
authz-filter |
boolean | true |
Include auth info for filtering |
exclude |
string[] | [] |
Glob patterns to exclude |
Index Format
| Value | Description |
|---|---|
json |
JSON file (default) |
sqlite |
SQLite database |
pagefind |
Pagefind format |
[output.htmx.search]
enabled = true
index-format = "json"
heading-split-level = 3
include-body = true
max-body-length = 10000
scope-indexes = true
authz-filter = true
exclude = ["drafts/*", "internal/*"]
External Search ([output.htmx.search.external])
| Key | Type | Description |
|---|---|---|
engine |
enum | External search engine |
index-name |
string | Search index/collection name |
Engine Values
| Value | Description |
|---|---|
meilisearch |
Meilisearch |
typesense |
Typesense |
algolia |
Algolia |
[output.htmx.search.external]
engine = "meilisearch"
index-name = "docs"
Assets ([output.htmx.assets])
| Key | Type | Default | Description |
|---|---|---|---|
hash-files |
boolean | true |
Add content hash for cache busting |
inline-css |
boolean | false |
Inline critical CSS |
copy-htmx |
boolean | true |
Copy htmx.min.js to output |
minify |
boolean | false |
Minify HTML, CSS, JS |
compress |
boolean | false |
Generate gzip/brotli versions |
[output.htmx.assets]
hash-files = true
inline-css = false
copy-htmx = true
minify = false
compress = false
Scopes ([output.htmx.scopes])
| Key | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | false |
Enable audience scopes |
available |
string[] | ["all"] |
Available scope names |
default |
string | "all" |
Default scope |
global-scopes |
string[] | ["all"] |
Scopes in main index |
[output.htmx.scopes]
enabled = true
available = ["all", "developers", "managers", "sre"]
default = "all"
global-scopes = ["all"]
Complete Example
[book]
title = "Platform Documentation"
authors = ["Platform Team"]
description = "Complete platform reference"
language = "en"
[output.htmx]
version = "1.0"
htmx-version = "2.0.4"
boost = true
swap-strategy = "innerHTML"
target = "#content"
push-url = true
template-engine = "tera"
theme = "my-theme"
output-mode = "both"
[output.htmx.navigation]
sidebar-collapse = true
header-nav = true
breadcrumbs = true
prev-next = true
[output.htmx.authn]
enabled = true
signin-page = "/auth/signin"
signin-partial = "partials/signin.html"
signout-page = "/auth/signout"
provider = "jwt"
[output.htmx.authz]
enabled = true
frontmatter-key = "auth"
default-access = "public"
denied-partial = "partials/access-denied.html"
provider = "manifest"
[output.htmx.search]
enabled = true
index-format = "json"
heading-split-level = 3
include-body = true
max-body-length = 10000
scope-indexes = true
authz-filter = true
exclude = ["drafts/*"]
[output.htmx.search.external]
engine = "meilisearch"
index-name = "platform-docs"
[output.htmx.assets]
hash-files = true
inline-css = false
copy-htmx = true
minify = true
compress = true
[output.htmx.scopes]
enabled = true
available = ["all", "developers", "managers", "sre"]
default = "all"
global-scopes = ["all"]
Minimal Example
For a simple setup with defaults:
[book]
title = "My Docs"
[output.htmx]
version = "1.0"
Environment Variables
Configuration can be overridden via environment variables:
| Variable | Config Key |
|---|---|
MDBOOK_HTMX_BOOST |
boost |
MDBOOK_HTMX_MINIFY |
assets.minify |
MDBOOK_HTMX_SEARCH_ENABLED |
search.enabled |
MDBOOK_HTMX_MINIFY=true mdbook build
Related Documentation
- Lingua principale
- Rust
- Stelle
- 0
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aRustyDev/mdbook-htmx
-
feat(ci): Implement cross-repo-validate compliance for docs syncForse di nuovo libera @aRustyDev l’ha presa 275 giorni fa e non c’è nessuna pull request aperta. Apertaci enhancement
aRustyDev/mdbook-htmx#58 · 1 commento · 1 assegnatario ·
-
docs(htmx): Explain how HTMX worksForse di nuovo libera @aRustyDev l’ha presa 277 giorni fa e non c’è nessuna pull request aperta. Aperta
aRustyDev/mdbook-htmx#48 · 3 commenti · 1 assegnatario ·
-
docs(mdbook-htmx): Parent Issue for documentationForse di nuovo libera @aRustyDev l’ha presa 277 giorni fa e non c’è nessuna pull request aperta. Apertadocumentation
aRustyDev/mdbook-htmx#47 · 1 assegnatario ·
-
docs(examples): Secure Self-Hosted Meilisearch via CloudflareForse di nuovo libera @aRustyDev l’ha presa 277 giorni fa e non c’è nessuna pull request aperta. Apertadocumentation
aRustyDev/mdbook-htmx#46 · 1 assegnatario ·
-
docs(examples): Kubernetes with MeilisearchForse di nuovo libera @aRustyDev l’ha presa 277 giorni fa e non c’è nessuna pull request aperta. Apertadocumentation
aRustyDev/mdbook-htmx#45 · 1 assegnatario ·
Tutte le issue di aRustyDev/mdbook-htmx
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
chroma-core/chroma#7879 ·
I maintainer di solito rispondono entro 1 giorno
-
priority middle
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
KATO-Hiro/AtCoderClans#12838 ·
I maintainer di solito rispondono entro 1 giorno
-
clap_complete env (PowerShell): values after a space don't complete in Windows PowerShell 5.1Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno