Skip to content

Commit

Permalink
Group CMake Options in index and Show index in left navigation pane (#…
Browse files Browse the repository at this point in the history
…310)

* Move common extensions to shared file
* Updates index to group cmake options under "CMake options" category
* Update left navigation pane to include index link
  • Loading branch information
gardner48 authored Jul 26, 2023
1 parent 1ea097b commit a783797
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 80 deletions.
14 changes: 4 additions & 10 deletions doc/arkode/guide/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py')))
from versions import *

# -- Create new object types --------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
app.add_object_type('cmakeoption', 'cmakeop', 'single: %s (CMake option)')
app.add_config_value('package_name', '', 'env', types=[str])
sys.path.append(os.path.dirname(os.path.abspath('../../../shared')))

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

Expand All @@ -34,13 +27,14 @@ def setup(app: Sphinx):
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton']
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex',
'sphinx_copybutton', 'sphinx_sundials']

# References
bibtex_bibfiles = ['../../../shared/sundials.bib']

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

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down
14 changes: 4 additions & 10 deletions doc/cvode/guide/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py')))
from versions import *

# -- Create new object types --------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
app.add_object_type('cmakeoption', 'cmakeop', 'single: %s (CMake option)')
app.add_config_value('package_name', '', 'env', types=[str])
sys.path.append(os.path.dirname(os.path.abspath('../../../shared')))

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

Expand All @@ -34,13 +27,14 @@ def setup(app: Sphinx):
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton']
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex',
'sphinx_copybutton', 'sphinx_sundials']

# References
bibtex_bibfiles = ['../../../shared/sundials.bib']

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

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down
14 changes: 4 additions & 10 deletions doc/cvodes/guide/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py')))
from versions import *

# -- Create new object types --------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
app.add_object_type('cmakeoption', 'cmakeop', 'single: %s (CMake option)')
app.add_config_value('package_name', '', 'env', types=[str])
sys.path.append(os.path.dirname(os.path.abspath('../../../shared')))

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

Expand All @@ -34,13 +27,14 @@ def setup(app: Sphinx):
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton']
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex',
'sphinx_copybutton', 'sphinx_sundials']

# References
bibtex_bibfiles = ['../../../shared/sundials.bib']

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

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down
14 changes: 4 additions & 10 deletions doc/ida/guide/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py')))
from versions import *

# -- Create new object types --------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
app.add_object_type('cmakeoption', 'cmakeop', 'single: %s (CMake option)')
app.add_config_value('package_name', '', 'env', types=[str])
sys.path.append(os.path.dirname(os.path.abspath('../../../shared')))

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

Expand All @@ -34,13 +27,14 @@ def setup(app: Sphinx):
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton']
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex',
'sphinx_copybutton', 'sphinx_sundials']

# References
bibtex_bibfiles = ['../../../shared/sundials.bib']

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

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down
14 changes: 4 additions & 10 deletions doc/idas/guide/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py')))
from versions import *

# -- Create new object types --------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
app.add_object_type('cmakeoption', 'cmakeop', 'single: %s (CMake option)')
app.add_config_value('package_name', '', 'env', types=[str])
sys.path.append(os.path.dirname(os.path.abspath('../../../shared')))

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

Expand All @@ -34,13 +27,14 @@ def setup(app: Sphinx):
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton']
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex',
'sphinx_copybutton', 'sphinx_sundials']

# References
bibtex_bibfiles = ['../../../shared/sundials.bib']

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

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down
14 changes: 4 additions & 10 deletions doc/install_guide/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@
import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../shared/versions.py')))
from versions import *

# -- Create new object types --------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
app.add_object_type('cmakeoption', 'cmakeop', 'single: %s (CMake option)')
app.add_config_value('package_name', '', 'env', types=[str])
sys.path.append(os.path.dirname(os.path.abspath('../../shared')))

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

Expand All @@ -35,13 +28,14 @@ def setup(app: Sphinx):
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton']
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex',
'sphinx_copybutton', 'sphinx_sundials']

# References
bibtex_bibfiles = ['../../shared/sundials.bib']

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

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down
14 changes: 4 additions & 10 deletions doc/kinsol/guide/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../../shared/versions.py')))
from versions import *

# -- Create new object types --------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
app.add_object_type('cmakeoption', 'cmakeop', 'single: %s (CMake option)')
app.add_config_value('package_name', '', 'env', types=[str])
sys.path.append(os.path.dirname(os.path.abspath('../../../shared')))

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

Expand All @@ -34,13 +27,14 @@ def setup(app: Sphinx):
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton']
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex',
'sphinx_copybutton', 'sphinx_sundials']

# References
bibtex_bibfiles = ['../../../shared/sundials.bib']

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

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down
6 changes: 6 additions & 0 deletions doc/shared/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% extends "!layout.html" %}

{% block menu %}
{{ super() }}
<li class="toctree-l1"><a class="reference internal" href="{{pathto('genindex.html', 1)}}">Index</a></li>
{% endblock %}
21 changes: 21 additions & 0 deletions doc/shared/sphinx_sundials.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -----------------------------------------------------------------------------
# SUNDIALS Copyright Start
# Copyright (c) 2002-2023, Lawrence Livermore National Security
# and Southern Methodist University.
# All rights reserved.
#
# See the top-level LICENSE and NOTICE files for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# SUNDIALS Copyright End
# -----------------------------------------------------------------------------
# SUNDIALS Sphinx extension
# -----------------------------------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
# Create new object type for CMake options
app.add_object_type('cmakeoption', 'cmakeop', 'single: CMake options; %s')
# Create new configuration value set in conf.py
app.add_config_value('package_name', '', 'env', types=[str])
14 changes: 4 additions & 10 deletions doc/superbuild/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@
import sys, os
sys.path.append(os.path.dirname(os.path.abspath('../../shared/versions.py')))
from versions import *

# -- Create new object types --------------------------------------------------

from sphinx.application import Sphinx

def setup(app: Sphinx):
app.add_object_type('cmakeoption', 'cmakeop', 'single: %s (CMake option)')
app.add_config_value('package_name', '', 'env', types=[str])
sys.path.append(os.path.dirname(os.path.abspath('../../shared')))

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

Expand All @@ -34,13 +27,14 @@ def setup(app: Sphinx):
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_rtd_theme', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax',
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex', 'sphinx_copybutton']
'sphinxfortran.fortran_domain', 'sphinxcontrib.bibtex',
'sphinx_copybutton', 'sphinx_sundials']

# References
bibtex_bibfiles = ['../../shared/sundials.bib']

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

# The suffix of source filenames.
source_suffix = '.rst'
Expand Down

0 comments on commit a783797

Please sign in to comment.