MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / generaterst

Function generaterst

api-docs/source/conf.py:96–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94 print(f"Unable to remove {f}")
95
96def generaterst():
97 pythonrst = open("index.rst", "w")
98 pythonrst.write('''Binary Ninja Python API Reference
99=====================================
100
101Welcome to the Binary Ninja API documentation. The below methods are available
102from the root of the `binaryninja` package, but most of the API is organized
103into the modules shown in the left side-bar.
104
105These pages are intended as an API Reference. For a deeper explanation of how
106different parts of Binary Ninja work, explanations of concepts, or if you're
107new to Binary Ninja, you&#x27;ll want to check out our `User Guide <https://docs.binary.ninja/>`_.
108
109If you&#x27;re new to our API, we also have a `Developer Guide <https://docs.binary.ninja/dev/index.html>`_
110which covers many of the concepts developers should know. There&#x27;s also a
111`Cookbook <https://docs.binary.ninja/dev/cookbook.html>`_ which contains many
112examples to get you started using our API.
113
114You can also scroll to the end to view a class list of all available classes.
115
116The search bar on the side works both online and offline.
117
118.. automodule:: binaryninja
119 :members:
120 :undoc-members:
121 :show-inheritance:
122
123Full Class List
124***************
125
126.. toctree::
127 :maxdepth: 2
128
129''&#x27;)
130
131 # Generate docs for both binaryninja and binaryninja.debugger module
132 modules = modulelist(binaryninja)
133 modules.extend(modulelist(binaryninja.debugger, basename="debugger"))
134 if hasattr(binaryninja, "collaboration"):
135 modules.extend(modulelist(binaryninja.collaboration, basename="collaboration"))
136 modules = sorted(modules, key=lambda pair: pair[0])
137
138 for modulename, module in modules:
139 # Since we put debugger python files in a folder, binaryninja.{modulename} is no longer the
140 # correct name of the module
141 filename = f"{module.__name__}-module.rst"
142 spaces = " " * modulename.count(".")
143 # Dirty hack to skip polutting the main toc with nested modules
144 if modulename.count(".") == 0:
145 pythonrst.write(f" {spaces}{modulename} <{filename}>\n")
146 modulefile = open(filename, "w")
147 underline = "="*len(f"{modulename} module")
148 modulefile.write(f''&#x27;{modulename} module
149{underline}
150
151.. autosummary::
152 :toctree:
153

Callers 1

conf.pyFile · 0.85

Calls 5

modulelistFunction · 0.85
classlistFunction · 0.85
writeMethod · 0.45
countMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected