PhoenixPandoc (phoenix_pandoc v1.1.2)

View Source

A Phoenix template engine for pandoc that fully supports EEx templates.

It tries (not very hard) to map file extensions to pandoc readers, but any reader can be used by naming the template like name.html.reader. See pandoc --list-input-formats for a list of supported readers.

Optional Markdown Configuration

Pandoc supports multiple flavors of Markdown. This module defaults to the Github-flavored Markdown reader (gfm) for .md files. This can be overridden in your project's config.exs like so:

  config :phoenix_pandoc, markdown_flavor: "commonmark"

:markdown_flavor must be set to one of: ["gfm", "commonmark", "markdown", "markdown_phpextra", "markdown_strict"].

Summary

Functions

Try to detect the pandoc reader for a file extension.

Functions

extension_to_reader!(extension)

@spec extension_to_reader!(String.t()) :: String.t() | no_return()

Try to detect the pandoc reader for a file extension.

Supports the following extension mappings:

ExtensionReader
.eexhtml
.htmlhtml
.mdgfm
.mmdmarkdown_mmd
.texlatex

This function raises an ArgumentError if the extension is not explicitly supported, or a pandoc reader.