Skip to content

Commit dacecce

Browse files
authored
Add new theme and fix doc building CI (#64)
* use new MDA theme (fix #64 ) * change docs build dir (fix #66 ) * add RTD configuration (fix #65 )
1 parent c550a46 commit dacecce

7 files changed

Lines changed: 54 additions & 242 deletions

File tree

.github/workflows/docs.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,39 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
2020

2121
- name: Setup python
22-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v4
2323
with:
2424
python-version: 3.9
2525

2626
- name: Display Python version
2727
run: python -c "import sys; print(sys.version)"
2828

29-
- name: Install sphinx, pytest, pytest plugins
29+
- name: Install deps
3030
run: |
31-
python -m pip install wheel
32-
python -m pip install pytest pytest-cov pytest-pep8 pytest-mock codecov
33-
python -m pip install sphinx sphinx-sitemap sphinx-rtd-theme
31+
python -m pip install "mdanalysis-sphinx-theme>=1.0.1" sphinx-sitemap
3432
3533
- name: Install main dependencies
3634
run: |
37-
python -m pip install six setuptools tqdm
35+
python -m pip install tqdm
3836
3937
- name: install package
4038
run: |
4139
pip install -v .
4240
4341
- name: build docs
4442
run: |
45-
python setup.py build_sphinx
43+
cd docs
44+
make html
4645
4746
- name: deploy docs
4847
uses: peaceiris/actions-gh-pages@v3
4948
with:
5049
github_token: ${{ secrets.GITHUB_TOKEN }}
51-
publish_dir: ./build/sphinx/html
50+
publish_dir: ./docs/_build/html
5251
user_name: 'github-actions'
5352
user_email: 'github-action@users.noreply.github.com'

.readthedocs.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Build documentation in with Sphinx
9+
sphinx:
10+
configuration: docs/conf.py
11+
12+
# Set the version of Python and other tools you might need
13+
build:
14+
os: ubuntu-22.04
15+
tools:
16+
python: "mambaforge-4.10"
17+
18+
# install the repo
19+
python:
20+
install:
21+
- method: setuptools
22+
path: .
23+
24+
# Optionally set the version of Python and requirements required to build your docs
25+
conda:
26+
environment: environment.yaml

docs/_static/custom.css

Lines changed: 0 additions & 206 deletions
This file was deleted.
-8.62 KB
Binary file not shown.
-4.44 KB
Binary file not shown.

docs/conf.py

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import sys, os
1515
import datetime
1616

17-
import sphinx_rtd_theme
18-
1917
# If extensions (or modules to document with autodoc) are in another directory,
2018
# add these directories to sys.path here. If the directory is relative to the
2119
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -39,8 +37,7 @@
3937
'sphinx.ext.mathjax', 'sphinx.ext.viewcode',
4038
'sphinx.ext.napoleon', 'sphinx.ext.todo',
4139
'sphinx.ext.autosummary',
42-
'sphinx_sitemap',
43-
'sphinx_rtd_theme']
40+
'sphinx_sitemap']
4441

4542
mathjax_path = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
4643

@@ -123,11 +120,9 @@
123120
# The theme to use for HTML and HTML Help pages. See the documentation for
124121
# a list of builtin themes.
125122

126-
html_theme = 'sphinx_rtd_theme'
123+
html_theme = 'mdanalysis_sphinx_theme'
127124

128-
html_theme_path = [
129-
sphinx_rtd_theme.get_html_theme_path()
130-
]
125+
# html_theme_path = []
131126

132127
# Theme options are theme-specific and customize the look and feel of a theme
133128
# further. For a list of options available for each theme, see the
@@ -141,20 +136,7 @@
141136
# /* MDAnalysis white: #FFFFFF */
142137
# /* MDAnalysis black: #000000 */
143138

144-
html_theme_options = {
145-
'canonical_url': '',
146-
'logo_only': True,
147-
'display_version': True,
148-
'prev_next_buttons_location': 'bottom',
149-
'style_external_links': False,
150-
'style_nav_header_background': 'white',
151-
# Toc options
152-
'collapse_navigation': True,
153-
'sticky_navigation': True,
154-
'navigation_depth': 4,
155-
'includehidden': True,
156-
'titles_only': False,
157-
}
139+
html_theme_options = {"mda_official": True}
158140

159141

160142
# options common to RTD and MDAnalysis theme
@@ -164,7 +146,7 @@
164146
# so a file named "default.css" will overwrite the builtin "default.css".
165147
# For RTD theme: custom.css to override theme defaults.
166148
html_static_path = ['_static']
167-
html_css_files = ['custom.css']
149+
# html_css_files = []
168150

169151

170152
# The name of an image file (relative to this directory) to place at the top
@@ -174,7 +156,7 @@
174156
# The name of an image file (within the static path) to use as favicon of the
175157
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
176158
# pixels large.
177-
html_favicon = "_static/logos/mdanalysis-logo.ico"
159+
# html_favicon = "_static/logos/mdanalysis-logo.ico"
178160

179161

180162
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
@@ -305,6 +287,7 @@
305287

306288
# Configuration for intersphinx: refer to the Python standard library
307289
# and other packages used by MDAnalysis
308-
intersphinx_mapping = {'https://docs.python.org/': None,
309-
'https://docs.mdanalysis.org/stable': None,
310-
}
290+
intersphinx_mapping = {
291+
"python": ('https://docs.python.org/3/', None),
292+
"mdanalysis": ('https://docs.mdanalysis.org/stable', None),
293+
}

environment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: mdanalysisdata
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- tqdm
7+
- pip
8+
- mdanalysis-sphinx-theme >=1.0.1
9+
- pip:
10+
- sphinx-sitemap

0 commit comments

Comments
 (0)