View Source mix xtra (Extractly v0.5.4)

Mix task to Transform EEx templates in the context of the Extractly module.

This tool serves two purposes.

  1. A simple CLI to basicly EEx.eval_file/2

  2. Access to the Extractly module (available as binding xtra too)

  3. Access to the name of the rendered template with the template binding

The Extractly module gives easy access to Elixir metainformation of the application using the extractly package, notably, module and function documentation.

This is BTW the raison d'être of this package, simple creation of a README.md file with very simple access to the projects hex documentation.

Thusly hexdoc and Github will always be synchronized.

To see that in action just look at the README.md.eex file of this package and compare with what you are reading here.

Example Template:

  Some text
  <%= xtra.functiondoc("M.shiny_function/2") %>
  <%= xtra.moduledoc("String") %>

  <%= xtra.moduledoc("MyModule", include: :all) %>
  <%= xtra.toc "SomeFile.md" %>

  More text

A special case is the occurrence of <%= xtra.toc :self, ... %> which just inserts a placeholder which than is replaced by the TOC of the generated output in a second pass