diff --git a/.gitea/workflows/doxygen-to-wiki.yml b/.gitea/workflows/doxygen-to-wiki.yml index 0ed5287..0b9be8b 100644 --- a/.gitea/workflows/doxygen-to-wiki.yml +++ b/.gitea/workflows/doxygen-to-wiki.yml @@ -30,17 +30,30 @@ jobs: with: fetch-depth: 0 - - name: Install Doxygen and tools + - name: Install Doxygen, Graphviz, and doxybook2 shell: bash run: | + set -euo pipefail sudo apt-get update - sudo apt-get install -y doxygen rsync + sudo apt-get install -y doxygen graphviz rsync curl ca-certificates unzip + ARCH="$(uname -m)" + case "${ARCH}" in + x86_64|amd64) DOXYBOOK2_ASSET="doxybook2-linux-amd64.zip" ;; + aarch64|arm64) DOXYBOOK2_ASSET="doxybook2-linux-arm64.zip" ;; + *) echo "Unsupported architecture: ${ARCH}" >&2; exit 1 ;; + esac + curl -fsSL -o /tmp/doxybook2.zip "https://github.com/matusnovak/doxybook2/releases/latest/download/${DOXYBOOK2_ASSET}" + sudo unzip -j /tmp/doxybook2.zip -d /usr/local/bin doxybook2 + sudo chmod +x /usr/local/bin/doxybook2 + doxybook2 --version - - name: Build Doxygen site + - name: Build Doxygen (HTML + XML) shell: bash run: | + set -euo pipefail + rm -rf docs/html docs/xml doxygen Doxyfile - test -d docs/html || { echo "Doxygen output not found at docs/html"; exit 2; } + test -d docs/xml || { echo "Doxygen XML output not found at docs/xml"; exit 2; } - name: Publish to Wiki env: @@ -85,20 +98,20 @@ jobs: # Configure token for pushes to this host git -C wiki config http."https://${SERVER_HOST}/".extraHeader "Authorization: token ${WIKI_TOKEN}" - # Sync generated HTML to wiki/doxygen - mkdir -p wiki/doxygen - rsync -a --delete --checksum docs/html/ wiki/doxygen/ + # Convert Doxygen XML to Markdown into wiki/Doxygen + rm -rf wiki/Doxygen wiki/doxygen + mkdir -p wiki/Doxygen + doxybook2 --input docs/xml --output wiki/Doxygen - # Seed landing page if missing - if [ ! -f "wiki/Doxygen.md" ]; then - printf "%s\n" \ - "# Doxygen Documentation" \ - "" \ - "The generated API reference is published in this wiki under the doxygen directory." \ - "" \ - "- Open the HTML entry point: [doxygen/index.html](doxygen/index.html)" \ - > wiki/Doxygen.md - fi + # Create/overwrite the landing page + cat > wiki/Doxygen.md << 'EOF' + # Doxygen Documentation + + The generated API reference is published as native Markdown pages under the Doxygen directory in this wiki. + + - Open the entry point (if present): [Doxygen/index.md](Doxygen/index.md) + - Or browse the Doxygen/ pages listed in the sidebar + EOF # Commit and push COMMIT_SHA="$(git rev-parse --short HEAD || echo)" diff --git a/Doxyfile b/Doxyfile index d94f9e0..ebe929e 100644 --- a/Doxyfile +++ b/Doxyfile @@ -4,7 +4,7 @@ PROJECT_BRIEF = "Advanced Python obfuscator (renaming, string encryptio OUTPUT_DIRECTORY = docs GENERATE_HTML = YES GENERATE_LATEX = NO -GENERATE_XML = NO +GENERATE_XML = YES EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_STATIC = YES @@ -32,6 +32,7 @@ GENERATE_TREEVIEW = YES HTML_DYNAMIC_SECTIONS = YES CALL_GRAPH = NO CALLER_GRAPH = NO +HAVE_DOT = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = YES SORT_BY_SCOPE_NAME = YES