<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <id>https://blog.readthedocs.com</id>
  <title>Read the Docs Blog - Posts tagged jupyter</title>
  <updated>2023-07-08T10:50:30.266533+00:00</updated>
  <link href="https://blog.readthedocs.com"/>
  <link href="https://blog.readthedocs.com/archive/tag/jupyter/atom.xml" rel="self"/>
  <generator uri="https://ablog.readthedocs.org/" version="0.10.26">ABlog</generator>
  <entry>
    <id>https://blog.readthedocs.com/jupyter-book-read-the-docs/</id>
    <title>Read the Docs ❤️ Jupyter Book</title>
    <updated>2021-11-11T00:00:00+00:00</updated>
    <author>
      <name>Juan Luis Cano Rodríguez</name>
    </author>
    <content type="html">&lt;section id="read-the-docs-jupyter-book"&gt;

&lt;p&gt;We are proud to announce that now Jupyter Book projects are supported on Read the Docs!&lt;/p&gt;
&lt;p&gt;Both Read the Docs and The Executable Book Project, the folks behind Jupyter Book,
share a common passion for documentation,
and we have been collaborating on various topics for some time already.
For example, we started promoting MyST in favor of our recommonmark
&lt;a class="reference internal" href="../../../newsletter-april-2021/"&gt;&lt;span class="doc"&gt;back in April this year&lt;/span&gt;&lt;/a&gt;,
and we wrote a guide on &lt;a class="reference external" href="https://docs.readthedocs.io/en/stable/guides/jupyter.html" title="(in Read the Docs user documentation v9.15.0)"&gt;&lt;span class="xref std std-doc"&gt;using Jupyter notebook with Sphinx&lt;/span&gt;&lt;/a&gt;
that benefitted a lot from their feedback.&lt;/p&gt;
&lt;p&gt;Now we are happy to announce that Jupyter Book itself is supported on Read the Docs,
after some thorough discussion about the possible implementations
and thanks in large part to the Jupyter Book developers,
who addressed all the minor incompatibilities that prevented this from happening.&lt;/p&gt;
&lt;section id="what-is-jupyter-book"&gt;
&lt;h2&gt;What is Jupyter Book?&lt;/h2&gt;
&lt;p&gt;According to &lt;a class="reference external" href="https://jupyterbook.org/"&gt;its own documentation&lt;/a&gt;,&lt;/p&gt;
&lt;blockquote&gt;
&lt;div&gt;&lt;p&gt;Jupyter Book is an open source project for building beautiful,
publication-quality books and documents from computational material.&lt;/p&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Jupyter Book is the flagship product of &lt;a class="reference external" href="https://executablebooks.org/"&gt;the Executable Book Project&lt;/a&gt;,
an international collaboration between several universities and software projects
seeking to build open source tools
that facilitate publishing computational narratives
using the Jupyter ecosystem.&lt;/p&gt;
&lt;p&gt;Even though Jupyter Book is much younger than Read the Docs as a project,
it has become very popular in recent times
among scientific software developers and educators.
It enables users to
write publication-quality content in Markdown thanks to &lt;a class="reference external" href="https://myst-parser.readthedocs.io/"&gt;MyST&lt;/a&gt;
(a Markdown dialect compatible with Sphinx
&lt;a class="reference internal" href="../../../newsletter-april-2021/"&gt;&lt;span class="doc"&gt;we started promoting back in April this year&lt;/span&gt;&lt;/a&gt;),
use Jupyter notebooks to author content thanks to &lt;a class="reference external" href="https://myst-nb.readthedocs.io/"&gt;MyST-NB&lt;/a&gt;
(featured in our &lt;a class="reference external" href="https://docs.readthedocs.io/en/stable/guides/jupyter.html" title="(in Read the Docs user documentation v9.15.0)"&gt;&lt;span class="xref std std-doc"&gt;Jupyter on Sphinx guide&lt;/span&gt;&lt;/a&gt;),
easily add interactivity thanks to &lt;a class="reference external" href="https://thebe.readthedocs.io"&gt;Thebe&lt;/a&gt;,
and much more.&lt;/p&gt;
&lt;/section&gt;
&lt;section id="why-a-change-was-needed"&gt;
&lt;h2&gt;Why a change was needed&lt;/h2&gt;
&lt;p&gt;Read the Docs supports two documentation generation systems
&lt;a class="reference external" href="https://www.sphinx-doc.org/"&gt;Sphinx&lt;/a&gt; and &lt;a class="reference external" href="https://www.mkdocs.org/"&gt;MkDocs&lt;/a&gt;.
Adding extra systems is difficult with the current codebase,
because it requires lots of effort to match all the features
currently supported by the existing ones.&lt;/p&gt;
&lt;p&gt;On the other hand, even though &lt;a class="reference external" href="https://jupyterbook.org/explain/sphinx.html#jupyter-book-is-a-distribution-of-sphinx"&gt;Jupyter Book leverages Sphinx “for almost everything that it
does”&lt;/a&gt;,
it purposefully hides some of the Sphinx implementation details from the user
to create a more user friendly experience.
One of the consequences of this is that
the assumptions that Read the Docs makes to build the documentation of Sphinx projects don’t hold:
in particular, Jupyter Book uses a declarative configuration file &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;_config.yml&lt;/span&gt;&lt;/code&gt;
that gets translated on the fly to the Sphinx dynamic configuration usually stored in &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;conf.py&lt;/span&gt;&lt;/code&gt;.
As a result, Jupyter Book projects could not be hosted on Read the Docs - until now!&lt;/p&gt;
&lt;/section&gt;
&lt;section id="how-to-deploy-a-jupyter-book-project-to-read-the-docs"&gt;
&lt;h2&gt;How to deploy a Jupyter Book project to Read the Docs&lt;/h2&gt;
&lt;p&gt;With the current development version of Jupyter Book,
you can now export a Sphinx &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;conf.py&lt;/span&gt;&lt;/code&gt; configuration
from the Jupyter Book declarative &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;_config.yml&lt;/span&gt;&lt;/code&gt;
and save it to disk,
which allows Read the Docs to build the documentation from it
like any other Sphinx project.&lt;/p&gt;
&lt;p&gt;The challenge then becomes keeping both configuration files synchronized,
since every update to &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;_config.yml&lt;/span&gt;&lt;/code&gt; or new Jupyter Book release
can potentially produce changes in the &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;conf.py&lt;/span&gt;&lt;/code&gt;.
As described in &lt;a class="reference external" href="https://jupyterbook.org/en/stable/publish/readthedocs.html" title="(in Python)"&gt;&lt;span class="xref std std-doc"&gt;the official documentation&lt;/span&gt;&lt;/a&gt;,
users can either &lt;a class="reference external" href="https://jupyterbook.org/en/stable/sphinx/index.html#sphinx-convert" title="(in Python)"&gt;&lt;span class="xref std std-ref"&gt;manually export the configuration&lt;/span&gt;&lt;/a&gt;
running a command at will,
or set up an automation to do it on every change.&lt;/p&gt;
&lt;div class="admonition note"&gt;
&lt;p class="admonition-title"&gt;Note&lt;/p&gt;
&lt;p&gt;Update April 4th, 2022&lt;/p&gt;
&lt;p&gt;This process is now simplified by using Read the Docs’ &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;build.jobs.pre_build&lt;/span&gt;&lt;/code&gt; config
key and does not requires having the &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;conf.py&lt;/span&gt;&lt;/code&gt; in sync with &lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;_config.yml&lt;/span&gt;&lt;/code&gt; and pushed to the repository anymore.
Check out Jupyter’s &lt;a class="reference external" href="https://jupyterbook.org/en/stable/publish/readthedocs.html" title="(in Python)"&gt;&lt;span class="xref std std-doc"&gt;official documentation&lt;/span&gt;&lt;/a&gt; to find out the configuration required.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;To see this in action, have a look at
&lt;a class="reference external" href="https://github.com/astrojuanlu/jupyterbook-on-read-the-docs"&gt;this example project&lt;/a&gt;
that contains the bare minimum to make &lt;a class="reference external" href="https://jupyterbook.org/en/stable/start/create.html" title="(in Python)"&gt;&lt;span class="xref std std-doc"&gt;the demo book&lt;/span&gt;&lt;/a&gt;
work on Read the Docs.&lt;/p&gt;
&lt;p&gt;We are excited that this is now possible
and look forward to seeing more projects built with Jupyter Book!&lt;/p&gt;
&lt;p&gt;—&lt;/p&gt;
&lt;p&gt;Considering using Read the Docs for your next Sphinx or MkDocs project?
Check out &lt;a class="reference external" href="https://docs.readthedocs.io/"&gt;our documentation&lt;/a&gt; to get started!&lt;/p&gt;
&lt;/section&gt;
&lt;/section&gt;
</content>
    <link href="https://blog.readthedocs.com/jupyter-book-read-the-docs/" rel="alternate"/>
    <summary>We are proud to announce that now Jupyter Book projects are supported on Read the Docs!Both Read the Docs and The Executable Book Project, the folks behind Jupyter Book,
share a common passion for documentation,
and we have been collaborating on various topics for some time already.
For example, we started promoting MyST in favor of our recommonmark
back in April this year,
and we wrote a guide on using Jupyter notebook with Sphinx
that benefitted a lot from their feedback.</summary>
    <category term="feature" label="feature"/>
    <category term="jupyter" label="jupyter"/>
    <published>2021-11-11T00:00:00+00:00</published>
  </entry>
</feed>
