diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2022-05-06 00:25:41 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2022-05-06 00:25:41 -0400 |
| commit | bfeba3302e995fdba373603533fce54bf788adff (patch) | |
| tree | 2e4aadbb53e43a7022167ecdff4e241474279e6d /api-docs/source | |
| parent | 245ee620d94a21d5e0005bd634a10bb6163efb64 (diff) | |
many pydoc formatting cleanups, added deprecated decorator and replaced ad-hoc messages with consistent decorator
Diffstat (limited to 'api-docs/source')
| -rw-r--r-- | api-docs/source/conf.py | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/api-docs/source/conf.py b/api-docs/source/conf.py index 9406d144..4d9915c1 100644 --- a/api-docs/source/conf.py +++ b/api-docs/source/conf.py @@ -21,6 +21,7 @@ import os import sys import platform import inspect +import glob if (platform.system() == "Darwin"): bnpath=os.path.join(os.path.abspath('.'), "..", "..", "..", "build", "out", "binaryninja.app", "Contents", "Resources", "python") @@ -43,11 +44,11 @@ import binaryninja def modulelist(modulename): modules = inspect.getmembers(modulename, inspect.ismodule) # We block the module named "debugger", because it is the folder that contains all debugger Python files - moduleblacklist = ["abc", "atexit", "binaryninja", "builtins", "ctypes", - "core", "struct", "sys", "_binaryninjacore", "traceback", "code", "enum", - "json", "numbers", "threading", "re", "requests", "os", "startup", - "associateddatastore", "range", "pyNativeStr", "cstr", "fnsignature", - "get_class_members", "datetime", "inspect", "subprocess", "site", + moduleblacklist = ["abc", "atexit", "binaryninja", "builtins", "ctypes", + "core", "struct", "sys", "_binaryninjacore", "traceback", "code", "enum", + "json", "numbers", "threading", "re", "requests", "os", "startup", + "associateddatastore", "range", "pyNativeStr", "cstr", "fnsignature", + "get_class_members", "datetime", "inspect", "subprocess", "site", "string", "random", "uuid", "queue", "collections", "dbgcore", "debugger", "webbrowser"] return sorted(set(x for x in modules if x[0] not in moduleblacklist)) @@ -56,7 +57,7 @@ def classlist(module): classblacklist = ['builtins'] if module.__name__ != "binaryninja.enums": members = sorted(x for x in members if type(x[1]) != binaryninja.enum.EnumMeta and x[1].__module__ not in classblacklist) - members.extend(fnlist(module)) + members.extend(fnlist(module)) return (x for x in members if not x[0].startswith("_")) def fnlist(module): @@ -66,6 +67,14 @@ def setup(app): app.add_css_file('css/other.css') app.is_parallel_allowed('write') +def cleansource(): + rstfiles = glob.glob("*.rst") + for f in rstfiles: + try: + os.remove(f) + except OSError: + print(f"Unable to remove {f}") + def generaterst(): pythonrst = open("index.rst", "w") pythonrst.write('''Binary Ninja Python API Documentation @@ -122,6 +131,8 @@ Full Class List pythonrst.close() +cleansource() + generaterst() # -- General configuration ------------------------------------------------ @@ -146,7 +157,7 @@ simplify_optional_unions = True autodoc_typehints = 'both' autosummary_generate = False autodoc_member_order = 'groupwise' -autodoc_type_aliases = { +autodoc_type_aliases = { 'int': 'ExpressionIndex' } @@ -181,7 +192,8 @@ release = str(binaryninja.core_version()) language = 'en' -exclude_patterns = [] +exclude_patterns = ['binaryninja.*.*.rst'] +suppress_warnings = ['toc.excluded'] add_function_parentheses = False |
