Skip to content

Commit

Permalink
Add Doxygen and GitHub Pages deployment
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eric15342335 committed Nov 14, 2024
1 parent 013f8c2 commit 2560770
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/Doxyfile
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions .github/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- HTML footer for doxygen 1.11.0-->
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby <a href="https://www.doxygen.org/index.html"><img class="footer" src="$relpath^doxygen.svg" width="104" height="31" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
$generatedby&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="$relpath^doxygen.svg" width="104" height="31" alt="doxygen"/></a> $doxygenversion
</small></address>
</div><!-- doc-content -->
<!--END !GENERATE_TREEVIEW-->
</body>
</html>
115 changes: 115 additions & 0 deletions .github/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!-- HTML header for doxygen 1.11.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="$langISO">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<!--BEGIN PROJECT_ICON-->
<link rel="icon" href="$relpath^$projecticon" type="image/x-icon" />
<!--END PROJECT_ICON-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN FULL_SIDEBAR-->
<script type="text/javascript">var page_layout=1;</script>
<!--END FULL_SIDEBAR-->
<!--END DISABLE_INDEX-->
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
<!--BEGIN COPY_CLIPBOARD-->
<script type="text/javascript" src="$relpath^clipboard.js"></script>
<!--END COPY_CLIPBOARD-->
$treeview
$search
$mathjax
$darkmode
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet

<!-- Google Analytics -->
<!-- Google tag (gtag.js) -->
<script async fetchpriority="low"
src="https://www.googletagmanager.com/gtag/js?id=G-V187TY0SPN"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-V187TY0SPN', {
'cookie_flags': 'SameSite=None; Secure',
'cookie_domain': 'eric15342335.github.io'
});
</script>
<!-- End Google Analytics -->

<!-- Microsoft Clarity -->
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "o9poktpwjv");
</script>
<!-- End Microsoft Clarity -->

<!-- GoatCounter -->
<script async fetchpriority="low"
data-goatcounter="https://eric310.goatcounter.com/count"
src="/src/thirdparty/count.js"></script>
<!-- End GoatCounter -->

<!-- Google AdSense -->
<script async fetchpriority="low" crossorigin="anonymous"
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1706655606350284"></script>
</head>
<body>
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN FULL_SIDEBAR-->
<div id="side-nav" class="ui-resizable side-nav-resizable"><!-- do not remove this div, it is closed by doxygen! -->
<!--END FULL_SIDEBAR-->
<!--END DISABLE_INDEX-->

<div id="top"><!-- do not remove this div, it is closed by doxygen! -->

<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"$logosize/></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td id="projectalign">
<div id="projectname">$projectname<!--BEGIN PROJECT_NUMBER--><span id="projectnumber">&#160;$projectnumber</span><!--END PROJECT_NUMBER-->
</div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td>
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<!--BEGIN !FULL_SIDEBAR-->
<td>$searchbox</td>
<!--END !FULL_SIDEBAR-->
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
<!--BEGIN SEARCHENGINE-->
<!--BEGIN FULL_SIDEBAR-->
<tr><td colspan="2">$searchbox</td></tr>
<!--END FULL_SIDEBAR-->
<!--END SEARCHENGINE-->
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->
43 changes: 43 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Doxygen
html/
latex/

0 comments on commit 2560770

Please sign in to comment.