Skip to content

Commit 7c7495d

Browse files
committed
fix: remove nbsphinx_link dependency
1 parent 145f7f7 commit 7c7495d

File tree

8 files changed

+18
-25
lines changed

8 files changed

+18
-25
lines changed

docs/source/conf.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import time
1818
from importlib.metadata import version
1919
from pathlib import Path
20+
import shutil
2021

2122
# Attempt to import the version dynamically from GitHub tag.
2223
try:
@@ -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.
@@ -50,8 +60,7 @@
5060
"sphinx.ext.intersphinx",
5161
"sphinx_copybutton",
5262
"nbsphinx",
53-
"nbsphinx_link",
54-
"m2r2",
63+
"m2r",
5564
]
5665

5766
# Add any paths that contain templates here, relative to this directory.
@@ -63,7 +72,7 @@
6372
source_suffix = [".rst", ".md"]
6473

6574
# The encoding of source files.
66-
# source_encoding = 'utf-8-sig'
75+
# source_encoding = eutf-8-sig'
6776

6877
# The master toctree document.
6978
master_doc = "index"

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ sphinx
22
pydata-sphinx-theme
33
sphinx-copybutton
44
nbsphinx
5-
nbsphinx-link
65
doctr
76
m2r
7+
ipykernel

0 commit comments

Comments
 (0)