Exemple #1
0
def generate_func_autodoc(app, func, add_title=True):
    ad = AutoDirective(
        name="autofunc",
        arguments=[FULL_NAMES[func]],
        options={"noindex": True},
        content=StringList([], items=[]),
        lineno=0,
        content_offset=1,
        block_text="",
        state=None,
        state_machine=None,
    )

    ad.env = BuildEnvironment(app)
    ad.genopt = Options(noindex=True)
    ad.filename_set = set()
    ad.result = ViewList()

    documenter = FunctionDocumenter(ad, ad.arguments[0])
    documenter.generate(all_members=True)

    title = 'Parameter Grids'
    with open(OUTPUT_FILES[func], "a") as fid:
        if add_title:
            fid.write(title + '\n')
            fid.write(''.join(['='] * len(title)) + '\n')
        for line in ad.result:
            fid.write(line + "\n")
Exemple #2
0
def generate_class_autodoc(app, cls):
    ad = AutoDirective(
        name="autoclass",
        arguments=[FULL_NAMES[cls]],
        options={"noindex": True},
        content=StringList([], items=[]),
        lineno=0,
        content_offset=1,
        block_text="",
        state=None,
        state_machine=None,
    )

    ad.env = BuildEnvironment(app)
    ad.genopt = Options(noindex=True)
    ad.filename_set = set()
    ad.result = ViewList()

    documenter = ClassDocumenter(ad, ad.arguments[0])
    documenter.generate(all_members=True)

    with open(OUTPUT_FILES[cls], "w") as fid:
        fid.write(cls + '\n')
        fid.write(''.join(['='] * len(cls)) + '\n')
        for line in ad.result:
            fid.write(line + "\n")
Exemple #3
0
def generate_func_autodoc(app, func):
    ad = AutoDirective(name='autofunc',
                       arguments=[FULL_NAMES[func]],
                       options={'noindex': True},
                       content=StringList([], items=[]),
                       lineno=0,
                       content_offset=1,
                       block_text='',
                       state=None,
                       state_machine=None)

    ad.env = BuildEnvironment(app)
    ad.genopt = Options(noindex=True)
    ad.filename_set = set()
    ad.result = ViewList()

    documenter = FunctionDocumenter(ad, ad.arguments[0])
    documenter.generate(all_members=True)

    with open(OUTPUT_FILES[func], 'a') as fid:
        for line in ad.result:
            fid.write(line + '\n')