Skip to content

Commit

Permalink
🍺 Enable the action to customize the header:
Browse files Browse the repository at this point in the history
- HTML header file URL is added as a new argument to the action;
- FreeJadi header file is added to the repo;
- Action version in the README has been updated.
  • Loading branch information
langroodi committed Oct 12, 2022
1 parent 1d9cb9a commit 542946a
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ Following is the latest doxygenize version:

| Release version | Docker image | Tag aliases |
| --------------- | ------------ | ---------- |
| v1.6.3 | Alpine 3.15.4 | v1, v1.6 |
| v1.7.0 | Alpine 3.15.4 | v1, v1.7 |
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ inputs:
description: 'Toggle dark mode CSS'
required: false
default: false
customheader:
description: 'Custom Doxygen pages header HTML file URL'
required: false
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -32,4 +36,5 @@ runs:
- ${{ inputs.htmloutput }}
- ${{ inputs.ghpagesbranch }}
- ${{ inputs.ghpagesdir }}
- ${{ inputs.darkmode }}
- ${{ inputs.darkmode }}
- ${{ inputs.customheader }}
31 changes: 31 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ InstallDependencies () {
apk add doxygen git openssh graphviz ttf-freefont
}

ConfigureCustomHeader () {
DOXYGENCONF=$1
CUSTOMHEADER=$2
TEMPDESTINATION="/tmp/custom_header.html"
HTMLHEADER="HTML_HEADER"

# Exit with error
# if the 'HTML_HEADER' configuration entry already exists in the Doxygen configuration file
if (grep -q "$HTMLHEADER" "$DOXYGENCONF")
then
echo "HTML header configuration entry already exists in the Doxygen configuration file"
exit 1
fi

# Download the custom header file to the temp directory
wget -O "$TEMPDESTINATION" "$CUSTOMHEADER" || exit 1

# Append the 'HTML_HEADER' configuration entry to the Doxygen configuration file
CONFIGURATIONENTRY="\n$HTMLHEADER=$TEMPDESTINATION"
echo -e "$CONFIGURATIONENTRY" >> "$DOXYGENCONF"
}

ConfigureDarkTheme () {
HTMLOUTPUT=$1
RAWCONTENTURL="https://raw.githubusercontent.com/langroodi/doxygenize"
Expand Down Expand Up @@ -130,8 +152,17 @@ GHPAGESDIR=$4
# Fetch the fifth argument (Toggle dark mode)
DARKMODE=$5

# Fetch the sixth argument (Custom Doxygen pages header HTML file URL)
CUSTOMHEADER=$6

InstallDependencies

# Customize Doxygen HTML pages header
# if the custom header has been set
if [ "$CUSTOMHEADER" != "" ]; then
ConfigureCustomHeader "$DOXYGENCONF" "$CUSTOMHEADER"
fi

# Try to generate code documentation
# Exit with error if the document generation failed
doxygen "$DOXYGENCONF" || exit 1
Expand Down
64 changes: 64 additions & 0 deletions header/freejadi.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!-- HTML header for doxygen 1.9.1-->
<!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<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-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->

<!--BEGIN TITLEAREA-->
<div id="titlearea">
<!--BEGIN FREEJADI-->
<table style="margin-left: auto; margin-right: auto;" class="freejadi">
<tr>
<td><a href="https://en.wikipedia.org/wiki/Amir_Emad_Mirmirani#Arrest"><h2>#FREEJADI</h2></a></td>
</tr>
</table>
<hr>
<!--END FREEJADI-->
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">$projectname
<!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber">$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 style="padding-left: 0.5em;">
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<td>$searchbox</td>
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->

0 comments on commit 542946a

Please sign in to comment.