From 2560770a1443c6b5d7ab542c4eb4ad355a10e080 Mon Sep 17 00:00:00 2001 From: "Cheng Ho Ming, Eric" Date: Thu, 14 Nov 2024 18:44:58 +0800 Subject: [PATCH] Add Doxygen and GitHub Pages deployment Set up automated documentation generation with Doxygen and deploy it to GitHub Pages using GitHub Actions. This improves accessibility to project documentation and ensures it stays current with code changes. --- .github/Doxyfile | 32 ++++++++++ .github/footer.html | 18 ++++++ .github/header.html | 115 +++++++++++++++++++++++++++++++++++ .github/workflows/static.yml | 43 +++++++++++++ .gitignore | 3 + 5 files changed, 211 insertions(+) create mode 100644 .github/Doxyfile create mode 100644 .github/footer.html create mode 100644 .github/header.html create mode 100644 .github/workflows/static.yml create mode 100644 .gitignore diff --git a/.github/Doxyfile b/.github/Doxyfile new file mode 100644 index 0000000..65a63b2 --- /dev/null +++ b/.github/Doxyfile @@ -0,0 +1,32 @@ +PROJECT_NAME = "Miscellaneous scripts" +INPUT = . hku-examinations cythonize-troll-tkinter lifts minesweeper scripts tex ungrouped yt-dlp upx +USE_MDFILE_AS_MAINPAGE = README.md +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +SOURCE_BROWSER = YES +VERBATIM_HEADERS = YES +INLINE_SOURCES = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 200 +COMPACT_LATEX = YES +CALL_GRAPH = YES +CALLER_GRAPH = YES +INTERACTIVE_SVG = YES +HTML_COLORSTYLE = TOGGLE +HAVE_DOT = YES +JAVADOC_AUTOBRIEF = YES +TIMESTAMP = YES +STRIP_CODE_COMMENTS = NO +SORT_BRIEF_DOCS = YES +SORT_MEMBER_DOCS = YES +SORT_MEMBERS_CTORS_1ST = YES +HTML_FORMULA_FORMAT = svg +LATEX_BATCHMODE = YES +SITEMAP_URL = https://eric15342335.github.io/misc/ +PROJECT_BRIEF = This repository contains miscellaneous scripts that does not fit in one repository, yet I will use them sometimes for my personal use. Note that some of the scripts might contain hardcoded paths and opinionated presets, and you are advised to inspect them before actually using. +HIDE_UNDOC_RELATIONS = NO +SHOW_GROUPED_MEMB_INC = YES +HTML_HEADER = .github/header.html +HTML_FOOTER = .github/footer.html diff --git a/.github/footer.html b/.github/footer.html new file mode 100644 index 0000000..777a8f0 --- /dev/null +++ b/.github/footer.html @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/.github/header.html b/.github/header.html new file mode 100644 index 0000000..ff22daf --- /dev/null +++ b/.github/header.html @@ -0,0 +1,115 @@ + + + + + + + + +$projectname: $title +$title + + + + + + + + + + + + + + +$treeview +$search +$mathjax +$darkmode + +$extrastylesheet + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
$projectname $projectnumber +
+
$projectbrief
+
+
$projectbrief
+
$searchbox
$searchbox
+
+ + diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..a3486f9 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,43 @@ +name: Deploy static content to Pages + +on: [push, workflow_dispatch] + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: [windows-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Run doxygen + run: | + choco install doxygen.portable graphviz --yes -r --no-progress + doxygen .github/Doxyfile + - name: Minify HTML, CSS, and JS + shell: bash + run: | + npm install -g html-minifier terser clean-css-cli + find html -name '*.html' -exec html-minifier --collapse-whitespace --remove-comments --minify-css true --minify-js true -o {} {} \; + find html -name '*.css' -exec cleancss -o {} {} \; + find html -name '*.js' -exec terser --compress --mangle -o {} -- {} \; + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: 'html/' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..38d082a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Doxygen +html/ +latex/