How to use the pdoc.Module function in pdoc

To help you get started, we’ve selected a few pdoc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scikit-optimize / scikit-optimize / build_tools / travis / make_doc.py View on Github external
module_name = path.basename(fp)
            if isdir:
                fp = path.join(fp, '__init__.py')
            else:
                module_name, _ = path.splitext(module_name)

            # Use a special module name to avoid import conflicts.
            # It is hidden from view via the `Module` class.
            with open(fp) as f:
                module = imp.load_source('__pdoc_file_module__', fp, f)
                if isdir:
                    module.__path__ = [path.realpath(args.module_name)]
                module.__pdoc_module_name = module_name
        else:
            module = pdoc.import_module(args.module_name)
    module = pdoc.Module(module, docfilter=docfilter,
                         allsubmodules=args.all_submodules)

    # Plain text?
    if not args.html and not args.all_submodules:
        output = module.text()
        try:
            print(output)
        except IOError as e:
            # This seems to happen for long documentation.
            # This is obviously a hack. What's the real cause? Dunno.
            if e.errno == 32:
                pass
            else:
                raise e
        sys.exit(0)
github ladybug-tools / honeybee / updatedoc.py View on Github external
except Exception:
            pass
        raise

    for submodule in m.submodules():
        # print submodule.name
        html_out(submodule, html_dir, html)


# root = os.path.dirname(honeybee.__file__)
# with open(os.path.join(root, '__init__.py'), 'wb') as init:
# init.write('__all__ = ["config"]')
# init.write('__all__ = [%s]' % ','.join(listdir(root)))

html_dir = r'C:\Users\Mostapha\Documents\code\ladybug-tools\honeybee\doc'
module = pdoc.Module(honeybee, docfilter=None, allsubmodules=True)
html_out(module, html_dir)
github MycroftAI / mycroft-core / doc / generate_sdk_docs.py View on Github external
def main():
    for m in documented_sdk_modules:
        html = pdoc.html(m, allsubmodules=True)
        with open(module_to_docpath(m), 'w') as f:
            f.write(html)
    import mycroft
    mycroft.__all__ = [m[8:] for m in documented_sdk_modules]
    root_module = pdoc.Module(mycroft)
    html = root_module.html(external_links=False, link_prefix='', source=True)
    with open(module_to_docpath("mycroft"), 'w') as f:
        f.write(html)

pdoc

API Documentation for Python Projects

MIT-0
Latest version published 28 days ago

Package Health Score

88 / 100
Full package analysis