Skip to content

Commit

Permalink
Merge pull request #3 from Synchrotron-Radiation-Workshop/cpp_docs
Browse files Browse the repository at this point in the history
C++ Docs to Sphinx via Doxygen and Breathe
  • Loading branch information
hhslepicka authored Aug 25, 2020
2 parents 5e3bc85 + d6a114c commit e3e1a4e
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 7 deletions.
13 changes: 13 additions & 0 deletions docs/Doxyfile_core
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PROJECT_NAME = "SRW Core"
OUTPUT_DIRECTORY = build
XML_OUTPUT = doxyxml_core
GENERATE_LATEX = NO
GENERATE_MAN = NO
GENERATE_RTF = NO
CASE_SENSE_NAMES = NO
INPUT = ../src/core
RECURSIVE = YES
QUIET = YES
JAVADOC_AUTOBRIEF = YES
GENERATE_HTML = NO
GENERATE_XML = YES
13 changes: 13 additions & 0 deletions docs/Doxyfile_lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PROJECT_NAME = "SRW Lib"
OUTPUT_DIRECTORY = build
XML_OUTPUT = doxyxml_lib
GENERATE_LATEX = NO
GENERATE_MAN = NO
GENERATE_RTF = NO
CASE_SENSE_NAMES = NO
INPUT = ../src/lib
RECURSIVE = YES
QUIET = YES
JAVADOC_AUTOBRIEF = YES
GENERATE_HTML = NO
GENERATE_XML = YES
4 changes: 3 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS = "-W" # This flag turns warnings into errors.
SPHINXOPTS = #"-W" # This flag turns warnings into errors.
SPHINXBUILD = sphinx-build
SPHINXPROJ = srwpy
SOURCEDIR = source
Expand All @@ -17,4 +17,6 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@doxygen Doxyfile_core
@doxygen Doxyfile_lib
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
5 changes: 5 additions & 0 deletions docs/source/api/cpp/core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SRW Core
========

.. doxygenindex::
:project: SRWCore
8 changes: 8 additions & 0 deletions docs/source/api/cpp/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SRW C++
=======

.. toctree::
:maxdepth: 1

core
lib
5 changes: 5 additions & 0 deletions docs/source/api/cpp/lib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SRW Lib
=======

.. doxygenindex::
:project: SRWLib
7 changes: 6 additions & 1 deletion docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ API
===

.. toctree::
:maxdepth: 2
:maxdepth: 1
:caption: Python

python/_modules/modules.rst

.. toctree::
:maxdepth: 1
:caption: C++

cpp/index.rst
4 changes: 2 additions & 2 deletions docs/source/api/python/_modules/modules.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
srwpy
=====
SRW Python
==========

.. toctree::
:maxdepth: 4
Expand Down
15 changes: 12 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

import breathe
import os
import sys
import re
Expand All @@ -36,7 +37,7 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
# 'sphinx.ext.autosummary',
'sphinx.ext.githubpages',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
Expand All @@ -47,6 +48,7 @@
'numpydoc',
'sphinx_copybutton',
'sphinx_gallery.gen_gallery',
'breathe'
]

autodoc_mock_imports = ["pykern", "skimage"]
Expand Down Expand Up @@ -208,8 +210,6 @@
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
Expand All @@ -218,3 +218,12 @@
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
'matplotlib': ('https://matplotlib.org', None),
}

# -- Options for Breathe output --------------------------------

# Breath configuration
breathe_projects = {
'SRWCore': '../build/doxyxml_core',
'SRWLib': '../build/doxyxml_lib'
}
breathe_default_project = 'SRWCore'
2 changes: 2 additions & 0 deletions python/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pillow # required by sphinx-gallery
sphinx-copybutton
sphinx-gallery
sphinx_rtd_theme
doxygen
breathe
# PyPI deployment tools
setuptools
twine
Expand Down

0 comments on commit e3e1a4e

Please sign in to comment.