Skip to content
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

Doxygen style #26

Merged
merged 13 commits into from
Oct 18, 2023
Merged
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
[submodule "libmetal"]
path = libmetal
url = https://github.com/OpenAMP/libmetal.git
[submodule "awesome"]
path = _doxygen/awesome
url = https://github.com/jothepro/doxygen-awesome-css.git
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
READTHEDOCS_VERSION_NAME ?= "desk check"
SOURCEDIR = .
BUILDDIR = _build

Expand All @@ -29,11 +30,13 @@ help:
doxygen: doxygen_libmetal doxygen_openamp

doxygen_libmetal:
cmake -B${BUILDDIR}/libmetal -DWITH_DOC=true libmetal
cmake -B${BUILDDIR}/libmetal -DVERSION_NAME=${READTHEDOCS_VERSION_NAME} \
-DWITH_DOC=true libmetal
make -C ${BUILDDIR}/libmetal doc

doxygen_openamp:
cmake -B${BUILDDIR}/openamp -DWITH_LIBMETAL_FIND=false -DWITH_DOC=true open-amp
cmake -B${BUILDDIR}/openamp -DVERSION_NAME=${READTHEDOCS_VERSION_NAME} \
-DWITH_LIBMETAL_FIND=false -DWITH_DOC=true open-amp
make -C ${BUILDDIR}/openamp doc

# using hard coded name here to avoid bad things if BUILDDIR is ever empty or /
Expand Down
1 change: 1 addition & 0 deletions _doxygen/awesome
Submodule awesome added at df83fb
42 changes: 42 additions & 0 deletions _doxygen/openamp/Doxyfile-openamp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Doxygen level overrides when building as part of OpenAMP-docs

# Test cmake rebuild

GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 400

# Maybe go in base, or also in base?
ALWAYS_DETAILED_SEC = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = YES

HTML_DYNAMIC_MENUS = YES
HTML_DYNAMIC_SECTIONS = NO

DISABLE_INDEX = NO
FULL_SIDEBAR = NO
HTML_COLORSTYLE = LITE
HTML_EXTRA_STYLESHEET = \
@OAMP_DOX_DIR@/../awesome/doxygen-awesome.css \
@OAMP_DOX_DIR@/../awesome/doxygen-awesome-sidebar-only.css \
@OAMP_DOX_DIR@/doxygen-awesome-openamp.css

HTML_EXTRA_FILES = \
@OAMP_DOX_DIR@/doxygen-awesome-openamp.js \
@OAMP_DOX_DIR@/../../_static/images/triangle_background.png

# For the toggle button (do we want it?)
# even w/o the toggle button the page honors the system level preference
HTML_EXTRA_STYLESHEET += \
@OAMP_DOX_DIR@/../awesome/doxygen-awesome-sidebar-only-darkmode-toggle.css
HTML_EXTRA_FILES += \
@OAMP_DOX_DIR@/../awesome/doxygen-awesome-darkmode-toggle.js

HTML_HEADER = @OAMP_DOX_DIR@/header.html
HTML_FOOTER = @OAMP_DOX_DIR@/footer.html
LAYOUT_FILE = @OAMP_DOX_DIR@/layout.xml

PROJECT_LOGO = \
@OAMP_DOX_DIR@/../../_static/images/openAMP_combox_dark_trim.svg

PROJECT_NUMBER = "@VERSION_NAME@"
116 changes: 116 additions & 0 deletions _doxygen/openamp/doxygen-awesome-openamp.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
* This file contains color customizations that follow OpenAMP branding
* This file was originally copied from the Zephyr project and modified
* The original copyright and license are maintained below
*
* Copyright (c) 2021 Nordic Semiconductor ASA
* Copyright (c) 2023 Linaro Ltd
* SPDX-License-Identifier: Apache-2.0
*/

html {
--primary-color: #e86060;
--primary-dark-color: #d04040;
--primary-light-color: #c0c0c0;
--primary-lighter-color: #e0e0e0;
--primary-lightest-color: #f0f0f0;

--side-nav-background: #343131;
--side-nav-foreground: #c0c0c0;

--searchbar-background: var(--page-background-color);
--searchbar-foreground: var(--page-foreground-color);

--link-color: #2980b9;
--param-color: #b71c1c;

--side-nav-fixed-width: 300px;
--top-height: 280px;
}

@media (prefers-color-scheme: dark) {
html:not(.light-mode) {
color-scheme: dark;

--primary-color: #af7fe4;
--primary-dark-color: #cb99f6;
--primary-light-color: #7929d2;
--primary-lighter-color: #191e21;
--primary-lightest-color: #191a1c;

--side-nav-background: #343131;
--side-nav-foreground: var(--page-foreground-color);

--param-color: #ef9a9a;
}
}

html.dark-mode {
color-scheme: dark;

--primary-color: #e86060;
--primary-dark-color: #d04040;
--primary-light-color: #707070;
--primary-lighter-color: #191e21;
--primary-lightest-color: #191a1c;

--side-nav-background: #343131;
--side-nav-foreground: var(--page-foreground-color);

--param-color: #ef9a9a;
}

a:link, a:visited, a:hover, a:focus, a:active {
color: var(--link-color) !important;
}

.paramname {
color: var(--param-color);
}

dl.section dd, dl.bug dd, dl.deprecated dd {
margin-inline-start: revert;
}

/* adjust top and title to ~match Sphinx docs */
#top {
background: var(--side-nav-background);
background-image: url("triangle_background.png");
}

#titlearea {
padding-bottom: 0;
}

#titlearea table {
width: 100%;
}

#projectlogo img {
width: 150px;
height: 150px;
max-height: none !important;
padding-top: 12px;
}

#projectalign {
display: none;
}

@media screen and (min-width: 767px) {
#doc-content {
padding-top: calc(var(--top-height) - 220px);
}
}

/* style for re-injected version */
#projectversion {
color: var(--side-nav-foreground);
padding-top: 25px;
text-align: center;
color: #ffffff;
}

#nav-sync {
visibility: hidden;
}
12 changes: 12 additions & 0 deletions _doxygen/openamp/doxygen-awesome-openamp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2021 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/

window.addEventListener('DOMContentLoaded', (event) => {
/* re-inject project version at a custom location */
let version = document.getElementById('projectnumber').innerText
let titleTable = document.querySelector('#titlearea table');
let cell = titleTable.insertRow(1).insertCell(0);
cell.innerHTML = '<div id="projectversion">' + version + '</div>';
});
17 changes: 17 additions & 0 deletions _doxygen/openamp/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- HTML footer for doxygen 1.9.1-->
<!-- 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>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>
65 changes: 65 additions & 0 deletions _doxygen/openamp/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!-- 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>
<script type="text/javascript" src="$relpath^doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript" src="$relpath^doxygen-awesome-openamp.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
</head>
<body>
<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 style="height: 56px;">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo">
<a href="../../index.html">
<img alt="Logo" src="$relpath^$projectlogo"/>
</a>
</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 -->
Loading