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

remove sphinx sources and update RTD config #1003

Merged
merged 3 commits into from
Oct 5, 2024
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
25 changes: 25 additions & 0 deletions .github/doxygen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""WARNING -- FOR CI ONLY

This script is meant to be execute in CI only.
Running this locally will alter the Doxyfile.
Such changes SHOULD NOT be pushed to the remote.
"""
from pathlib import Path
import json

DOCS_DIR = Path(__file__).parent.parent / "docs"
PROPERTIES = DOCS_DIR.parent / "library.json"
CONFIG = DOCS_DIR / "Doxyfile"
TMP = DOCS_DIR / "doxygenAction"


def overwrite_doxygen_value():
properties = json.loads(PROPERTIES.read_text(encoding="utf-8"))
assert "version" in properties
config = CONFIG.read_text(encoding="utf-8")
TMP.write_text("PROJECT_NUMBER = {}\n".format(properties["version"]), encoding="utf-8")
config += f"\n@INCLUDE = {str(TMP)}\n"
CONFIG.write_text(config, encoding="utf-8")

if __name__ == "__main__":
overwrite_doxygen_value()
33 changes: 23 additions & 10 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,28 @@
version: 2

build:
os: "ubuntu-20.04"
os: "ubuntu-22.04"
apt_packages:
- libclang1-12
- libclang-cpp12
tools:
python: "3"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/sphinx/conf.py

# install Python requirements required to build docs
python:
install:
- requirements: docs/sphinx/requirements.txt
commands:
# Install doxygen from source distributions (conda forge does not keep up-to-date doxygen releases)
- >
DOXYGEN_VERSION="1.12.0" &&
mkdir .doxygen && cd .doxygen &&
echo $(pwd) &&
echo "https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz" &&
curl -L https://sourceforge.net/projects/doxygen/files/rel-$DOXYGEN_VERSION/doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz > doxygen.tar.gz &&
gunzip doxygen.tar.gz &&
tar xf doxygen.tar &&
mv doxygen-$DOXYGEN_VERSION/bin/doxygen ./
# get lib version & overwrite Doxyfile values
- python3 .github/doxygen.py
# run doxygen
- cd docs && ../.doxygen/doxygen
# copy output to RTD output path for HTML files
- ls -R docs/html/
- mkdir -p ${READTHEDOCS_OUTPUT}
- mv docs/html/ "${READTHEDOCS_OUTPUT}"
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ words:
- DIRSET
- Disabl
- Doherty
- Doxyfile
- doxygen
- doxygenfile
- doxygenfunction
Expand Down
20 changes: 1 addition & 19 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Project related configuration options
#---------------------------------------------------------------------------

PROJECT_ICON = sphinx/_static/new_favicon.ico
PROJECT_ICON = images/favicon.ico

# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
# double-quotes, unless you are using Doxywizard) that should identify the
Expand Down Expand Up @@ -372,24 +372,6 @@ HTML_DYNAMIC_SECTIONS = YES

GENERATE_LATEX = NO

#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------

# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
# captures the structure of the code including all documentation.
# The default value is: NO.

GENERATE_XML = YES

# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
# it.
# The default directory is: xml.
# This tag requires that the tag GENERATE_XML is set to YES.

XML_OUTPUT = sphinx/xml

#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
Expand Down
22 changes: 3 additions & 19 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Please browse the docs from either http://nrf24.github.io/RF24 or https://rf24.rtfd.io
# Please browse the docs from either http://nrf24.github.io/RF24

## Intended for use in Doxygen

Expand All @@ -14,26 +14,10 @@ Navigate to the repo's docs folder:
cd docs
```

Install Doxygen (v1.9.5 or newer) and run the following command from the repo's docs folder:
Install Doxygen (v1.12.0 or newer) and run the following command from the repo's docs folder:

```shell
doxygen
```

The Doxygen HTML output is now in docs/html. The Doxygen XML output in docs/sphinx/xml can be optionally used to generate Sphinx output.

### Generating Sphinx docs (optional)

To build the Sphinx docs based on Doxygen's XML output, first install the necessary python dependencies.

``` shell
python -m pip install docs/sphinx/requirements.txt
```

Now build the Sphinx docs (after building the Doxygen output) from the repo's docs folder:

```shell
sphinx-build sphinx _build/html
```

The Sphinx HTML output now exists in docs/_build/html.
The Doxygen HTML output is now in docs/html.
File renamed without changes
File renamed without changes.
20 changes: 0 additions & 20 deletions docs/sphinx/Makefile

This file was deleted.

5 changes: 0 additions & 5 deletions docs/sphinx/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/sphinx/RF24_config_8h.rst

This file was deleted.

20 changes: 0 additions & 20 deletions docs/sphinx/_static/custom_material.css

This file was deleted.

150 changes: 0 additions & 150 deletions docs/sphinx/classRF24.rst

This file was deleted.

Loading