From b41366a43b0c38e08cdffb5f4bd0a067b10c6fca Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Tue, 20 Oct 2020 16:39:57 +0100 Subject: [PATCH 1/3] configure doxygen --- .gitignore | 1 + Doxyfile | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 8 ++-- 3 files changed, 117 insertions(+), 4 deletions(-) create mode 100644 Doxyfile diff --git a/.gitignore b/.gitignore index bd79c043b6..b7d17125ab 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ venv/ .DS_Store ctx.c expected/ +docs/ # Assets assets diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000000..a851835620 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,112 @@ +# https://www.doxygen.nl/manual/config.html + +PROJECT_NAME = "Paper Mario" +PROJECT_NUMBER = +PROJECT_BRIEF = "Decompilation of Paper Mario" +PROJECT_LOGO = + +OUTPUT_DIRECTORY = docs +CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = YES + +OPTIMIZE_OUTPUT_FOR_C = YES + +TYPEDEF_HIDES_STRUCT = YES + +NUM_PROC_THREADS = 0 + +EXTRACT_ALL = YES +EXTRACT_STATIC = YES +HIDE_UNDOC_CLASSES = NO +HIDE_IN_BODY_DOCS = YES +SHOW_GROUPED_MEMB_INC = YES + +FORCE_LOCAL_INCLUDES = YES +INLINE_INFO = YES + +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_GROUP_NAMES = NO + +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= NO + +DISABLE_INDEX = YES +GENERATE_TREEVIEW = YES + +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 1 + +SHOW_INCLUDE_FILES = NO +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = NO + +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_AS_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = + +INPUT = README.md src include +FILE_PATTERNS = *.c *.h +RECURSIVE = YES +EXCLUDE = include/nu include/PR include/ultra64.h +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = + +USE_MDFILE_AS_MAINPAGE = README.md + +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = NO +SOURCE_TOOLTIPS = NO +USE_HTAGS = NO +VERBATIM_HEADERS = NO + +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = + +GENERATE_HTML = YES +HTML_OUTPUT = doxygen +HTML_HEADER = +HTML_FOOTER = +HTML_EXTRA_STYLESHEET = +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = YES +HTML_DYNAMIC_MENUS = YES +HTML_DYNAMIC_SECTIONS = YES +HTML_INDEX_NUM_ENTRIES = 100 +HTML_FORMULA_FORMAT = svg + +USE_MATHJAX = YES +MATHJAX_FORMAT = SVG + +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO + +GENERATE_LATEX = NO + +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +PREDEFINED = NON_MATCHING __attribute__((x))= +EXPAND_AS_DEFINED = INCLUDE_ASM +SKIP_FUNCTION_MACROS = YES + +SEARCH_INCLUDES = YES +INCLUDE_PATH = include include/PR src +INCLUDE_FILE_PATTERNS = diff --git a/install.sh b/install.sh index cc7f568767..efbc4324cc 100755 --- a/install.sh +++ b/install.sh @@ -9,7 +9,7 @@ if command -v apt &> /dev/null; then if [[ $1 == "--extra" ]]; then echo "Installing extra" - sudo apt install -y clang-tidy astyle || exit 1 + sudo apt install -y clang-tidy astyle doxygen || exit 1 python3 -m pip install -U -r requirements_extra.txt || exit 1 fi @@ -50,7 +50,7 @@ if command -v pacman &> /dev/null; then if [[ $1 == "--extra" ]]; then echo "Installing extra" - sudo pacman -S --noconfirm --needed clang astyle || exit 1 + sudo pacman -S --noconfirm --needed clang astyle doxygen || exit 1 python3 -m pip install -U -r requirements_extra.txt || exit 1 fi @@ -85,7 +85,7 @@ if command -v zypper &> /dev/null; then if [[ $1 == "--extra" ]]; then echo "Installing extra" - sudo zypper -n install clang astyle || exit 1 + sudo zypper -n install clang astyle doxygen || exit 1 python3 -m pip install -U -r requirements_extra.txt || exit 1 fi @@ -141,7 +141,7 @@ if command -v apk &> /dev/null; then if [[ $1 == "--extra" ]]; then echo "Installing extra" - sudo apk add --no-cache clang-extra-tools astyle || exit 1 + sudo apk add --no-cache clang-extra-tools astyle doxygen || exit 1 python3 -m pip install -U -r requirements_extra.txt || exit 1 fi From 40e3ae561811174bf1104f092a2136a825fdff23 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Tue, 20 Oct 2020 18:41:52 +0100 Subject: [PATCH 2/3] theme doxygen --- .gitignore | 2 +- Doxyfile | 10 +-- docs/doxygen_custom.css | 150 +++++++++++++++++++++++++++++++++++++++ docs/doxygen_header.html | 22 ++++++ 4 files changed, 178 insertions(+), 6 deletions(-) create mode 100644 docs/doxygen_custom.css create mode 100644 docs/doxygen_header.html diff --git a/.gitignore b/.gitignore index b7d17125ab..3bec7105a3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ venv/ .DS_Store ctx.c expected/ -docs/ # Assets assets @@ -18,3 +17,4 @@ assets *.bin bin/ build/ +docs/doxygen/ diff --git a/Doxyfile b/Doxyfile index a851835620..18f877500c 100644 --- a/Doxyfile +++ b/Doxyfile @@ -67,9 +67,9 @@ SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES +REFERENCES_RELATION = NO REFERENCES_LINK_SOURCE = NO -SOURCE_TOOLTIPS = NO +SOURCE_TOOLTIPS = YES USE_HTAGS = NO VERBATIM_HEADERS = NO @@ -79,9 +79,9 @@ IGNORE_PREFIX = GENERATE_HTML = YES HTML_OUTPUT = doxygen -HTML_HEADER = +HTML_HEADER = docs/doxygen_header.html HTML_FOOTER = -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = docs/doxygen_custom.css HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 HTML_COLORSTYLE_SAT = 100 @@ -103,7 +103,7 @@ GENERATE_LATEX = NO ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES -PREDEFINED = NON_MATCHING __attribute__((x))= +PREDEFINED = DOXYGEN NON_MATCHING __attribute__((x))= EXPAND_AS_DEFINED = INCLUDE_ASM SKIP_FUNCTION_MACROS = YES diff --git a/docs/doxygen_custom.css b/docs/doxygen_custom.css new file mode 100644 index 0000000000..877606101a --- /dev/null +++ b/docs/doxygen_custom.css @@ -0,0 +1,150 @@ +/* typography */ + +body, table, div, p, dl { font: inherit } + +body, table, div, p, dl, p.reference, p.definition, .memberdecls .header { + color: #121212; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji; +} + +:root { font-size: 10px } /* rem multiplier */ +h1 { font-size: 3rem; } +h2 { font-size: 2.25rem; } +h3 { font-size: 1.5rem; } +h4 { font-size: 1.25rem; } +h5 { font-size: 1rem; } +h6 { font-size: .875rem; } +h1, h2, h3, h4, h5, h6 { margin-bottom: 3px } +h1 { border-bottom: 1px solid #eee } + +.contents a:any-link { color: #357edd } +.contents a.visited { color: #5e2ca5 } + +p.reference, p.definition { color: #959da5; font-weight: normal; font-size: 11px; line-height: 1.2 } +p.reference a, p.definition a { color: #959da5 !important } +p.reference a:hover, p.definition a:hover { color: #357edd } + +.memname, .fragment, .memberdecls, .fragment .line, code { + font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; +} + +#PageDoc, .content, p { + font-size: 16px; + line-height: 1.5; + color: #1b1f23; +} + +hr { + border-color: #eee; + margin: 2em; +} + +/* layout */ + +html { height: 100% } + +body { + display: flex; + flex-direction: row; + + width: 100%; + max-width: 1000px; + min-height: 100%; + margin: 0 auto; +} + +#side-nav { + position: relative; + width: 250px !important; +} + +.ui-resizable-handle, #nav-sync { display: none !important } + +#doc-content { + margin-left: 0 !important; + flex: 1; +} + +#nav-path { display: none } /* hide footer */ +#MathJax_Message { display: none } /* hide "MathJax loading..." message */ + +#MSearchBox { + position: fixed; + top: 1em; + right: 1em; +} + +.contents { + font-size: 16px; + padding-top: 1em; + padding-bottom: 2em; +} + +/* +table { + table-layout: fixed; + width: 100%; +} +.memItemLeft { width: 32ch } +*/ + +/* cleaning */ + +#details + .groupheader, +.definition, +.memtitle, +.contents > p:first-child > a:first-child /* "Go to the source code of this file." */ +{ display: none } + +table.memname * { + display: inline; +} + +/* candy */ + +div.fragment, .memproto { + padding: 16px; + border: 0; + border-radius: 6px; + background: #f6f8fa; +} + +div.fragment div.line { + font-size: 85%; + line-height: 1.45; +} + +code { + padding: .2em .4em; + margin: 0; + font-size: 85%; + background: #f6f8fa; +} + +.memitem { + display: block !important; + border-left: 1px solid #eee; + padding-left: 1em; + margin: 1em 0; + width: 100%; + box-sizing: border-box; +} + +.memproto { + padding: 8px; + margin-bottom: .5em; + box-shadow: none; + text-shadow: none; + display: inline-block; +} + +.memname { + margin-left: 0; +} + +.memdoc { + border: 0; + padding: 0; + box-shadow: none; + background: none; +} diff --git a/docs/doxygen_header.html b/docs/doxygen_header.html new file mode 100644 index 0000000000..5ace5202f1 --- /dev/null +++ b/docs/doxygen_header.html @@ -0,0 +1,22 @@ + + + + + + + + $title - $projectname Documentation + $title + + + + $treeview + $search + $mathjax + + $extrastylesheet + + + +
+ $searchbox From c648cb6b69c0c991ee3d2ec68aefa48ccf8e4a0b Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Tue, 20 Oct 2020 18:46:50 +0100 Subject: [PATCH 3/3] deploy docs to gh-pages --- .github/workflows/docs.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/docs.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000000..8510de7a0e --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,21 @@ +name: Doxygen +on: + push: + branches: + - master + +jobs: + deploy: + name: Build and deploy documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Build + uses: mattnotmitt/doxygen-action@v1 + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/doxygen