Exporting Content
Any entity can be exported from its detail page as a document you can share, print, or archive. Exports are rendered by the StudioBrain server (sb-server in core), from the entity’s fields and markdown body.
Export an entity
- Open the entity’s detail page.
- Open the Export menu in the toolbar.
- Pick a format.
The menu offers:
| Item | What you get |
|---|---|
| Styled PDF. A submenu chooses A4 or US Letter page size. | |
| Word (.docx) | Editable Microsoft Word file. |
| Markdown | The entity’s source file: YAML frontmatter followed by the markdown body. |
| Google Drive… | Renders a DOCX and saves it to a Drive folder you pick. Shown only when the Google Drive export feature is enabled; if Drive is not connected you are sent to connect it. |
The browser downloads the file automatically. HTML and a ZIP markdown bundle are also available (HTML through the API below, the bundle only in the legacy raw-markdown file view).
Document entities
When an entity’s template category is document (scripts, chapters, scenes, acts and similar), the menu also shows Include Table of Contents and Include Cover Page toggles for PDF and Word. They do not appear for characters, locations, items and other non-document types. The toggles start checked in the menu; called directly through the API, include_toc and include_cover default to false.
Document entities are identified by the template’s template_category (document). If the toggles are missing on something you expect to be a document, check that template’s category.
HTML export and layouts
HTML export takes a layout and a theme as query parameters:
POST /api/export/{entity_type}/{entity_id}/html?layout=gdd_standard&theme=defaultBuilt-in layouts (GET /api/export-layouts lists them):
| Layout id | Description |
|---|---|
gdd_standard (default) | Standard Game Design Document layout |
script_format | Screenplay/dialogue script format |
style_guide | Brand and style guide layout |
character_sheet | Character profile with stats and bio |
location_brief | Location overview with map reference |
minimal | Minimal layout without metadata |
detailed | Full detail layout with all fields |
Themes select a CSS variant of a layout (default and dark are used by the built-in templates); an unknown layout or theme falls back to default styling. Layouts and themes are built into the server. There is no user-editable export template folder.
API
All per-entity routes exist under /api/export/{entity_type}/{entity_id}/…:
pdf(?page=a4|letter,include_toc,include_cover)docx(include_toc,include_cover)html(layout,theme)markdownformatslists the formats the server reports as available.
PDF is produced by the Rust typst engine, which requires the server to be built with the pdf feature; builds without it return the raw markdown text instead of a PDF. No Playwright or browser install is involved. DOCX is built in Rust with no extra dependencies. See the Export API Reference and Export System Architecture.
Tips
- To export many entities, export them one at a time, or use project export/backup for a full copy of your data.
- Use Word when you need to edit the result, PDF for printing, and Markdown to keep the portable source.
Troubleshooting
- No Google Drive item in the menu: the feature is disabled on that server.
- PDF export unavailable or fails: the server build lacks the
pdffeature; check the server logs. - DOCX export fails: check the backend logs for export errors.
- Cover/TOC toggles missing: the entity’s template category is not
document.