Skip to content

Commit

Permalink
Enable Read the Docs build of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasujm committed Nov 30, 2019
1 parent f62cdfb commit 84deaf8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = @ENHANCEDENUM_HEADERS@
INPUT = "@ENHANCEDENUM_INCLUDE_DIR@/enhanced_enum"

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
17 changes: 17 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import subprocess
import sys

sys.path.insert(0, os.path.abspath("../python"))
Expand Down Expand Up @@ -62,3 +63,19 @@

# Breathe Configuration
breathe_default_project = "EnhancedEnum"

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

breathe_projects = {}

if read_the_docs_build:
input_dir = "../cxx/include"
output_dir = "build"
with open("Doxyfile.in") as infile:
doxyfile_contents = infile.read()
doxyfile_contents = doxyfile_contents.replace("@ENHANCEDENUM_INCLUDE_DIR@", input_dir)
doxyfile_contents = doxyfile_contents.replace("@DOXYGEN_OUTPUT_DIR@", output_dir)
with open("Doxyfile", "w") as outfile:
outfile.write(doxyfile_contents)
subprocess.call('doxygen', shell=True)
breathe_projects['EnhancedEnum'] = output_dir + '/xml'
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# For running breathe in Read the Docs
breathe

0 comments on commit 84deaf8

Please sign in to comment.