예제 #1
0
 def docs(self):
     if self.cls.__doc__ is None:
         docs = ''
         logger.warning("No docstring for '%s'", self.name)
     else:
         docs = self.cls.__doc__
     return format_docs(docs)
예제 #2
0
파일: jsonrpc.py 프로젝트: ebu/benchmarkstt
        def _():
            """
            Returns available api methods

            :return object: With key being the method name, and value its description
            """
            return {
                name: format_docs(func.__doc__)
                for name, func in methods.items.items()
            }
예제 #3
0
def main(parser, args):  # pragma: nocover
    if args.list_methods:
        methods = get_methods()
        for name, func in methods.items.items():
            print('%s\n%s' % (name, '-' * len(name)))
            print('')
            print(format_docs(func.__doc__))
            print('')
    else:
        app = create_app(args.entrypoint, args.with_explorer)
        app.run(host=args.host, port=args.port, debug=args.debug)
예제 #4
0
# -- Auto build module docs --------------------------------------------------
sphinx_apidoc(['-e', '-f', '-t', tpl_dir, '-o', docs_modules_dir, src_dir])
os.remove(os.path.join(docs_modules_dir, 'modules.rst'))

# -- Auto build api docs -----------------------------------------------------

with open(os.path.join(docs_dir, 'api-methods.rst'), 'w') as f:
    f.write("Available JSON-RPC methods\n==========================\n\n\n")
    f.write(".. attention::\n\n")
    f.write("    Only supported for Python versions 3.6 and above\n\n\n")

    methods = get_methods()
    for name, func in methods.items.items():
        f.write('\n%s\n%s\n' % (name, '-' * len(name)))
        f.write('\n')
        f.write(format_docs(func.__doc__))
        f.write('\n\n')

# -- Set extensions ----------------------------------------------------------

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.doctest',
    'sphinx.ext.coverage',
    'sphinx.ext.viewcode',
    'sphinx.ext.githubpages',
    'sphinxarg.ext',
    'sphinxcontrib.mermaid',
]

# -- Setting readthedocs theme and config -----------------------------------