extractly v0.1.3 Extractly
Provide easy access to information inside the templates rendered by mix xtra
Link to this section Summary
Functions
Emits a comment including a message not to edit the created file, as it will be recreated from this template
Returns docstring of a function (or nil) Ex
Returns docstring of a macro (or nil)
Returns docstring of a module (or nil) Ex
Link to this section Functions
do_not_edit_warning(opts \\ [])
Emits a comment including a message not to edit the created file, as it will be recreated from this template.
It is a convenience to include this into your templates as follows
<%= xtra.do_not_edit_warning %>
or I18n'ed
<%= xtra.do_not_edit_warning, lang: :fr %>
If you are not generating html or markdown the comment can be parametrized
<%= xtra.do_not_edit_warning, comment_start: "-- ", comment_end: "" %>
If you want to include the name of the source template use template: template
option, so
a call may be as complex as:
<%= xtra.do_not_edit_warning, comment_start: "-- ", comment_end: "", template: template, lang: :it %>
functiondoc(name)
Returns docstring of a function (or nil) Ex:
iex(1)> Extractly.functiondoc("Extractly.moduledoc/1")
[ " Returns docstring of a module (or nil)",
" Ex:",
"",
" Extractly.moduledoc(\"Extractly\")",
""
] |> Enum.join("\n")
macrodoc(name)
Returns docstring of a macro (or nil)
Same naming convention for macros as for functions.
moduledoc(name)
Returns docstring of a module (or nil) Ex:
Extractly.moduledoc("Extractly")