Architecture
An overview of how Saga works.
Overview
Saga does its work in multiple stages.
- First, it finds all the files within the
inputfolder - Then, for every registered step, it passes those files to a matching
Reader. These readers turn text files (such as markdown or reStructuredText files) intoIteminstances. - Saga runs all the registered steps again, now executing the
Writers. These writers turn a rendering context (which holds theItemamong other things) into aStringusing a “renderer”, which it’ll then write to disk, to theoutputfolder. - Finally, all unhandled files (images, CSS, raw HTML, etc.) are copied as-is to the
outputfolder.
Saga does not come with any readers or renderers out of the box. The official recommendation is to use SagaParsleyMarkdownReader for reading markdown files using Parsley, and SagaSwimRenderer to render them using Swim, which offers a great HTML DSL using Swift’s function builders.
Please check the Installation instructions, or check out the Example project to get an idea of how Saga works with Parsley and Swim.