Skip to content

Commit

Permalink
4.0 documentation
Browse files Browse the repository at this point in the history
 - Refactored Type Documentation
 - Added Projects
 - Added Type Archives
 - Added New Sidebar Documentation
 - Added String Concepts
 - Added Light/Dark Mode
 - Added New Tab Documentation
 - Added BNIL Guide: HLIL docs
 - Added new cookbook examples
 - Added migration guide
 - Added script for building docsets
 - Added documentation for themes
 - Updated all images to Ninja Edit
 - API Docs : Documents BasicBlockEdge and BasicBlock
 - API Docs : Documents CoreVariable, Variable, and VariableNameAndType
 - API Docs : Corrects note on `BinaryView.update_analysis` and `BinaryView.update_analysis_and_wait` to represent that analysis is run by default for you now.
 - Many, many other changes
  • Loading branch information
psifertex committed Feb 23, 2024
1 parent 748c229 commit 448f40b
Show file tree
Hide file tree
Showing 219 changed files with 5,053 additions and 1,349 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''
---

**Version and Platform (required):**
- Binary Ninja Version: [e.g. 3.2.4000-dev] (if version is stable, please also test the latest development build via the "Update Channel" option)
- Binary Ninja Version: [e.g. 4.0.4000-dev] (if version is stable, please also test the latest development build via the "Update Channel" option)
- OS: [e.g. Ubuntu Linux]
- OS Version: [e.g. 22.04]
- CPU Architecture: [e.g. x64 or M1]
Expand Down
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ api-docs/source/uiapi
api-docs/cppdocs/api
api-docs/cppdocs/xml
api-docs/cppdocs/html
api-docs/cppdocs/docset
!api-docs/cppdocs/Makefile
!api-docs/Makefile

# CMake
Expand Down Expand Up @@ -86,7 +88,4 @@ rust/examples/dwarf/*/target/

# Debugger docs
docs/img/debugger
docs/guide/debugger.md
docs/guide/remote-debugging.md
docs/guide/dbgeng-ttd.md
docs/guide/windows-kd.md
docs/guide/debugger
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (DEBUGGER)
add_custom_command(TARGET binaryninjaapi PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Copying Debugger Docs"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../public/debugger/docs/guide
${CMAKE_CURRENT_SOURCE_DIR}/docs/guide
${CMAKE_CURRENT_SOURCE_DIR}/docs/guide/debugger
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../public/debugger/docs/img
${CMAKE_CURRENT_SOURCE_DIR}/docs/img
)
Expand Down
2,535 changes: 2,535 additions & 0 deletions api-docs/cppdocs/Doxyfile-Docset

Large diffs are not rendered by default.

File renamed without changes.
23 changes: 23 additions & 0 deletions api-docs/cppdocs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Makefile for C++ documentation

PYTHON ?= poetry run python

.PHONY: help
help:
@echo "Please use \`make <target>\` where <target> is one of"
@echo " html to make standalone HTML files"
@echo " docset to make a Dash docset"

.PHONY: clean
clean:
rm -rf html
rm -rf docset
rm -rf xml

.PHONY: html
html:
$(PYTHON) ./build_min_docs.py

.PHONY: docset
docset:
$(PYTHON) ./build_min_docs.py --docset
34 changes: 28 additions & 6 deletions api-docs/cppdocs/build_min_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

__DOXYGEN_REQUIRED_VERSION__ = "1.9.4"

import argparse
import os
import sys
import json
Expand Down Expand Up @@ -125,8 +126,8 @@ def minifier():
fp.close()


def build_doxygen():
if not os.path.exists('./USEBUILDMINDOCS'):
def build_doxygen(args):
if not os.path.exists('./Doxyfile-HTML'):
print('No Doxyfile found. Are you in the right directory?')
sys.exit(1)
_, vers, _ = system_with_output("doxygen -V")
Expand All @@ -135,6 +136,12 @@ def build_doxygen():
print(f'Please use Doxygen {__DOXYGEN_REQUIRED_VERSION__} to build documentation')
sys.exit(1)

if args.docset:
stat, _, _ = system_with_output("doxygen2docset --help")
if stat != 0:
print(f"Please install https://github.com/chinmaygarde/doxygen2docset")
sys.exit(1)

print(f'DOXYGEN VERSION: {vers.strip()}')

if os.path.exists('./html/'):
Expand All @@ -145,22 +152,37 @@ def build_doxygen():
# doing it twice works (on macOS) ¯\_(ツ)_/¯
shutil.rmtree("./html/")
print(f'Building doxygen docs...')
stat, out, err = system_with_output("doxygen USEBUILDMINDOCS")

if args.docset:
stat, out, err = system_with_output("doxygen Doxyfile-Docset")
else:
stat, out, err = system_with_output("doxygen Doxyfile-HTML")
print(f"Built Doxygen with status code {stat}")
print("Output dir is ./html/")
stat, out, err = system_with_output("cp _static/img/* html/")
print(f"Copied images with status code {stat}")
if args.docset:
stat, out, err = system_with_output("doxygen2docset --doxygen html --docset docset")
print(f"Created docset with status code {stat}")


def main():
build_doxygen()
parser = argparse.ArgumentParser(prog=sys.argv[0])
parser.add_argument("--docset", action="store_true", default=False, help="Generate Dash docset")
args = parser.parse_args()

build_doxygen(args)
print("Minifying Output")
minifier()
if os.path.exists("html/navtree.js"):
minifier()
for file in deletion_queue:
file = "./" + file
os.remove(file)
print(f'Was able to clear {len(deletion_queue)} "redundant" files')
print(f'Done. Output is in ./html/')
if args.docset:
print(f'Done. Output is in ./docset/')
else:
print(f'Done. Output is in ./html/')


if __name__ == "__main__":
Expand Down
9 changes: 9 additions & 0 deletions api-docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ def generaterst():
from the root of the `binaryninja` package, but most of the API is organized
into the modules shown in the left side-bar.
These pages are intended as an API Reference. For a deeper explanation of how
different parts of Binary Ninja work, explanations of concepts, or if you're
new to Binary Ninja, you'll want to check out our [User Guide](https://docs.binary.ninja/).
If you're new to our API, we also have a [Developer Guide](https://docs.binary.ninja/dev/index.html)
which covers many of the concepts developers should know. There's also a
[Cookbook](https://docs.binary.ninja/dev/cookbook.html) which contains many
examples to get you started using our API.
You can also scroll to the end to view a class list of all available classes.
The search bar on the side works both online and offline.
Expand Down
4 changes: 2 additions & 2 deletions docs/about/open-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Please note that we offer no support for running Binary Ninja with modified Qt l
[sourcecodepro]: https://github.com/adobe-fonts/source-code-pro
[NotoColorEmoji license]: https://github.com/googlefonts/noto-emoji/blob/main/fonts/LICENSE
[NotoColorEmoji]: https://github.com/googlefonts/noto-emoji
[sphinx license]: https://github.com/sphinx-doc/sphinx/blob/master/LICENSE
[sphinx license]: https://github.com/sphinx-doc/sphinx/blob/master/LICENSE.rst
[sphinx]: http://www.sphinx-doc.org/en/stable/index.html
[sqlite license]: https://www.sqlite.org/copyright.html
[sqlite]: https://www.sqlite.org/index.html
Expand Down Expand Up @@ -701,7 +701,7 @@ Please note that we offer no support for running Binary Ninja with modified Qt l
[webpki]: https://github.com/briansmith/webpki
[webpki license]: https://github.com/briansmith/webpki/blob/main/LICENSE
[webpki-roots]: https://github.com/rustls/webpki-roots
[webpki-roots license]: https://github.com/rustls/webpki-roots/blob/main/LICENSE
[webpki-roots license]: https://github.com/rustls/webpki-roots/blob/main/webpki-roots/LICENSE
[which]: https://github.com/harryfei/which-rs.git
[which license]: https://github.com/harryfei/which-rs/blob/master/LICENSE.txt
[x509-signature]: https://github.com/paritytech/x509-signature
Expand Down
Loading

0 comments on commit 448f40b

Please sign in to comment.