IAP GITLAB

Skip to content
Snippets Groups Projects
conf.py 4.52 KiB
Newer Older
import sys
ralfulrich's avatar
ralfulrich committed
import subprocess, os
ralfulrich's avatar
ralfulrich committed
def configureDoxyfile(input_dir, output_dir):
    with open('Doxyfile.in', 'r') as file :
        filedata = file.read()

    filedata = filedata.replace('@PROJECT_SOURCE_DIR@', input_dir)
    filedata = filedata.replace('@CMAKE_CURRENT_BINARY_DIR@', output_dir)
    filedata = filedata.replace('@CMAKE_BINARY_DIR@', output_dir)

    with open('Doxyfile', 'w') as file:
        file.write(filedata)

ralfulrich's avatar
ralfulrich committed
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'

ralfulrich's avatar
ralfulrich committed
breathe_projects = {}

ralfulrich's avatar
ralfulrich committed
if read_the_docs_build:
ralfulrich's avatar
ralfulrich committed
    
ralfulrich's avatar
ralfulrich committed
    input_dir = '../'
ralfulrich's avatar
ralfulrich committed
    output_dir = 'build'
    configureDoxyfile(input_dir, output_dir)

ralfulrich's avatar
ralfulrich committed
    subprocess.call('mkdir -p build/corsika/framework/core; cd build/corsika/framework/core && ../../../../../src/framework/core/pdxml_reader.py ../../../../../src/framework/core/ParticleData.xml ../../../../../src/framework/core/NuclearData.xml ../../../../../src/framework/core/ParticleClassNames.xml', shell=True)
ralfulrich's avatar
ralfulrich committed
    subprocess.call('mkdir -p build/corsika/media; cd build/corsika/media && ../../../../src/media/readProperties.py ../../../../src/media/properties8.dat', shell=True)
ralfulrich's avatar
ralfulrich committed
    
    subprocess.call('doxygen', shell=True)
ralfulrich's avatar
ralfulrich committed
    breathe_projects['CORSIKA8'] = output_dir + '/xml'

# -- Project information -----------------------------------------------------

project = u'CORSIKA8'
copyright = u'2021, CORSIKA 8 Collaboration'
author = u'CORSIKA 8 Collaboration'

# The short X.Y version
ralfulrich's avatar
ralfulrich committed
version = u'0.0.0'
# The full version, including alpha/beta/rc tags
ralfulrich's avatar
ralfulrich committed
release = u'prototype-0.1.0'

extensions = [
    'sphinx.ext.todo',
    'breathe',
    'sphinx.ext.mathjax',
    'sphinx.ext.autodoc',
    'sphinx.ext.extlinks',
    'sphinx.ext.autosummary',
    'sphinx.ext.napoleon',
    'recommonmark'
]

breathe_default_project = "CORSIKA8"


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- Options for HTML output -------------------------------------------------

html_theme = 'sphinx_rtd_theme'
# html_theme_options = {}

ralfulrich's avatar
ralfulrich committed
# html_static_path = []
# html_sidebars = {}

ralfulrich's avatar
ralfulrich committed
htmlhelp_basename = 'C8doc'

# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #
    # 'papersize': 'letterpaper',

    # The font size ('10pt', '11pt' or '12pt').
    #
    # 'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    #
    # 'preamble': '',

    # Latex figure (float) alignment
    #
    # 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
ralfulrich's avatar
ralfulrich committed
    (master_doc, 'C8-GUIDE.tex', u'CORSIKA 8 Documentation',
     u'CORSIKA 8 Collaboration', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
ralfulrich's avatar
ralfulrich committed
    (master_doc, 'CORSIKA 8', u'CORSIKA 8 Documentation',
     [author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
ralfulrich's avatar
ralfulrich committed
    (master_doc, 'CORSIKA 8', u'CORSIKA 8 Documentation',
     author, 'CORSIKA 8', 'The air shower simulation framework',
     'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------

napoleon_google_docstring = True
napoleon_include_init_with_doc = True
napoleon_use_keyword = True
napoleon_use_param = True
napoleon_use_rtype = False
napoleon_use_admonition_for_examples = True
# autodoc_docstring_signature=False