Skip to content

Latest commit

 

History

History
74 lines (56 loc) · 2.44 KB

DOCS.md

File metadata and controls

74 lines (56 loc) · 2.44 KB

Here's an example of what GenDoc can produce - everything below the line was generated with the following command in the termial: Long Syntax: gendoc --name GenDoc --version 1.0.0 --funcSections --codeFence --files gen_doc/main.py --fileHeader
Short Syntax: gendoc --n GenDoc --v 1.0.0 --fs --cf --f gen_doc/main.py --fh


GenDoc 1.0.0


gen_doc.main.extractDocStrings [function]

Details
Uses the ast module to extract DocStrings
from a Python file.

Args:
    filepath (str): path to a Python file (*precondition: filepath is a valid .py file*)

    parent (str): the top-level directory to use. Defaults to None.

    classSections (bool): create collapsible sections for classes. Defaults to False.

    methodSections (bool): create collapsible sections for class methods. Defaults to False.

    funcSections (bool): create collapsible sections for functions. Defaults to False.

    fileHeaders (bool): add filename and relative path before it's classes and functions. Defaults to False.

    fence (bool): surround each DocString in a markdown code fence with Python formatting. Defaults to False.

Returns:
    str: A markdown-ready string containing the filename,
    and function name + DocString pairs in
    the following format:

    ## <filename>
    ---
    ### <function name>
    <function DocString>
    ...

    None: Used to signal the ommittance of the file from the docs,
    only returned when no functions were found
### gen_doc.main.`getPythonFiles` [function]
Details
Gets all .py files in the current directory & filters with the standard .gitignore

Args:
    parent (str): the top-level directory to use. Defaults to None.

Returns:
    list: a list of str objects representing a path to a .py file
### gen_doc.main.`GenDoc` [function]
Details
Converts parsed arguments into logic for targeting Python
files (validates them) and generating/writing to the target
output file.

Args:
    args (Namespace): arguments from ArgParser
### gen_doc.main.`main` [function]
Details
Creates argument parser and calls GenDoc