Switch to pydata theme (#2562)

This commit is contained in:
Ian Bell
2025-06-27 11:06:23 -04:00
committed by GitHub
parent 2891ea6058
commit e561faa531
3 changed files with 39 additions and 29 deletions

View File

@@ -79,6 +79,7 @@ jobs:
source activate docs
pip -vv wheel .
pip install -vvv --force-reinstall --ignore-installed --upgrade --no-index `ls *.whl`
pip install pydata-sphinx-theme
- name: Test the installed CoolProp version
shell: bash
@@ -148,8 +149,8 @@ jobs:
deploy:
# Add a dependency to the build job
needs: build
# Do not deploy intermediate builds
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
# Do not deploy intermediate builds, only deploy on tags
if: ${{ startsWith(github.ref, 'refs/tags/') }}
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:

View File

@@ -0,0 +1,8 @@
<ul class="navbar-nav">
<li class="nav-item"><a class="nav-link" href="{{ pathto('index') }}">Home</a></li>
<li class="nav-item"><a class="nav-link" href="{{ pathto('citation') }}">Citation</a></li>
<li class="nav-item"><a class="nav-link" href="http://ibell.pythonanywhere.com">CoolProp Online</a></li>
<li class="nav-item"><a class="nav-link" href="{{ pathto('coolprop/examples') }}">Examples</a></li>
<li class="nav-item"><a class="nav-link" href="{{ pathto('develop/code') }}">Code</a></li>
<li class="nav-item"><a class="nav-link" href="{{ pathto('coolprop/wrappers/index') }}">Interfaces</a></li>
</ul>

View File

@@ -81,8 +81,9 @@ else:
# Execute all the notebooks
for dirpath, dirnames, filenames in Path(__file__).parent.walk():
for file in filenames:
if file.endswith('.ipynb') and '.ipynb_checkpoints' not in str(dirpath):
if file.endswith('.ipynb') and '.ipynb_checkpoints' not in str(dirpath) and '_build' not in str(dirpath):
cmd = f'jupyter nbconvert --allow-errors --to notebook --output "{file}" --execute "{file}"'
print(f"About to run: {cmd} in {dirpath}")
subprocess.check_output(cmd, shell=True, cwd=dirpath)
@@ -102,14 +103,6 @@ extensions = ['IPython.sphinxext.ipython_console_highlighting',
'matplotlib.sphinxext.plot_directive',
'edit_on_github', # see https://gist.github.com/mgedmin/6052926#file-edit_on_github-pyb
# cloud's extensions
# 'cloud_sptheme.ext.autodoc_sections',
'cloud_sptheme.ext.index_styling',
'cloud_sptheme.ext.relbar_toc',
# 'cloud_sptheme.ext.escaped_samp_literals',
'cloud_sptheme.ext.issue_tracker',
# 'cloud_sptheme.ext.table_styling',
# 'inheritance_diagram',
# 'numpydoc',
# 'breathe'
@@ -206,33 +199,41 @@ try:
except:
print('unable to import cloud_sptheme as csp; try a "pip install cloud_sptheme"')
# import Cloud
import cloud_sptheme as csp
# ... some contents omitted ...
# set the html theme
html_theme = "cloud"
# NOTE: there is also a red-colored version named "redcloud"
# ... some contents omitted ...
# set the theme path to point to cloud's theme data
html_theme_path = [csp.get_theme_dir()]
# [optional] set some of the options listed above...
html_theme_options = {"roottarget": "index",
"max_width": "13in",
"logotarget": "index",
"googleanalytics_id": "UA-53205480-2",
"default_layout_text_size": "85%",
"table_style_default_align": "left"
}
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"navbar_center": ["navbar-center.html"],
}
edit_on_github_project = 'CoolProp/CoolProp'
edit_on_github_branch = 'master'
edit_on_github_path_prefix = 'Web'
# import Cloud
# import cloud_sptheme as csp
# #html_theme = "cloud"
# # NOTE: there is also a red-colored version named "redcloud"
# # ... some contents omitted ...
# # set the theme path to point to cloud's theme data
# html_theme_path = [csp.get_theme_dir()]
# # [optional] set some of the options listed above...
# html_theme_options = {"roottarget": "index",
# "max_width": "13in",
# "logotarget": "index",
# "googleanalytics_id": "UA-53205480-2",
# "default_layout_text_size": "85%",
# "table_style_default_align": "left"
# }
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
## html_theme = 'sphinxdoc'