read_doc v0.1.0 ReadDoc.Options

Usage:

mix read_doc [options] files...

Each file is scanned for block of lines starting with <!-- begin @doc... and endifing with <!-- end @doc.... Then the content between two matching lines is replaced with the corresponding docstring.

The following options are implemented

--silent     no messages emitted to :stderr (defaults to false)
--keep-copy  a copy of the original input file is kept by appending `.bup<n>` where n runs from 1 to the
             next available number for which no copy exists yet (defaults to false)
--fix-errors defaults to true! (deactivate via --no-fix-errors), and closing `<!-- end @doc...` lines
             with no matching `<!-- begin @doc...` are removed from the input
--begin-trigger defaults to `"\A \s* <!-- \s+ begin \s @doc \s ([\w.?!]+) \s+ --> \s* \z"`.
                This values is interpreted as an extended regex indicating the begin of a docstring block, where
                the first capture defines the module/function of the docstring
--end-trigger defaults to `"\A \s* <!-- \s+ end \s @doc \s ([\w.?!]+) \s+ --> \s* \z"`.
                This values is interpreted as an extended regex indicating the end of a docstring block, where
                the first capture defines the module/function of the docstring

Link to this section Summary

Functions

Creates an Options struct with dependent fields

Link to this section Types

Link to this type list_or_unit(t)
list_or_unit(t) :: t | [t]
Link to this type maybe(t)
maybe(t) :: nil | t
Link to this type numbered_line()
numbered_line() :: {String.t(), number()}
Link to this type numbered_lines()
numbered_lines() :: [numbered_line()]
Link to this type pair(lhs, rhs)
pair(lhs, rhs) :: {lhs, rhs}
Link to this type rgx_run_result()
rgx_run_result() :: nil | [String.t()] | [pair(integer(), integer())]
Link to this type string?()
string?() :: maybe(String.t())
Link to this type t()
t() :: %ReadDoc.Options{begin_rgx: maybe(Regex.t()), begin_trigger: String.t(), end_rgx: maybe(Regex.t()), end_trigger: String.t(), fix_errors: true, keep_copy: boolean(), silent: boolean()}

Link to this section Functions

Link to this function croak(options, message)
croak(t(), String.t()) :: :ok
Link to this function finalize(options)
finalize(t()) :: t()

Creates an Options struct with dependent fields