scriptorium/renderer

The renderer’s job is to render compiled content into HTML. By default this means Lustre elements that can be later stringified.

Types

Helper struct to pass all the used views to the rendering functions.

pub type Views {
  Views(
    base: BaseView,
    meta: MetaView,
    single_post_full: SinglePostView,
    page: PageView,
    list_page: ListPageView,
    feed: FeedView,
  )
}

Constructors

  • Views(
      base: BaseView,
      meta: MetaView,
      single_post_full: SinglePostView,
      page: PageView,
      list_page: ListPageView,
      feed: FeedView,
    )

    Arguments

    • single_post_full

      View for a single post rendered on its own.

Functions

pub fn render(
  db: Database,
  compiled: CompileDatabase,
  config: Configuration,
) -> RenderDatabase

Render the database and compiled content using the configuration.

pub fn render_pages(
  db: Database,
  compiled_pages: List(CompiledPage),
  views: Views,
) -> List(RenderedPage)
pub fn render_posts(
  db: Database,
  post_contents: Dict(BigInt, CompiledPost),
  views: Views,
) -> List(RenderedSinglePost)
Search Document