Skip to content

Commit

Permalink
remove sphinx sources and update RTD config
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Sep 24, 2024
1 parent 63cadc4 commit 1df5120
Show file tree
Hide file tree
Showing 66 changed files with 67 additions and 875 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ __pycache__/
*.pyc
*.egg*
build/
_build/
*CMakeUserPresets*.json
*.tar.gz

Expand Down
39 changes: 31 additions & 8 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,38 @@
version: 2

build:
os: "ubuntu-20.04"
os: "ubuntu-22.04"
apt_packages:
- libclang1-12
- libclang-cpp12
tools:
python: "3"
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 ./ &&
cd ..
# get lib version & overwrite Doxyfile values
- python3 docs/ci.py
# run doxygen
- cd docs && ../.doxygen/doxygen
# copy output to RTD output path for HTML files
- echo "${READTHEDOCS_OUTPUT}html/"
- ls -R docs/html/
- mv docs/html/ "${READTHEDOCS_OUTPUT}html"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/sphinx/conf.py
# # 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
# # install Python requirements required to build docs
# python:
# install:
# - requirements: docs/sphinx/requirements.txt
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
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.
19 changes: 19 additions & 0 deletions docs/ci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pathlib import Path
import json

DOCS_DIR = Path(__file__).parent
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()
20 changes: 0 additions & 20 deletions docs/sphinx/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion docs/sphinx/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Intended for Sphinx only

The files in this folder are only used to generate documentation using Sphinx (from Doxygen's XML output).
The files in this folder are only used to generate documentation using Sphinx (from Doxygen's output).

See building docs instructions in docs/README.md
9 changes: 0 additions & 9 deletions docs/sphinx/RF24_config_8h.rst

This file was deleted.

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

This file was deleted.

Loading

0 comments on commit 1df5120

Please sign in to comment.