Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 51 additions & 35 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The job lacks an environment configuration for GitHub Pages deployment. Consider adding:

environment:
  name: github-pages
  url: ${{ steps.deployment.outputs.page_url }}

This provides better visibility in the GitHub UI and ensures proper deployment tracking.

Suggested change
cancel-in-progress: false
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downloading and installing binaries without checksum verification is a security risk. Consider adding SHA256 checksum verification after downloading the tarball:

echo "EXPECTED_SHA256  doxygen-1.14.0.linux.bin.tar.gz" | sha256sum -c -

Replace EXPECTED_SHA256 with the actual checksum from the Doxygen releases page.

Suggested change
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 uses AI. Check for mistakes.
Copy link

Copilot AI Dec 1, 2025

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 -
Suggested change
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 uses AI. Check for mistakes.
tar -xzf doxygen-1.14.0.linux.bin.tar.gz
sudo cp doxygen-1.14.0/bin/doxygen /usr/local/bin/
doxygen --version
sudo apt-get update
sudo apt-get install -y graphviz

- 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
Copy link

Copilot AI Dec 1, 2025

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 uses AI. Check for mistakes.
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
Comment on lines +39 to +48
Copy link

Copilot AI Dec 1, 2025

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.

Suggested change
- 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 uses AI. Check for mistakes.
Comment on lines +39 to +48
Copy link

Copilot AI Dec 1, 2025

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.

Copilot uses AI. Check for mistakes.

- name: Generate documentation
run: |
doxygen Doxyfile

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/html

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
90 changes: 72 additions & 18 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Doxyfile references theme files (lines 48-54) that are downloaded dynamically in the CI workflow but only header.html exists in the repository. This creates an inconsistency where local documentation generation will fail unless developers manually download the theme files. Consider either:

  1. Committing all theme files to the repository for consistency with header.html, or
  2. Adding a script or documentation to help developers set up the theme locally, or
  3. Making the theme files optional in the Doxyfile configuration.
Suggested change
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 uses AI. Check for mistakes.

HTML_COLORSTYLE = LIGHT
HTML_COPY_CLIPBOARD = NO
Copy link

Copilot AI Dec 1, 2025

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.

Suggested change
HTML_COPY_CLIPBOARD = NO
HTML_COPY_CLIPBOARD = YES

Copilot uses AI. Check for mistakes.
PAGE_OUTLINE_PANEL = NO
FULL_SIDEBAR = NO
GENERATE_TREEVIEW = YES
DISABLE_INDEX = NO
ALPHABETICAL_INDEX = YES
GENERATE_DEPRECATEDLIST = YES

# Source browsing
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO

# Diagrams --------------------------------------------------------------
HAVE_DOT = YES
DOT_IMAGE_FORMAT = svg
DOT_NUM_THREADS = 0
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
UML_LIMIT_NUM_FIELDS = 10
DOT_UML_DETAILS = NO
DOT_WRAP_THRESHOLD = 17
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = YES
CALLER_GRAPH = YES

# Misc ------------------------------------------------------------------
FULL_PATH_NAMES = NO
STRIP_FROM_PATH = include
GENERATE_TREEVIEW = YES
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DIR_GRAPH_MAX_DEPTH = 1
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = YES
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_MULTI_TARGETS = YES
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
89 changes: 89 additions & 0 deletions docs/doxygen-theme/header.html
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
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DOCTYPE declaration uses XHTML 1.0 Transitional, which is outdated. Modern HTML5 (<!DOCTYPE html>) would be more appropriate and provide better browser compatibility. Note that this may require adjustments to ensure compatibility with Doxygen 1.14.0's template system.

Suggested change
<!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 uses AI. Check for mistakes.
<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 FULL_SIDEBAR-->
<script type="text/javascript">var page_layout=1;</script>
<!--END FULL_SIDEBAR-->
<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
<!-- Doxygen Awesome CSS extensions -->
<script type="text/javascript" src="$relpath^doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript" src="$relpath^doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript" src="$relpath^doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript" src="$relpath^doxygen-awesome-interactive-toc.js"></script>
<script type="text/javascript" src="$relpath^doxygen-awesome-tabs.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
DoxygenAwesomeFragmentCopyButton.init()
DoxygenAwesomeParagraphLink.init()
DoxygenAwesomeInteractiveToc.init()
DoxygenAwesomeTabs.init()
</script>
</head>
<body>
<!--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-->

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

<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
Copy link

Copilot AI Dec 1, 2025

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;).

Suggested change
<table cellspacing="0" cellpadding="0">
<table style="border-spacing: 0; padding: 0;">

Copilot uses AI. Check for mistakes.
<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 -->