View Source PhoenixPandoc.Engine (phoenix_pandoc v1.1.1)

Implementation of the Phoenix.Template.Engine behaviour.

This module invokes pandoc via the PhoenixPandoc.Pandoc wrapper at runtime. The templates cannot be converted at compile time since they must be evaluated by EEx first (tags may generate markup), and the assigns are not available then. It relies on Phoenix.HTML.Engine to sanitize the HTML.

Link to this section Summary

Link to this section Functions

@spec compile(String.t(), String.t()) :: Macro.t()

Implementation of the Phoenix.Template.Engine.compile/2 callback

This is invoked by Phoenix.Template here. It is used to compile the template into a function. You should never need to call this directly.

Pandoc will be invoked at runtime if the input template contains any EEx tags.

parameters

Parameters

  • path - Path of the temlate being compiled
  • _name - Name of the template being compiled, stripped of its suffix.

The second callback parameter is ignored. It could be used to control the pandoc writer, but Phoenix requires HTML.