/ Book Mode / Extension Configuration

The [extensions] table in sena.toml configures templates, asset copying, head/body injections, and external plugins—serving as the primary entry point for customizing Book mode builds.

FieldTypeDescription
templateStringPath to custom HTML template applied to all pages
assetsArray[String]Glob patterns for static assets copied as-is to output
data_dirStringStructured data directory (default: data), exposing JSON/TOML to $data.*$
inject_headArray[String]Raw HTML snippets injected into <head>
inject_bodyArray[String]Raw HTML snippets injected before </body>
use_cssArray[String]Inline CSS code snippets injected into <style> tags
use_jsArray[String]Inline JavaScript code snippets injected into <script> tags
import_cssArray[String]External stylesheet URLs or paths referenced via <link>
import_jsArray[String]External script URLs or paths referenced via <script src>
preprocessorsArray[String]External commands modifying raw Markdown before parsing
transformersArray[String]External commands transforming the Markdown AST

  • Preprocessors: Run on raw text before parsing. E.g. preprocessors = ["python expand_macros.py"].

  • Transformers: Run on parsed AST blocks via JSON protocol. E.g. transformers = ["node highlight.js"].