question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to utilize local Sphinx extensions in Jupyter Book?

See original GitHub issue

Hey all,

Sphinx has a great tutorial on developing extensions. Of note, it explains, by way of conf.py, how to utilize a local Sphinx extension (i.e. one not available on PyPI):

import os
import sys

sys.path.append(os.path.abspath("./_ext"))

extensions = ['helloworld']

Of course, one can do the latter part of appending an extension to the extension list in Jupyter Book. Your documentation explains that one should modify _config.yml like so:

sphinx:
  extra_extensions:
   - extension1
   - extension2

However, the important part — adding the local extension’s path — is impossible via _config.yml alone.

How would I go about using local Sphinx extensions as part of the Jupyter Book build process?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
hashslingrzcommented, Nov 16, 2020

Huh, well I’ll be darned, nice job @mmcky! Your PR works just fine for my local extension. Bang up job 😄

I also like your syntax choice more than my previous suggestion. 👍

1reaction
mmckycommented, Nov 16, 2020

@choldgraf @hashslingrz I have added support for local_extensions in PR #1102. Let me know what you think re: syntax and then I can finalise with a test case etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Jupyter Book and Sphinx relate to one another
These extensions grow Sphinx's capabilities so that it can handle the use-cases of Jupyter Book. An example: MyST Markdown. Let's take the case...
Read more >
Jupyter Notebook Tools for Sphinx — nbsphinx version 0.8.10
Install nbsphinx · Edit your conf.py and add 'nbsphinx' to extensions . · Edit your index.rst and add the names of your *.ipynb...
Read more >
nbsphinx - Read the Docs
nbsphinx is a Sphinx1 extension that provides a source parser for ... URL or local path to override the default URL for Jupyter...
Read more >
August 2021 – OUseful.Info, the blog…
At the heart of my local Jupyter Book deployment, I see the Jupyter ... or Jupyter notebooks using the Sphinx document processing toolchain....
Read more >
How do I reference a relative path in Jupyter-book
@NicoBako. No. What I did was add code in the config file to copy over the notebooks into my Sphinx folder; as part...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found