Skip to content

Commit fde50b1

Browse files
authored
docs: revise CI (#51)
corresponds to nRF24/.github#23 really this repo just uses CI to deploy docs. So, I updated the docs sources to work better with doxygen v1.15.0 And I found/fixed a typo. * enable RTD builds for PRs
1 parent 8c28d55 commit fde50b1

16 files changed

Lines changed: 369 additions & 71 deletions

.gitattributes

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
# Auto detect text files and perform LF normalization
1+
# Set the default behavior, in case people don't have core.autocrlf set.
22
* text=auto
33

4-
# Custom for Visual Studio
5-
*.cs diff=csharp
6-
*.sln merge=union
7-
*.csproj merge=union
8-
*.vbproj merge=union
9-
*.fsproj merge=union
10-
*.dbproj merge=union
11-
12-
# Standard to msysgit
13-
*.doc diff=astextplain
14-
*.DOC diff=astextplain
15-
*.docx diff=astextplain
16-
*.DOCX diff=astextplain
17-
*.dot diff=astextplain
18-
*.DOT diff=astextplain
19-
*.pdf diff=astextplain
20-
*.PDF diff=astextplain
21-
*.rtf diff=astextplain
22-
*.RTF diff=astextplain
23-
24-
# doxygen generated files
25-
docs/html/
26-
docs/xml/
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.py text eol=lf
7+
*.rst text eol=lf
8+
*.sh text eol=lf
9+
*.h text eol=lf
10+
*.cpp text eol=lf
11+
*.c text eol=lf
12+
.yaml text eol=lf
13+
*.yml text eol=lf
14+
*.md text eol=lf
15+
*.txt text eol=lf
16+
*.json text eol=lf
17+
*.properties text eol=lf
18+
LICENSE text eol=lf
19+
nurfile text eol=lf
20+
.gitignore text eol=lf
21+
.gitattributes text eol=lf
22+
.clang-format text eol=lf
23+
.clang-tidy text eol=lf
24+
Makefile text eol=lf
25+
*.svg text eol=lf
26+
*.ino text eol=lf
27+
*.dot text eol=lf
28+
*.cmake text eol=lf
29+
*.css text eol=lf
30+
Doxyfile text eol=lf

.github/doxygen.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""WARNING -- FOR CI ONLY
2+
3+
This script is meant to be execute in CI only.
4+
Running this locally will alter the Doxyfile.
5+
Such changes SHOULD NOT be pushed to the remote.
6+
"""
7+
8+
from pathlib import Path
9+
10+
DOCS_DIR = Path(__file__).parent.parent / "docs"
11+
PROPERTIES = DOCS_DIR.parent / "library.properties"
12+
CONFIG = DOCS_DIR / "Doxyfile"
13+
TMP = DOCS_DIR / "doxygenAction"
14+
15+
16+
def overwrite_doxygen_value():
17+
properties = PROPERTIES.read_text(encoding="utf-8").splitlines()
18+
for line in properties:
19+
if line.startswith("version="):
20+
_, value = line.split("=", 1)
21+
version = value.strip()
22+
break
23+
else:
24+
raise RuntimeError("version not found in library.properties")
25+
config = CONFIG.read_text(encoding="utf-8")
26+
TMP.write_text(f"PROJECT_NUMBER = {version}\n", encoding="utf-8")
27+
config += f"\n@INCLUDE = {str(TMP)}\n"
28+
CONFIG.write_text(config, encoding="utf-8")
29+
30+
31+
if __name__ == "__main__":
32+
overwrite_doxygen_value()

.github/workflows/doxygen.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
1-
name: DoxyGen build
1+
name: Docs
22

33
on:
44
pull_request:
5-
branches:
6-
- master
5+
branches: [master]
76
push:
8-
branches:
9-
- master
7+
branches: [master]
8+
tags: ["*"]
9+
workflow_dispatch:
10+
11+
permissions: {}
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
1016

1117
jobs:
12-
build-docs:
18+
build:
1319
uses: nRF24/.github/.github/workflows/build_docs.yaml@main
1420
with:
15-
deploy-gh-pages: ${{ github.event_name == 'push' }} # happens only on master branch
21+
doxygen-version: "1.15.0"
22+
23+
deploy:
24+
needs: [build]
25+
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
26+
permissions:
27+
# to authenticate the gh-pages environment
28+
id-token: write
29+
# to upload to GitHub Pages
30+
pages: write
31+
uses: nRF24/.github/.github/workflows/deploy_docs.yaml@main
1632
secrets: inherit

.readthedocs.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
build:
9+
os: "ubuntu-24.04"
10+
# apt_packages:
11+
# - libclang1-12
12+
# - libclang-cpp12
13+
tools:
14+
python: "3"
15+
commands:
16+
# Install doxygen from source distributions (conda forge does not keep up-to-date doxygen releases)
17+
- >
18+
DOXYGEN_VERSION="1.15.0" &&
19+
RELEASE_TITLE=$(echo ${DOXYGEN_VERSION} | tr '.' '_') &&
20+
mkdir .doxygen && cd .doxygen &&
21+
curl -L "https://github.com/doxygen/doxygen/releases/download/Release_${RELEASE_TITLE}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" --output doxygen.tar.gz &&
22+
gunzip doxygen.tar.gz &&
23+
tar xf doxygen.tar &&
24+
mv doxygen-${DOXYGEN_VERSION}/bin/doxygen ./
25+
# get lib version & overwrite Doxyfile values
26+
- python3 .github/doxygen.py
27+
# run doxygen
28+
- cd docs && ../.doxygen/doxygen
29+
# copy output to RTD output path for HTML files
30+
- ls -R docs/html/
31+
- mkdir -p ${READTHEDOCS_OUTPUT}
32+
- mv docs/html/ "${READTHEDOCS_OUTPUT}"

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ See the [documentation section](http://nRF24.github.io/RF24Audio) for more info.
55

66
Only AVR devices are supported. For ESP32 and Arduino Due, see [AutoAnalogAudio](https://github.com/TMRh20/AutoAnalogAudio), a more
77
versatile audio input/output library.
8-
9-

RF24Audio.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class RF24Audio
106106
* Get any of the preset radio addresses
107107
*
108108
* Useful for listening nodes who wish to create private or additional radio groups
109-
* The library has 14 predefined radio addreses. All radios listen/write on the first
109+
* The library has 14 predefined radio addresses. All radios listen/write on the first
110110
* two addresses (0, 1), and engage a private channel based on the radio number.
111111
* Radio 0 listens on address 2, Radio 1 on address 3, etc.
112112
*
@@ -172,18 +172,3 @@ void RX();
172172
* This sketch is demonstrates how to interact with the audio library directly using the core
173173
* RF24 radio library: http://nRF24.github.io/RF24/
174174
*/
175-
176-
/**
177-
* @page Setup Boards & Wiring
178-
* @section Board Wiring
179-
* This page displays different options for wiring/board configuration.
180-
*
181-
* @image html "images/NRF1.jpg" height=25% width=25%
182-
*
183-
* Wiring diagram for DIY module connector. May not be needed depending on module:
184-
* @image html "images/RF24AudioBasic_LargeAntenna.jpg" height=45% width=45%
185-
* @image html "images/NRF2.jpg" height=20% width=20%
186-
* @image html "images/RF24AudioBasic_SmallAntenna.jpg" height=45% width=45%
187-
* Wiring diagram for SD streaming/multicast using TMRpcm library:
188-
* @image html "images/RF24Audio_FullSD.jpg" height=65% width=65%
189-
*/

docs/Doxyfile

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# Project related configuration options
1818
#---------------------------------------------------------------------------
1919

20+
PROJECT_ICON = images/favicon.ico
21+
2022
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
2123
# double-quotes, unless you are using Doxywizard) that should identify the
2224
# project for which the documentation is generated. This name is used in the
@@ -165,7 +167,7 @@ EXAMPLE_RECURSIVE = YES
165167
# that contain images that are to be included in the documentation (see the
166168
# \image command).
167169

168-
IMAGE_PATH = ../images
170+
IMAGE_PATH = ./images/
169171

170172
# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
171173
# is part of the input, its contents will be placed on the main page
@@ -174,6 +176,12 @@ IMAGE_PATH = ../images
174176

175177
USE_MDFILE_AS_MAINPAGE = main_page.md
176178

179+
# Don't display the ugly/complicated "tree view" side menu.
180+
# And, restore the top (simpler) navigation bar.
181+
# As of doxygen v1.13.0, these default values changed from NO to YES
182+
GENERATE_TREEVIEW = NO
183+
DISABLE_INDEX = NO
184+
177185
#---------------------------------------------------------------------------
178186
# Configuration options related to source browsing
179187
#---------------------------------------------------------------------------
@@ -232,6 +240,35 @@ HTML_EXTRA_STYLESHEET = doxygen-custom.css
232240

233241
HTML_COLORSTYLE = TOGGLE
234242

243+
# If the TIMESTAMP tag is set different from NO then each generated page will contain
244+
# the date or date and time when the page was generated. Setting this to NO can help
245+
# when comparing the output of multiple runs.
246+
#
247+
# Possible values are: YES, NO, DATETIME and DATE.
248+
#
249+
# The default value is: NO.
250+
251+
TIMESTAMP = DATE
252+
253+
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
254+
# documentation will contain a main index with vertical navigation menus that
255+
# are dynamically created via JavaScript. If disabled, the navigation index will
256+
# consists of multiple levels of tabs that are statically embedded in every HTML
257+
# page. Disable this option to support browsers that do not have JavaScript,
258+
# like the Qt help browser.
259+
# The default value is: YES.
260+
# This tag requires that the tag GENERATE_HTML is set to YES.
261+
262+
HTML_DYNAMIC_MENUS = NO
263+
264+
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
265+
# documentation will contain sections that can be hidden and shown after the
266+
# page has loaded.
267+
# The default value is: NO.
268+
# This tag requires that the tag GENERATE_HTML is set to YES.
269+
270+
HTML_DYNAMIC_SECTIONS = YES
271+
235272
#---------------------------------------------------------------------------
236273
# Configuration options related to the LaTeX output
237274
#---------------------------------------------------------------------------

0 commit comments

Comments
 (0)