erlalign_docs (erlalign v0.1.1)
View SourceEDoc to OTP-27 documentation attribute converter for Erlang.
Converts EDoc-style @doc comments and type documentation to OTP-27 compatible -doc attributes. Handles HTML markup conversion to Markdown, cross-references, and proper attribute formatting.
Options supported:
For format_code/2: - line_length: N - Width for line wrapping (default: 80, 0 = no wrapping) - keep_separators: boolean() - Keep separator lines (default: false)
For process_file/2: - line_length: N - Width for line wrapping (default: 80, 0 = no wrapping) - keep_separators: boolean() - Keep separator lines (default: false) - output: FilePath - Output file path (default: overwrites input file)
Summary
Functions
Convert an EDoc @doc block to an OTP-27 -doc attribute. --------------------------------------------------------------------
Convert EDoc markup to Markdown. --------------------------------------------------------------------
Format Erlang source code, converting @doc blocks to -doc attributes.
Format collected lines as a -doc attribute. --------------------------------------------------------------------
Format @see references as Markdown. --------------------------------------------------------------------
Check if the current OTP version supports documentation conversion. Returns true if OTP version >= 27, false otherwise. --------------------------------------------------------------------
Get the current OTP version. --------------------------------------------------------------------
Parse an EDoc @doc block from Erlang source lines. --------------------------------------------------------------------
Process an Erlang file, converting @doc blocks to -doc attributes.
Wrap lines to specified width. --------------------------------------------------------------------
Functions
Convert an EDoc @doc block to an OTP-27 -doc attribute. --------------------------------------------------------------------
Convert EDoc markup to Markdown. --------------------------------------------------------------------
Format Erlang source code, converting @doc blocks to -doc attributes.
Takes source code as a binary string and returns the modified code.
This function only performs the conversion if the OTP version is >= 27. For earlier versions, returns the original code unchanged.
Options: - {line_length, N} - Width for line wrapping (default: 80, 0 = no wrapping) - {keep_separators, boolean()} - Keep %%---- lines (default: false)
Format collected lines as a -doc attribute. --------------------------------------------------------------------
Format @see references as Markdown. --------------------------------------------------------------------
Check if the current OTP version supports documentation conversion. Returns true if OTP version >= 27, false otherwise. --------------------------------------------------------------------
Get the current OTP version. --------------------------------------------------------------------
Parse an EDoc @doc block from Erlang source lines. --------------------------------------------------------------------
Process an Erlang file, converting @doc blocks to -doc attributes.
Reads the file, applies documentation conversion, and writes the result. Returns 'ok' on success or {error, Reason} on failure.
This function only performs the conversion if the OTP version is >= 27. For earlier versions, returns ok without modifying the file.
Options: - {line_length, N} - Width for line wrapping (default: 80, 0 = no wrapping) - {keep_separators, boolean()} - Keep %%---- lines (default: false) - {output, FilePath} - Output file path (default: overwrites input file)
Wrap lines to specified width. --------------------------------------------------------------------