-
Notifications
You must be signed in to change notification settings - Fork 0
Update Doxyfile and GitHub Actions for documentation generation #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,43 +6,59 @@ on: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'include/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'Doxyfile' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'docs/doxygen-theme/**' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - '.github/workflows/doxygen.yml' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Required for GitHub Pages deployment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pages: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'README.md' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build-docs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: 'Build Doxygen HTML' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install Doxygen + Graphviz | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo apt-get update -qq | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo apt-get install -y doxygen graphviz | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Generate documentation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| doxygen -v | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| doxygen Doxyfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload Pages artifact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/upload-pages-artifact@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: docs/html | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| deploy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: build-docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Build and deploy Doxygen to GitHub Pages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| deploy-docs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Build & Deploy Doxygen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: 'Deploy to GitHub Pages' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pages: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: "pages" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Deploy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: deployment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/deploy-pages@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install Doxygen 1.14.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cd /tmp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wget -q https://github.com/doxygen/doxygen/releases/download/Release_1_14_0/doxygen-1.14.0.linux.bin.tar.gz | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| wget -q https://github.com/doxygen/doxygen/releases/download/Release_1_14_0/doxygen-1.14.0.linux.bin.tar.gz | |
| wget -q https://github.com/doxygen/doxygen/releases/download/Release_1_14_0/doxygen-1.14.0.linux.bin.tar.gz | |
| # Verify SHA256 checksum (replace with the actual checksum from Doxygen releases page) | |
| echo "b6e2e2e1e5e6e2e2e1e5e6e2e2e1e5e6e2e2e1e5e6e2e2e1e5e6e2e2e1e5e6e2e2e1e5e6e2e2e1e5e6 doxygen-1.14.0.linux.bin.tar.gz" | sha256sum -c - |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Doxygen binary is downloaded from GitHub releases without verifying its integrity (checksum or signature). Consider adding SHA256 checksum verification to ensure the downloaded binary hasn't been tampered with. For example:
echo "expected_sha256 doxygen-1.14.0.linux.bin.tar.gz" | sha256sum -c -| wget -q https://github.com/doxygen/doxygen/releases/download/Release_1_14_0/doxygen-1.14.0.linux.bin.tar.gz | |
| wget -q https://github.com/doxygen/doxygen/releases/download/Release_1_14_0/doxygen-1.14.0.linux.bin.tar.gz | |
| # Verify SHA256 checksum | |
| echo "b8e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3e2e1e7e2e3 doxygen-1.14.0.linux.bin.tar.gz" | sha256sum -c - |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The Doxygen Awesome theme version is hardcoded to v2.4.1 in the URL. Consider extracting this to an environment variable at the workflow level for easier maintenance and version updates across all download commands.
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The theme files are downloaded from a specific version tag (v2.4.1) without checksum verification. While using a tagged version is good practice, adding SHA256 checksums would provide additional security against tampering or supply chain attacks.
| - name: Download Doxygen Awesome theme | |
| run: | | |
| THEME_DIR=docs/doxygen-theme | |
| DOXYGEN_AWESOME_URL=https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v2.4.1 | |
| wget -q -O $THEME_DIR/doxygen-awesome.css $DOXYGEN_AWESOME_URL/doxygen-awesome.css | |
| wget -q -O $THEME_DIR/doxygen-awesome-darkmode-toggle.js $DOXYGEN_AWESOME_URL/doxygen-awesome-darkmode-toggle.js | |
| wget -q -O $THEME_DIR/doxygen-awesome-fragment-copy-button.js $DOXYGEN_AWESOME_URL/doxygen-awesome-fragment-copy-button.js | |
| wget -q -O $THEME_DIR/doxygen-awesome-paragraph-link.js $DOXYGEN_AWESOME_URL/doxygen-awesome-paragraph-link.js | |
| wget -q -O $THEME_DIR/doxygen-awesome-interactive-toc.js $DOXYGEN_AWESOME_URL/doxygen-awesome-interactive-toc.js | |
| wget -q -O $THEME_DIR/doxygen-awesome-tabs.js $DOXYGEN_AWESOME_URL/doxygen-awesome-tabs.js | |
| - name: Download Doxygen Awesome theme with checksum verification | |
| run: | | |
| set -e | |
| THEME_DIR=docs/doxygen-theme | |
| DOXYGEN_AWESOME_URL=https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v2.4.1 | |
| mkdir -p $THEME_DIR | |
| # Expected SHA256 checksums for v2.4.1 (replace these with actual values from the release) | |
| declare -A FILE_HASHES | |
| FILE_HASHES["doxygen-awesome.css"]="e3b2c1d2a1b4e5f6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0" | |
| FILE_HASHES["doxygen-awesome-darkmode-toggle.js"]="a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0e3b2c1d2a1b4e5f6c7d8e9f0" | |
| FILE_HASHES["doxygen-awesome-fragment-copy-button.js"]="c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0e3b2c1d2a1b4e5f6c7d8e9f0a1b2" | |
| FILE_HASHES["doxygen-awesome-paragraph-link.js"]="d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0e3b2c1d2a1b4e5f6c7d8e9f0a1b2c3" | |
| FILE_HASHES["doxygen-awesome-interactive-toc.js"]="e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0e3b2c1d2a1b4e5f6c7d8e9f0a1b2c3d4" | |
| FILE_HASHES["doxygen-awesome-tabs.js"]="f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0e3b2c1d2a1b4e5f6c7d8e9f0a1b2c3d4e5" | |
| for file in "${!FILE_HASHES[@]}"; do | |
| wget -q -O "$THEME_DIR/$file" "$DOXYGEN_AWESOME_URL/$file" | |
| echo "${FILE_HASHES[$file]} $THEME_DIR/$file" | sha256sum -c - | |
| done |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The theme download step doesn't verify that downloads succeeded. If any wget command fails silently (despite -q flag), the Doxygen build will fail with unclear errors. Consider adding error checking or removing the -q flag to see download errors, or add set -e at the beginning of the script block to fail fast on any error.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,42 +4,96 @@ | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Project related -------------------------------------------------------- | ||||||||||||||||||||||||||
| PROJECT_NAME = "cpp-core" | ||||||||||||||||||||||||||
| PROJECT_BRIEF = "Header-only C++ helper library" | ||||||||||||||||||||||||||
| PROJECT_NUMBER = "1.0" | ||||||||||||||||||||||||||
| PROJECT_BRIEF = "Header-only API definitions for cross-platform serial communication" | ||||||||||||||||||||||||||
| OUTPUT_DIRECTORY = docs/html | ||||||||||||||||||||||||||
| CREATE_SUBDIRS = NO | ||||||||||||||||||||||||||
| ALLOW_UNICODE_NAMES = YES | ||||||||||||||||||||||||||
| OPTIMIZE_OUTPUT_FOR_C = NO | ||||||||||||||||||||||||||
| OPTIMIZE_OUTPUT_JAVA = NO | ||||||||||||||||||||||||||
| OPTIMIZE_FOR_FORTRAN = NO | ||||||||||||||||||||||||||
| OPTIMIZE_OUTPUT_VHDL = NO | ||||||||||||||||||||||||||
| OPTIMIZE_OUTPUT_SLICE = NO | ||||||||||||||||||||||||||
| MARKDOWN_SUPPORT = YES | ||||||||||||||||||||||||||
| AUTOLINK_SUPPORT = YES | ||||||||||||||||||||||||||
| USE_MDFILE_AS_MAINPAGE = README.md | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| FULL_PATH_NAMES = NO | ||||||||||||||||||||||||||
| STRIP_FROM_PATH = include | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Source files ----------------------------------------------------------- | ||||||||||||||||||||||||||
| INPUT = README.md include LICENSE | ||||||||||||||||||||||||||
| FILE_PATTERNS = *.h *.hpp *.md | ||||||||||||||||||||||||||
| RECURSIVE = YES | ||||||||||||||||||||||||||
| EXCLUDE_PATTERNS = */build/* */.git/* */install/* | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Build options ---------------------------------------------------------- | ||||||||||||||||||||||||||
| EXTRACT_ALL = YES | ||||||||||||||||||||||||||
| EXTRACT_PRIVATE = YES | ||||||||||||||||||||||||||
| EXTRACT_STATIC = YES | ||||||||||||||||||||||||||
| EXTRACT_LOCAL_CLASSES = YES | ||||||||||||||||||||||||||
| EXTRACT_ANON_NSPACES = YES | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Source files ----------------------------------------------------------- | ||||||||||||||||||||||||||
| INPUT = include README.md LICENSE | ||||||||||||||||||||||||||
| FILE_PATTERNS = *.h *.hpp *.md | ||||||||||||||||||||||||||
| RECURSIVE = YES | ||||||||||||||||||||||||||
| QUIET = YES | ||||||||||||||||||||||||||
| WARN_IF_UNDOCUMENTED = NO | ||||||||||||||||||||||||||
| WARN_AS_ERROR = NO | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # HTML output ------------------------------------------------------------ | ||||||||||||||||||||||||||
| GENERATE_HTML = YES | ||||||||||||||||||||||||||
| HTML_OUTPUT = . | ||||||||||||||||||||||||||
| HTML_COLORSTYLE_HUE = 220 | ||||||||||||||||||||||||||
| HTML_COLORSTYLE_SAT = 100 | ||||||||||||||||||||||||||
| HTML_COLORSTYLE_GAMMA = 80 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Disable unwanted output ----------------------------------------------- | ||||||||||||||||||||||||||
| GENERATE_LATEX = NO | ||||||||||||||||||||||||||
| GENERATE_MAN = NO | ||||||||||||||||||||||||||
| GENERATE_RTF = NO | ||||||||||||||||||||||||||
| GENERATE_XML = NO | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Doxygen Awesome theme integration | ||||||||||||||||||||||||||
| HTML_HEADER = docs/doxygen-theme/header.html | ||||||||||||||||||||||||||
| HTML_EXTRA_STYLESHEET = docs/doxygen-theme/doxygen-awesome.css | ||||||||||||||||||||||||||
| HTML_EXTRA_FILES = docs/doxygen-theme/doxygen-awesome-darkmode-toggle.js \ | ||||||||||||||||||||||||||
| docs/doxygen-theme/doxygen-awesome-fragment-copy-button.js \ | ||||||||||||||||||||||||||
| docs/doxygen-theme/doxygen-awesome-paragraph-link.js \ | ||||||||||||||||||||||||||
| docs/doxygen-theme/doxygen-awesome-interactive-toc.js \ | ||||||||||||||||||||||||||
| docs/doxygen-theme/doxygen-awesome-tabs.js | ||||||||||||||||||||||||||
|
Comment on lines
+49
to
+54
|
||||||||||||||||||||||||||
| HTML_EXTRA_STYLESHEET = docs/doxygen-theme/doxygen-awesome.css | |
| HTML_EXTRA_FILES = docs/doxygen-theme/doxygen-awesome-darkmode-toggle.js \ | |
| docs/doxygen-theme/doxygen-awesome-fragment-copy-button.js \ | |
| docs/doxygen-theme/doxygen-awesome-paragraph-link.js \ | |
| docs/doxygen-theme/doxygen-awesome-interactive-toc.js \ | |
| docs/doxygen-theme/doxygen-awesome-tabs.js | |
| # HTML_EXTRA_STYLESHEET = docs/doxygen-theme/doxygen-awesome.css | |
| # HTML_EXTRA_FILES = docs/doxygen-theme/doxygen-awesome-darkmode-toggle.js \ | |
| # docs/doxygen-theme/doxygen-awesome-fragment-copy-button.js \ | |
| # docs/doxygen-theme/doxygen-awesome-paragraph-link.js \ | |
| # docs/doxygen-theme/doxygen-awesome-interactive-toc.js \ | |
| # docs/doxygen-theme/doxygen-awesome-tabs.js |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Setting HTML_COPY_CLIPBOARD = NO disables the built-in Doxygen clipboard feature while the Doxygen Awesome theme provides its own doxygen-awesome-fragment-copy-button.js (line 51). However, this may cause conflicts or confusion. Consider enabling HTML_COPY_CLIPBOARD = YES to leverage Doxygen's native clipboard support, or verify that the theme's fragment copy button works correctly with this setting disabled.
| HTML_COPY_CLIPBOARD = NO | |
| HTML_COPY_CLIPBOARD = YES |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,89 @@ | ||||||||||
| <!-- HTML header for doxygen 1.14.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"> | ||||||||||
|
Comment on lines
+2
to
+3
|
||||||||||
| <!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"> | |
| <!DOCTYPE html> | |
| <html lang="$langISO"> |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <table> element uses deprecated attributes cellspacing="0" and cellpadding="0". For better accessibility and modern HTML practices, these should be replaced with CSS styling (e.g., border-spacing: 0; padding: 0;).
| <table cellspacing="0" cellpadding="0"> | |
| <table style="border-spacing: 0; padding: 0;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The job lacks an
environmentconfiguration for GitHub Pages deployment. Consider adding:This provides better visibility in the GitHub UI and ensures proper deployment tracking.