Skip to main content

The fun part: these docs wrote themselves (via the API)

Here's the meta bit. BookStack has a full REST API, and every shelf, book, and page in this documentation was created through it, not typed into the web editor. Covers included.

POST /api/books    (name, description, + a generated cover image)
POST /api/shelves  (name, description, the list of books it holds)
POST /api/pages    (book_id, title, the page in Markdown)

Authenticated with an API token (<REDACTED>), a small script walked the whole outline — created the two shelves, the seventeen books with generated cover images, and every page — in a handful of automated passes. The cover images themselves were generated programmatically (simple title cards) and uploaded the same way.

Why we use this (and the lesson): documentation that can be generated and updated by API is documentation you can keep current. The dream is docs-as-code — outline in version control, rendered into the wiki by a pipeline. Doing it through the API here is the first step toward that: the structure of this very wiki is reproducible, not hand-clicked. If it's worth building, it's worth being able to rebuild — and that includes the docs.