mix lazy_doc (LazyDoc v0.3.0)
Summary
Functions
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
This should work for most of the modules, it will not work if the module contains only one function because Elixir does not create a __block__ node in this case.
Parameters
Parameters
write to given file the given Elixir AST This function does not write it in the proper format and it will remove comments as well
write to given file the given Elixir AST it writes formmated the string if the Elixir AST is annotated properly. if the AST is taken from a string you should use this options
Functions
Parameters
docs - a string representing the documentation to be validated. Description Checks if the provided documentation format is correct.
Returns true if the documentation is formatted correctly, false otherwise.
@spec docs_per_module([module(), ...]) :: [ {module :: module(), module_doc :: doc_content, docs :: [doc_element]}, ... ] when annotation: :erl_anno.anno(), doc_content: %{optional(binary()) => binary()} | :none | :hidden, doc_element: {{kind :: atom(), function_name :: atom(), arity()}, annotation, signature, doc_content, metadata}, signature: [binary()], metadata: map()
Parameters
modules - a list of modules to fetch documentation for. Description Retrieves documentation for the given modules, filtering out functions with no documentation.
Returns a list of tuples containing the documentation for each module including functions.
Parameters
path_wildcard - a string pattern used to match file paths for reading. Description Reads files that match the given wildcard pattern, extracts their abstract syntax tree (AST), comments, and function definitions.
Returns a list of maps containing details about each file, including the content, AST, modules, functions, and comments extracted.
Parameters
ast - an abstract syntax tree (AST) structure representing the source code. Description Initiates the extraction of names from the given AST.
Returns a list of names extracted from the AST.
Parameters
list_nodes - a list containing nodes which include functions list_undocumented_functions - a list of functions identified as undocumented.
Description Filters a list of nodes to find those that correspond to undocumented functions.
Returns a list of nodes that are undocumented functions present in list_nodes.
Parameters
func_docs - a list of function documentation tuples, where each tuple contains the function name, line number, signature, and documentation string. Description Groups function documentation by their names in order to organize and access documentation for functions with different arities.
Returns a map where the keys are function names and the values are lists of their corresponding documentation strings.
This should work for most of the modules, it will not work if the module contains only one function because Elixir does not create a __block__ node in this case.
Parameters
_module - the module to which the nodes will be inserted. module_ast - the abstract syntax tree of the module. functions - a list of functions to be processed. final_prompt - a string prompt to be appended to each function's prompt. provider_mod - the module responsible for making requests to the provider. model_text - the text representation of the model used in the request. token - the authentication token for the provider. acc - the accumulator for building the updated abstract syntax tree.
Description Inserts nodes into a module based on provided functions and prompts.
Returns the updated abstract syntax tree after processing the functions.
Parameters
names - a list of tuples where each tuple contains a type and a value. The type indicates the kind of element (e.g., :function) and the value is related to that type. Description Joins code from function clauses based on their names, merging the code of functions with the same name.
Returns a list of elements where functions with the same name are combined into a single tuple with their code concatenated.
Parameters
entries - a list of entry structures containing functions and associated ASTs. Description A list of entries to process, transforming functions based on model responses.
final_prompt - a string prefix to be added to each function's prompt. Description The initial text that precedes the function's string representation in the prompt.
provider_mod - a module responsible for handling requests to the provider. Description The module which encapsulates the logic for interacting with the AI provider's API.
model - the model identifier used to request AI-generated documentation. Description Specifies which AI model to use for generating the required documentation.
token - an authorization token for the API requests. Description The security token needed to authenticate requests to the provider's API.
Returns None
Parameters
_command_line_args - command line arguments provided to the function. Description Runs the main application logic for the LazyDoc utility, processing source files to extract documentation.
Returns None
write to given file the given Elixir AST This function does not write it in the proper format and it will remove comments as well
write to given file the given Elixir AST it writes formmated the string if the Elixir AST is annotated properly. if the AST is taken from a string you should use this options:
literalencoder: &{:ok, {:_block, &2, [&1]}}, token_metadata: true, unescape: false