Skip to content

Commit

Permalink
doc: Add readthedocs config
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasblixt committed Apr 15, 2023
1 parent 7a617b5 commit a164e37
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
20 changes: 20 additions & 0 deletions .readthedocs.yml
@@ -0,0 +1,20 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

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

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: doc/requirements.txt
11 changes: 11 additions & 0 deletions doc/build.sh
@@ -0,0 +1,11 @@
cat <<EOF > tmp_dockerfile
FROM sphinxdoc/sphinx
RUN apt-get update -y
RUN apt-get install -y doxygen
COPY doc/requirements.txt /requirements.txt
RUN pip3 install -r /requirements.txt
EOF

docker build -f tmp_dockerfile -t local_pb_sphinx_docker $(pwd)/$(dirname $0)/..
rm tmp_dockerfile
docker run --rm -u $(id -u):$(id -g) -v $(pwd)/$(dirname $0)/..:/docs local_pb_sphinx_docker bash -c "cd doc && doxygen source/doxygen.cfg && sphinx-build -b html source _build/html"
4 changes: 4 additions & 0 deletions doc/requirements.txt
@@ -0,0 +1,4 @@
breathe
sphinx_rtd_theme
semver
sphinxcontrib-plantuml
20 changes: 8 additions & 12 deletions doc/source/conf.py
Expand Up @@ -29,16 +29,12 @@
author = 'Jonas Blixt'

# The full version, including alpha/beta/rc tags

release = '1.0.0'

version = "1.0.0"
release = version

# -- General configuration ---------------------------------------------------

read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'

#if read_the_docs_build:
subprocess.call('doxygen ../doxygen.cfg', shell=True)
subprocess.call('set', shell=True)
subprocess.call('doxygen doxygen.cfg', shell=True)

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -89,11 +85,11 @@
# extlins
extlinks = {
'github-blob':
('https://github.com/jonasblixt/punchboot/blob/' + release + '/%s', ''),
('https://github.com/jonasblixt/punchboot/blob/' + version + '/%s', '%s'),
'github-tree':
('https://github.com/jonasblixt/punchboot/tree/' + release + '/%s', ''),
('https://github.com/jonasblixt/punchboot/tree/' + version + '/%s', ''),
'codecov':
('https://codecov.io/gh/jonasblixt/punchboot/src/' + release + '/%s', ''),
('https://codecov.io/gh/jonasblixt/punchboot/src/' + version + '/%s', ''),
'codecov-tree':
('https://codecov.io/gh/jonasblixt/punchboot/tree/' + release + '/%s', '')
('https://codecov.io/gh/jonasblixt/punchboot/tree/' + version + '/%s', '')
}
File renamed without changes.

0 comments on commit a164e37

Please sign in to comment.