Skip to content

Templates

Templates control how a project looks in every export. They bundle styles, assets, and configuration so that authors can focus on their content while the system handles layout.

What you get out of the box

Our default installation ships with the Generic Monograph and Generic Journal templates. Each template exposes friendly settings in the editor—paper size, headers, fonts, and more—so you can start with sensible defaults and fine-tune only when needed.

Supported export formats

  • PDF (PrinceXML is our primary engine; Paged.js remains available for experimentation with limited functionality)
  • HTML for the responsive reader
  • EPUB
  • XML (JATS and BITS)

About Paged.js

We support the open-source Paged.js ecosystem and keep it available for teams who want to experiment. For production-grade publishing, especially when accessibility and precise layout control are essential, we recommend staying with PrinceXML.

Where templates live

Templates are stored on disk. Standard installations include them so you can use them immediately. In self-hosted setups, copy the template directories from our reference repository into your own template directory.

Each template directory follows the same pattern:

File or folder Purpose
configuration.sfo.yml (or configuration.yml) Main configuration that wires components together and defines options shown in the UI.
metaData.schema.yml Optional JSON Schema describing project-specific metadata fields.
styles.scss Global stylesheet injected at the start of every export.
assets/ Handlebars templates, logos, and other static files referenced by the configuration.
translations/ Optional locale files so you can localise labels and messages.

How rendering works (high level)

  1. The editor reads configuration.sfo.yml to show human-friendly settings.
  2. When you export, the pipeline loads the configuration and assets from disk (see libs/tdk/src/template.ts).
  3. Individual components—like headers, typography, or the table of contents—render into the document based on the settings you selected.
  4. Optional variants apply JSON patches to adjust defaults (for example, switching between single- and double-sided layouts).

You do not need to understand the TypeScript source to get started, but it is helpful to know that every toggle in the UI ultimately maps back to these configuration files.

Customising templates safely

The quickest way to customise a standard template is from the editor: open Document settings → Template options and adjust typography, margins, or other exposed controls. These choices are stored alongside the document, so you can experiment without altering the base template.

Settings UI showing multiple options to customise a template

Settings UI example

Template authors decide which options appear in the editor by editing configuration.sfo.yml.

To change the defaults for everyone, copy the template directory and edit its files. Typical next steps include:

  • Adjusting default values inside configuration.sfo.yml
  • Updating assets (logos, headers, additional styles)
  • Extending metadata schemas or providing translations

Learn more

Use the guides in this section when you are ready to dive deeper:

  • Configuration basics — structure of configuration.sfo.yml, the most common keys, and how they surface in the editor.
  • Components and layout — how reusable components such as headers, typography, and tables of contents work together.
  • Assets and media — managing Handlebars templates, images, and styles referenced from the configuration.
  • Variants and presets — using variants to offer predefined layouts without duplicating an entire template.
  • Fonts — packaging custom fonts and linking to hosted services.