Extractly.Xtra (Extractly v0.5.0) View Source
This wraps Extractly's
API by putting all messages to be logged to the
Extractly.Messages
module.
Its primarty use case is for Mix.Tasks.Xtra
which will pass this module
as a param into the EEx
template.
The general idea is
Extractly.Messages.start_agent
process_input_template # which will collect messages by means of this module's API
Extractly.Messages.get_all |> emit_messages(options)
The wrapping works as follows
def some_function(some_params) do
case Extractly.some_function(some_params) do
{:ok, result} -> result
{:error, message} -> add_message_to_messages_and_return_html_comment_describing_the_error()
end
end
Link to this section Summary
Functions
Just a delegator to Extractly.do_not_edit_warning
As there can be no error condition no wrapping is needed
Wraps call to Extractly.functiondoc
as described above
Wraps call to Extractly.moduledoc
as described above
Link to this section Functions
Just a delegator to Extractly.do_not_edit_warning
As there can be no error condition no wrapping is needed
iex(0)> do_not_edit_warning() "<!--\nDO NOT EDIT THIS FILE\nIt has been generated from a template by Extractly (https://github.com/RobertDober/extractly.git)\nand any changes you make in this file will most likely be lost\n-->"
Wraps call to Extractly.functiondoc
as described above
iex(1)> functiondoc(["Support.Module2.function/0", "Support.Module1.hello/0"])
"A function\nA nice one\n\nFunctiondoc of Module1.hello\n"
Wraps call to Extractly.moduledoc
as described above
iex(2)> moduledoc("Support.Module2")
"<!-- module Support.Module2 does not have a moduledoc -->"