From 2421d9a6e6e86ff3f37056a68454b7437fb60860 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Mon, 2 Jan 2017 16:15:07 -0500 Subject: Manual merging with dev --- api-docs/source/conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'api-docs/source') diff --git a/api-docs/source/conf.py b/api-docs/source/conf.py index 42bcfb87..15e06045 100644 --- a/api-docs/source/conf.py +++ b/api-docs/source/conf.py @@ -121,7 +121,7 @@ exclude_patterns = [] # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # -# add_module_names = True +add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. @@ -211,7 +211,7 @@ html_static_path = ['_static'] # If false, no module index is generated. # -# html_domain_indices = True +html_domain_indices = True # If false, no index is generated. # @@ -219,11 +219,11 @@ html_static_path = ['_static'] # If true, the index is split into individual pages for each letter. # -# html_split_index = False +html_split_index = False # If true, links to the reST sources are added to the pages. # -# html_show_sourcelink = True +html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # -- cgit v1.3.1 From ffdcc904ea16467c51e3d36773be132b7aa4cb3f Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Tue, 10 Jan 2017 13:20:23 -0500 Subject: update documentation to be dynamically generated based on module and class hierarchy --- api-docs/source/conf.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) (limited to 'api-docs/source') diff --git a/api-docs/source/conf.py b/api-docs/source/conf.py index 15e06045..379d6d7e 100644 --- a/api-docs/source/conf.py +++ b/api-docs/source/conf.py @@ -19,15 +19,68 @@ import os import sys import platform +import inspect if (platform.system() == "Darwin"): - bnpath=os.path.join(os.path.abspath('.'), "..", "..", "..", "ui", "binaryninja.app", "Contents", "Resources", "python") + bnpath=os.path.join(os.path.abspath('.'), "..", "..", "..", "ui", "binaryninja.app", "Contents", "Resources", "python") else: - bnpath=os.path.join(os.path.abspath('.'), "..", "..", "..", "ui", "python") + bnpath=os.path.join(os.path.abspath('.'), "..", "..", "..", "ui", "python") sys.path.insert(0, bnpath) import binaryninja +def modulelist(modulename): + modules = inspect.getmembers(modulename, inspect.ismodule) + return filter(lambda x: x[0] not in ("abc", "ctypes", "core", "struct", "sys", "_binaryninjacore", "traceback", "code", "enum", "json", "threading"), modules) + + +def classlist(module): + members = inspect.getmembers(module, inspect.isclass) + if module.__name__ != "binaryninja.enums": + members = filter(lambda x: type(x[1]) != binaryninja.enum.EnumMeta, members) + members.extend(inspect.getmembers(module, inspect.isfunction)) + return map(lambda x: x[0], filter(lambda x: not x[0].startswith("_"), members)) + + +def generaterst(): + pythonrst = open("python.rst", "w") + pythonrst.write('''Binary Ninja Python API Documentation +===================================== + +.. toctree:: + :maxdepth: 2 + +''') + + for modulename, module in modulelist(binaryninja): + filename = 'binaryninja.{module}.rst'.format(module=modulename) + pythonrst.write(' {module} <{filename}>\n'.format(module=modulename, filename=filename)) + modulefile = open(filename, "w") + modulefile.write('''{module} module +===================== + +.. autosummary:: + :toctree: + +'''.format(module=modulename)) + + for classname in classlist(module): + modulefile.write(" binaryninja.{module}.{classname}\n".format(module=modulename, classname=classname)) + + modulefile.write('''\n.. toctree:: + :maxdepth: 2\n''') + modulefile.close() + + pythonrst.write('''.. automodule:: binaryninja + :members: + :undoc-members: + :show-inheritance: +''') + pythonrst.close() + + +generaterst() + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -50,7 +103,7 @@ extensions = [ ] autosummary_generate = True -autodoc_member_order = 'groupwise' +#autodoc_member_order = 'groupwise' breathe_projects = { "BinaryNinja": "../../xml/" } breathe_projects_source = { -- cgit v1.3.1 From c679a8a36fba81fccedb739036215f6657453a89 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Tue, 10 Jan 2017 14:31:55 -0500 Subject: remove autogenerated python.rst file --- api-docs/source/python.rst | 73 ---------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 api-docs/source/python.rst (limited to 'api-docs/source') diff --git a/api-docs/source/python.rst b/api-docs/source/python.rst deleted file mode 100644 index 5e299535..00000000 --- a/api-docs/source/python.rst +++ /dev/null @@ -1,73 +0,0 @@ -Binary Ninja Python API Documentation -===================================== - -.. currentmodule:: binaryninja -.. autosummary:: - :toctree: - - AnalysisCompletionEvent - AnalysisProgress - Architecture - BasicBlock - BasicBlockEdge - BinaryDataNotification - BinaryDataNotificationCallbacks - BinaryReader - BinaryView - BinaryViewType - BinaryWriter - CallingConvention - CoreFileAccessor - DataBuffer - DataVariable - DisassemblySettings - DisassemblyTextLine - Enumeration - EnumerationMember - FileAccessor - Function - FunctionGraph - FunctionGraphBlock - FunctionGraphEdge - FunctionRecognizer - IndirectBranchInfo - InstructionBranch - InstructionInfo - InstructionTextToken - LinearDisassemblyLine - LinearDisassemblyPosition - LookupTableEntry - LowLevelILBasicBlock - LowLevelILExpr - LowLevelILFunction - LowLevelILInstruction - LowLevelILLabel - NavigationHandler - Platform - PluginCommand - PluginCommandContext - ReferenceSource - RegisterInfo - RegisterValue - StackVariable - StackVariableReference - StringReference - Structure - StructureMember - Symbol - Transform - TransformParameter - Type - TypeParserResult - UndoAction - UpdateChannel - UpdateProgressCallback - UpdateVersion - -.. toctree:: - :maxdepth: 2 - -.. automodule:: binaryninja - :members: - :undoc-members: - :show-inheritance: -- cgit v1.3.1 From 4cbb658c6065d56dcc08a38d7f69f28c420c5e80 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Tue, 17 Jan 2017 15:37:06 -0500 Subject: fix missing documentation --- api-docs/source/conf.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'api-docs/source') diff --git a/api-docs/source/conf.py b/api-docs/source/conf.py index 379d6d7e..c7fa4a89 100644 --- a/api-docs/source/conf.py +++ b/api-docs/source/conf.py @@ -31,7 +31,7 @@ import binaryninja def modulelist(modulename): modules = inspect.getmembers(modulename, inspect.ismodule) - return filter(lambda x: x[0] not in ("abc", "ctypes", "core", "struct", "sys", "_binaryninjacore", "traceback", "code", "enum", "json", "threading"), modules) + return filter(lambda x: x[0] not in ("abc", "ctypes", "core", "struct", "sys", "_binaryninjacore", "traceback", "code", "enum", "json", "threading", "startup", "associateddatastore"), modules) def classlist(module): @@ -53,7 +53,7 @@ def generaterst(): ''') for modulename, module in modulelist(binaryninja): - filename = 'binaryninja.{module}.rst'.format(module=modulename) + filename = 'binaryninja.{module}-module.rst'.format(module=modulename) pythonrst.write(' {module} <{filename}>\n'.format(module=modulename, filename=filename)) modulefile = open(filename, "w") modulefile.write('''{module} module @@ -69,6 +69,11 @@ def generaterst(): modulefile.write('''\n.. toctree:: :maxdepth: 2\n''') + + modulefile.write('''\n\n.. automodule:: binaryninja.{module} + :members: + :undoc-members: + :show-inheritance:'''.format(module=modulename)) modulefile.close() pythonrst.write('''.. automodule:: binaryninja -- cgit v1.3.1 From 148924f082ba45f041431d004f630de56b59c144 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Fri, 20 Jan 2017 18:53:32 -0500 Subject: make python docs default for API help --- api-docs/source/conf.py | 4 ++-- api-docs/source/old-index.rst | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 api-docs/source/old-index.rst (limited to 'api-docs/source') diff --git a/api-docs/source/conf.py b/api-docs/source/conf.py index c7fa4a89..c87cb114 100644 --- a/api-docs/source/conf.py +++ b/api-docs/source/conf.py @@ -43,7 +43,7 @@ def classlist(module): def generaterst(): - pythonrst = open("python.rst", "w") + pythonrst = open("index.rst", "w") pythonrst.write('''Binary Ninja Python API Documentation ===================================== @@ -130,7 +130,7 @@ source_suffix = '.rst' # source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'python' +master_doc = 'index' # General information about the project. project = u'Binary Ninja API' diff --git a/api-docs/source/old-index.rst b/api-docs/source/old-index.rst new file mode 100644 index 00000000..355d6901 --- /dev/null +++ b/api-docs/source/old-index.rst @@ -0,0 +1,25 @@ +.. Binary Ninja API documentation master file, created by + sphinx-quickstart on Tue Jun 28 23:02:45 2016. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. include global.rst + +Binary Ninja API Documentation +============================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + Python API +.. C++ API +.. C API + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` -- cgit v1.3.1 From 56cedb70bf10e93445174f2ac7d00233155e9c88 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Fri, 20 Jan 2017 18:58:43 -0500 Subject: ignore autogenerated index --- .gitignore | 1 + api-docs/source/index.rst | 25 ------------------------- 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 api-docs/source/index.rst (limited to 'api-docs/source') diff --git a/.gitignore b/.gitignore index b2e5b79f..4c87edbd 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ api-docs/build/* api-docs/source/binaryninja.* *.pyc api-docs/source/python.rst +api-docs/source/index.rst diff --git a/api-docs/source/index.rst b/api-docs/source/index.rst deleted file mode 100644 index 355d6901..00000000 --- a/api-docs/source/index.rst +++ /dev/null @@ -1,25 +0,0 @@ -.. Binary Ninja API documentation master file, created by - sphinx-quickstart on Tue Jun 28 23:02:45 2016. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -.. include global.rst - -Binary Ninja API Documentation -============================== - -Contents: - -.. toctree:: - :maxdepth: 2 - - Python API -.. C++ API -.. C API - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` -- cgit v1.3.1