Skip to content

Pipeline: Post rendering

Giorgio Garofalo edited this page Feb 26, 2025 · 2 revisions

← Back to Pipeline

Post-rendering

Main packages: core.rendering, core.pipeline.output, resources/core.render

Obtained the translation of the AST to the target format from the Renderer, you might notice it is not enough to display to the user. Considering the HTML format, that is just the content that would go inside <body>, but everything else is missing: metadata, styling, and possibly a runtime.

Here comes the post-renderer, which takes an HTML template (made for a custom engine) and injects in it all the needed data, such as:

  • The content itself, put into <body>;
  • The document target (plain/slides/paged). For each target, different scripts and stylesheets are required;
  • User-defined properties, such as title and page format;
  • The need to load certain libraries, such as MathJax for rendering LaTeX formulas. This is only done if at least one formula is used.

On top of that, the post-renderer is also responsible for returning the output resources of the compilation. These resources include:

  • The generated HTML;
  • The group of stylesheets (global stylesheet, layout theme and color theme);
  • The group of required runtime scripts.

These resources are then added to those provided by the media storage and ultimately returned by the pipeline. It is then up to the invoker to handle those resources, which in case of CLI are saved to file.

Clone this wiki locally