Tests sphinx extensions with the package

Tested extensions:
- python-sphinx-theme-alabaster
- python-sphinx_rtd_theme
- python-sphinxcontrib-jquery

The tested extensions are the one that we pull to CentOS Stream/RHEL.
This commit is contained in:
Karolina Surma 2024-09-20 16:10:35 +02:00
parent e134add034
commit 8596042acd
9 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,11 @@
summary: run the basic documentation build
test: |
sphinx-build -M html source/ build/ &&
grep '<script src="_static/jquery.js' build/html/index.html &&
grep '<script src="_static/_sphinx_javascript_frameworks_compat.js' build/html/index.html &&
test -f build/html/_static/jquery.js &&
test -f build/html/_static/_sphinx_javascript_frameworks_compat.js &&
rm -rf build/
require:
- python3-sphinx
- python3-sphinxcontrib-jquery

View File

@ -0,0 +1,7 @@
project = 'Test'
copyright = '2024, Test'
author = 'Test'
release = '0.3.0'
extensions = [
"sphinxcontrib.jquery",
]

View File

@ -3,6 +3,7 @@ test: |
sphinx-build -M html source/ build/ &&
grep '<section id="test-docfile">' build/html/index.html &&
grep '<h1>Test docfile' build/html/index.html &&
grep '_static/alabaster.css' build/html/index.html &&
rm -rf build/
require:
- python3-sphinx

View File

@ -0,0 +1,15 @@
Test docfile
============
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -0,0 +1,11 @@
summary: run the basic documentation build with sphinx-rtd-theme
test: |
sphinx-build -M html source/ build/ &&
grep '<section id="test-docfile">' build/html/index.html &&
grep '<h1>Test docfile' build/html/index.html &&
grep 'SphinxRtdTheme' build/html/_static/js/theme.js &&
grep '<script src="_static/js/theme.js' build/html/index.html &&
rm -rf build/
require:
- python3-sphinx
- python3-sphinx_rtd_theme

View File

@ -0,0 +1,8 @@
project = 'Test'
copyright = '2024, Test'
author = 'Test'
release = '0.3.0'
html_theme = 'sphinx_rtd_theme'
extensions = [
'sphinx_rtd_theme',
]

View File

@ -0,0 +1,15 @@
Test docfile
============
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`