Skip to content

Commit 20799ab

Browse files
authored
Merge pull request #67 from zmx27/remove-nbsphinx-link-and-use-pydata
chore: remove nbsphinx link and use the pydata theme to render our documentation
2 parents 7974c7a + e5acfbd commit 20799ab

File tree

8 files changed

+39
-27
lines changed

8 files changed

+39
-27
lines changed

docs/source/conf.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
1515

16+
import shutil
1617
import sys
1718
import time
1819
from importlib.metadata import version
@@ -34,6 +35,15 @@
3435
# abbreviations
3536
ab_authors = "Billinge Group members"
3637

38+
# Include notebooks at build time.
39+
root_dir = Path(__file__).resolve().parents[1]
40+
external_nb_dir = root_dir / "examples"
41+
for f in external_nb_dir.glob("*.ipynb"):
42+
dest = Path(__file__).parent / "examples" / f.name
43+
if dest.exists():
44+
dest.unlink()
45+
shutil.copy(f, dest)
46+
3747
# -- General configuration ------------------------------------------------
3848

3949
# If your documentation needs a minimal Sphinx version, state it here.
@@ -48,10 +58,8 @@
4858
"sphinx.ext.todo",
4959
"sphinx.ext.viewcode",
5060
"sphinx.ext.intersphinx",
51-
"sphinx_rtd_theme",
5261
"sphinx_copybutton",
5362
"nbsphinx",
54-
"nbsphinx_link",
5563
"m2r",
5664
]
5765

@@ -134,7 +142,8 @@
134142
# The theme to use for HTML and HTML Help pages. See the documentation for
135143
# a list of builtin themes.
136144
#
137-
html_theme = "sphinx_rtd_theme"
145+
# html_theme = "sphinx_rtd_theme"
146+
html_theme = "pydata_sphinx_theme"
138147

139148
html_context = {
140149
"display_github": True,
@@ -149,7 +158,25 @@
149158
# documentation.
150159
#
151160
html_theme_options = {
152-
"navigation_with_keys": "true",
161+
"show_nav_level": 2,
162+
"navigation_depth": 2,
163+
"navbar_align": "left",
164+
"icon_links": [
165+
{
166+
"name": "GitHub",
167+
"url": "https://github.com/diffpy/pyobjcryst",
168+
"icon": "fab fa-github",
169+
},
170+
],
171+
# "primary_sidebar_end": ["indices.html", "sidebar-ethical-ads.html"]
172+
}
173+
174+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
175+
html_sidebars = {
176+
"**": ["globaltoc.html", "sidebar-nav-bs"],
177+
# "**": ["localtoc.html"],
178+
# "**": ["sidebar-nav-bs"],
179+
# "<page_pattern>": ["index", "manual-intro", "tutorials", "manual"]
153180
}
154181

155182
# Add any paths that contain custom themes here, relative to this directory.

docs/source/examples/Quantitative-phase-analysis.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/source/examples/crystal_3d_widget.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/source/examples/examples.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ Example notebooks
44

55
Several examples available in the pyobjcryst repository:
66

7-
87
:doc:`3D Crystal structure display <crystal_3d_widget>`
9-
=======================================================
8+
================================================================
109

1110
Example of importing a CIF file from a file or the
1211
`Crystallography Open Database <http://crystallography.net/cod/>`_
1312
and displaying it in a widget using
1413
`3dmol.js <https://3dmol.csb.pitt.edu/>`_.
1514

1615
:doc:`Solving the cimetidine structure from its powder pattern <structure-solution-powder-cimetidine>`
17-
======================================================================================================
16+
===============================================================================================================
1817

1918
In this example, a powder pattern is used to solve the crystal
2019
structure of Cimetidine. This covers all the steps: loading the
@@ -23,7 +22,7 @@ the spacegroup, profile fitting, and solving the structure
2322
using a global optimisation algorithm.
2423

2524
:doc:`Solving the PbSO4 structure from its X and N powder patterns <structure-solution-powder-pbso4>`
26-
=====================================================================================================
25+
==============================================================================================================
2726

2827
In this example, two powder patterns (X-ray and neutron) are used to solve
2928
the crystal structure of PbSO4. This covers all the steps: loading the
@@ -32,14 +31,14 @@ the spacegroup, profile fitting for the two patterns, and solving the
3231
structure using a global optimisation algorithm.
3332

3433
:doc:`Meta-structure solution using multi-processing <structure-solution-multiprocessing>`
35-
==========================================================================================
34+
===================================================================================================
3635

3736
This is a more advanced example where 8 different spacegroups are
3837
tested in parallel to determine which one is correct. The solutions
3938
can then be compared and displayed individually.
4039

4140
:doc:`Quantitative phase analysis (QPA) <Quantitative-phase-analysis>`
42-
======================================================================
41+
===============================================================================
4342

4443
Example of QPA based on the data available from the `1999 Round Robin
4544
<https://www.iucr.org/__data/iucr/powder/QARR/samples.htm>`_,

docs/source/examples/structure-solution-multiprocessing.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/source/examples/structure-solution-powder-cimetidine.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/source/examples/structure-solution-powder-pbso4.nblink

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements/docs.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
sphinx
2-
sphinx_rtd_theme
2+
pydata-sphinx-theme
33
sphinx-copybutton
44
nbsphinx
5-
nbsphinx-link
65
doctr
76
m2r
7+
ipykernel
8+
lxml-html-clean

0 commit comments

Comments
 (0)