diff --git a/PKG-INFO b/PKG-INFO
index 56b6aba..5ba9e13 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,193 +1,13 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: nb2plots
-Version: 0.6
+Version: 0+unknown
 Summary: Converting between ipython notebooks and sphinx docs
 Home-page: http://github.com/matthew-brett/nb2plots
 Author: Matthew Brett
 Author-email: matthew.brett@gmail.com
+Maintainer: Matthew Brett
+Maintainer-email: matthew.brett@gmail.com
 License: BSD license
-Description-Content-Type: UNKNOWN
-Description: ##################################################
-        nb2plots - converting between notebooks and sphinx
-        ##################################################
-        
-        See the nb2plots documentation_ for more information.
-        
-        .. shared-text-body
-        
-        ************
-        What it does
-        ************
-        
-        ``nb2plots`` converts Jupyter_ notebooks to ReST_ files for Sphinx_, and back
-        again.
-        
-        Nb2plots assumes that the ReST document will become the source for your Sphinx
-        web pages, but also for future versions of the notebook.  The notebook may
-        serve as a draft for the polished ReST page, and an output format from the
-        Sphinx build.  Why? Read on.
-        
-        ****************************************
-        Why convert Jupyter notebooks to Sphinx?
-        ****************************************
-        
-        Jupyter notebooks are just what the doctor ordered when hacking up a quick
-        tutorial, or preparing a software demo.  The problems start when you want to
-        do not-trivial edits to the notebooks, or you need features that notebooks
-        don't have, such as flexible cross-referencing, extensible markup, and so on.
-        Notebooks are also painful to use with version control.  These times make you
-        wish your notebook was in a standard extensible text format, such as ReST_.
-        
-        You could convert your notebook to ReST using the standard `nbconvert`_
-        command, but this gives rather ugly ReST, and you lose all the nice code
-        execution and figure generation that the notebook is good at.
-        
-        Enter Nb2plots.  The ``nb2plots`` command converts notebooks to specially
-        formatted ReST pages. Use with::
-        
-            nb2plots notebook.ipynb > with_plots.rst
-        
-        Nb2plots converts your notebook to not-very-ugly ReST, where the code cells
-        become ``nbplot`` directives in your ReST file.
-        
-        Specifically, a notebook code cell like this::
-        
-            a = 1
-        
-        becomes (in the ReST document)::
-        
-            .. nbplot::
-        
-                >>> a = 1
-        
-        The ``nbplot`` directives run the contained code when Sphinx builds your ReST
-        files, and embed the results of any plots that your code makes.  Actually,
-        ``nbplot`` is an extended and edited version of the `matplotlib plot
-        directive`_.  Building your pages runs all the code and regenerates the
-        figures, and you get much of the reproducible goodness of the notebook
-        experience.
-        
-        You can also run the standard Sphinx ``doctest`` extension over your pages to
-        check the doctest output of the code cells.
-        
-        The ReST version of your notebook has many advantages - it is easier to edit
-        in your favorite text editor, and you can extend and configure the execution
-        and display of the code in several different ways.  For example, you can hide
-        some code cells (Nbplot directives) if the code is not interesting to your
-        point, but you still want the generated figure.  You can configure your Nbplot
-        directives to run different code for different configurations.  For these
-        options, see |nbplot-documentation|.  But - what do you lose, when going from
-        a notebook to a Nb2plots ReST document?
-        
-        **********************************
-        I want notebooks and .py files too
-        **********************************
-        
-        You may also want a version of your document that your users can execute.
-        Perhaps the page build is generating some tricky errors or warnings, and you
-        want to experiment with the code in the page interactively.  Perhaps your
-        users are used to notebooks, and prefer the code in that format.
-        
-        Nb2plots also contains Sphinx extensions that cause the Sphinx build to
-        generate Python code files and Jupyter notebooks from the ReST source.  When
-        you add the Nb2plots ReST directive ``code-links`` to your ReST page, it will
-        cause the Sphinx build to create a Python code file and notebook versions of
-        your page, and adds download links to these versions::
-        
-            .. code-links::
-        
-        See |code-links-documentation| for details.
-        
-        **************************
-        Show me what it looks like
-        **************************
-        
-        For a very simple example, see |worked-example|.
-        
-        For a moderate-sized teaching site that makes extensive use of Nb2plots, see
-        https://matthew-brett.github.com/teaching.
-        
-        ************
-        Installation
-        ************
-        
-        ::
-        
-            pip install nb2plots
-        
-        You will need Pandoc_ installed and available as the ``pandoc`` command.
-        
-        To install Pandoc on OSX, we recommend homebrew_::
-        
-            brew install pandoc
-        
-        *************
-        Configuration
-        *************
-        
-        Add the following to your Sphinx ``conf.py`` file::
-        
-            extensions = ["nb2plots"]
-        
-        See |nbplot-documentation| for the various ``conf.py`` configuration settings.
-        
-        ****
-        Code
-        ****
-        
-        See https://github.com/matthew-brett/nb2plots
-        
-        Released under the BSD two-clause license - see the file ``LICENSE`` in the
-        source distribution.
-        
-        `travis-ci <https://travis-ci.org/matthew-brett/nb2plots>`_ kindly tests the
-        code automatically under Python versions 2.7, and 3.3 through 3.5.
-        
-        The latest released version is at https://pypi.python.org/pypi/nb2plots
-        
-        *****
-        Tests
-        *****
-        
-        * Install ``nb2plots``
-        * Install the pytest_ testing framework, the ``mock`` package, and the
-          ``scripttester`` package.
-        
-            pip install pytest mock scripttester
-        
-        * Run the tests with::
-        
-            py.test --pyargs nb2plots
-        
-        *******
-        Support
-        *******
-        
-        Please put up issues on the `nb2plots issue tracker`_.
-        
-        .. standalone-references
-        
-        .. |nbplot-documentation| replace:: `nbplots documentation`_
-        .. |worked-example| replace:: `worked example`_
-        .. |code-links-documentation| replace:: `code-links documentation`_
-        .. _nbplots documentation:
-            https://matthew-brett.github.com/nb2plots/nbplots.html
-        .. _code-links documentation:
-            https://matthew-brett.github.com/nb2plots/code_links.html
-        .. _worked example:
-            https://matthew-brett.github.com/nb2plots/worked_example.html
-        .. _documentation: https://matthew-brett.github.com/nb2plots
-        .. _pandoc: http://pandoc.org
-        .. _jupyter: jupyter.org
-        .. _homebrew: brew.sh
-        .. _sphinx: http://sphinx-doc.org
-        .. _rest: http://docutils.sourceforge.net/rst.html
-        .. _nb2plots issue tracker: https://github.com/matthew-brett/nb2plots/issues
-        .. _matplotlib plot directive: http://matplotlib.org/sampledoc/extensions.html
-        .. _nbconvert: http://nbconvert.readthedocs.org/en/latest/
-        .. _pytest: https://pytest.readthedocs.io
-        .. _mock: https://github.com/testing-cabal/mock
-        
 Platform: UNKNOWN
 Classifier: Development Status :: 2 - Pre-Alpha
 Classifier: Environment :: Console
@@ -201,3 +21,188 @@ Classifier: Operating System :: Microsoft :: Windows
 Classifier: Operating System :: POSIX
 Classifier: Operating System :: Unix
 Classifier: Operating System :: MacOS
+Provides-Extra: test
+License-File: LICENSE
+
+##################################################
+nb2plots - converting between notebooks and sphinx
+##################################################
+
+See the nb2plots documentation_ for more information.
+
+.. shared-text-body
+
+************
+What it does
+************
+
+``nb2plots`` converts Jupyter_ notebooks to ReST_ files for Sphinx_, and back
+again.
+
+Nb2plots assumes that the ReST document will become the source for your Sphinx
+web pages, but also for future versions of the notebook.  The notebook may
+serve as a draft for the polished ReST page, and an output format from the
+Sphinx build.  Why? Read on.
+
+****************************************
+Why convert Jupyter notebooks to Sphinx?
+****************************************
+
+Jupyter notebooks are just what the doctor ordered when hacking up a quick
+tutorial, or preparing a software demo.  The problems start when you want to
+do not-trivial edits to the notebooks, or you need features that notebooks
+don't have, such as flexible cross-referencing, extensible markup, and so on.
+Notebooks are also painful to use with version control.  These times make you
+wish your notebook was in a standard extensible text format, such as ReST_.
+
+You could convert your notebook to ReST using the standard `nbconvert`_
+command, but this gives rather ugly ReST, and you lose all the nice code
+execution and figure generation that the notebook is good at.
+
+Enter Nb2plots.  The ``nb2plots`` command converts notebooks to specially
+formatted ReST pages. Use with::
+
+    nb2plots notebook.ipynb > with_plots.rst
+
+Nb2plots converts your notebook to not-very-ugly ReST, where the code cells
+become ``nbplot`` directives in your ReST file.
+
+Specifically, a notebook code cell like this::
+
+    a = 1
+
+becomes (in the ReST document)::
+
+    .. nbplot::
+
+        >>> a = 1
+
+The ``nbplot`` directives run the contained code when Sphinx builds your ReST
+files, and embed the results of any plots that your code makes.  Actually,
+``nbplot`` is an extended and edited version of the `matplotlib plot
+directive`_.  Building your pages runs all the code and regenerates the
+figures, and you get much of the reproducible goodness of the notebook
+experience.
+
+You can also run the standard Sphinx ``doctest`` extension over your pages to
+check the doctest output of the code cells.
+
+The ReST version of your notebook has many advantages - it is easier to edit
+in your favorite text editor, and you can extend and configure the execution
+and display of the code in several different ways.  For example, you can hide
+some code cells (Nbplot directives) if the code is not interesting to your
+point, but you still want the generated figure.  You can configure your Nbplot
+directives to run different code for different configurations.  For these
+options, see |nbplot-documentation|.  But - what do you lose, when going from
+a notebook to a Nb2plots ReST document?
+
+**********************************
+I want notebooks and .py files too
+**********************************
+
+You may also want a version of your document that your users can execute.
+Perhaps the page build is generating some tricky errors or warnings, and you
+want to experiment with the code in the page interactively.  Perhaps your
+users are used to notebooks, and prefer the code in that format.
+
+Nb2plots also contains Sphinx extensions that cause the Sphinx build to
+generate Python code files and Jupyter notebooks from the ReST source.  When
+you add the Nb2plots ReST directive ``code-links`` to your ReST page, it will
+cause the Sphinx build to create a Python code file and notebook versions of
+your page, and adds download links to these versions::
+
+    .. code-links::
+
+See |code-links-documentation| for details.
+
+**************************
+Show me what it looks like
+**************************
+
+For a very simple example, see |worked-example|.
+
+For a moderate-sized teaching site that makes extensive use of Nb2plots, see
+https://matthew-brett.github.io/teaching.
+
+************
+Installation
+************
+
+::
+
+    pip install nb2plots
+
+You will need Pandoc_ installed and available as the ``pandoc`` command.
+
+To install Pandoc on OSX, we recommend homebrew_::
+
+    brew install pandoc
+
+*************
+Configuration
+*************
+
+Add the following to your Sphinx ``conf.py`` file::
+
+    extensions = ["nb2plots"]
+
+See |nbplot-documentation| for the various ``conf.py`` configuration settings.
+
+****
+Code
+****
+
+See https://github.com/matthew-brett/nb2plots
+
+Released under the BSD two-clause license - see the file ``LICENSE`` in the
+source distribution.
+
+`travis-ci <https://travis-ci.org/matthew-brett/nb2plots>`_ kindly tests the
+code automatically under Python versions 2.7, and 3.5 through 3.8.
+
+The latest released version is at https://pypi.python.org/pypi/nb2plots
+
+*****
+Tests
+*****
+
+* Install ``nb2plots``
+* Install the pytest_ testing framework, the ``mock`` package, and the
+  ``scripttester`` package.
+
+    pip install pytest mock scripttester
+
+* Run the tests with::
+
+    py.test --pyargs nb2plots
+
+*******
+Support
+*******
+
+Please put up issues on the `nb2plots issue tracker`_.
+
+.. standalone-references
+
+.. |nbplot-documentation| replace:: `nbplots documentation`_
+.. |worked-example| replace:: `worked example`_
+.. |code-links-documentation| replace:: `code-links documentation`_
+.. _nbplots documentation:
+    https://matthew-brett.github.io/nb2plots/nbplots.html
+.. _code-links documentation:
+    https://matthew-brett.github.io/nb2plots/code_links.html
+.. _worked example:
+    https://matthew-brett.github.io/nb2plots/worked_example.html
+.. _documentation: https://matthew-brett.github.io/nb2plots
+.. _pandoc: http://pandoc.org
+.. _jupyter: jupyter.org
+.. _homebrew: brew.sh
+.. _sphinx: http://sphinx-doc.org
+.. _rest: http://docutils.sourceforge.net/rst.html
+.. _nb2plots issue tracker: https://github.com/matthew-brett/nb2plots/issues
+.. _matplotlib plot directive: http://matplotlib.org/sampledoc/extensions.html
+.. _nbconvert: http://nbconvert.readthedocs.org/en/latest/
+.. _pytest: https://pytest.readthedocs.io
+.. _mock: https://github.com/testing-cabal/mock
+
+
diff --git a/README.rst b/README.rst
index 125b0a0..55023dd 100644
--- a/README.rst
+++ b/README.rst
@@ -96,7 +96,7 @@ Show me what it looks like
 For a very simple example, see |worked-example|.
 
 For a moderate-sized teaching site that makes extensive use of Nb2plots, see
-https://matthew-brett.github.com/teaching.
+https://matthew-brett.github.io/teaching.
 
 ************
 Installation
@@ -132,7 +132,7 @@ Released under the BSD two-clause license - see the file ``LICENSE`` in the
 source distribution.
 
 `travis-ci <https://travis-ci.org/matthew-brett/nb2plots>`_ kindly tests the
-code automatically under Python versions 2.7, and 3.3 through 3.5.
+code automatically under Python versions 2.7, and 3.5 through 3.8.
 
 The latest released version is at https://pypi.python.org/pypi/nb2plots
 
@@ -162,12 +162,12 @@ Please put up issues on the `nb2plots issue tracker`_.
 .. |worked-example| replace:: `worked example`_
 .. |code-links-documentation| replace:: `code-links documentation`_
 .. _nbplots documentation:
-    https://matthew-brett.github.com/nb2plots/nbplots.html
+    https://matthew-brett.github.io/nb2plots/nbplots.html
 .. _code-links documentation:
-    https://matthew-brett.github.com/nb2plots/code_links.html
+    https://matthew-brett.github.io/nb2plots/code_links.html
 .. _worked example:
-    https://matthew-brett.github.com/nb2plots/worked_example.html
-.. _documentation: https://matthew-brett.github.com/nb2plots
+    https://matthew-brett.github.io/nb2plots/worked_example.html
+.. _documentation: https://matthew-brett.github.io/nb2plots
 .. _pandoc: http://pandoc.org
 .. _jupyter: jupyter.org
 .. _homebrew: brew.sh
diff --git a/debian/changelog b/debian/changelog
index 3c061a5..2243047 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-nb2plots (0.6-3) UNRELEASED; urgency=medium
+nb2plots (0.6+git20220304.1.d61e6d5-1) UNRELEASED; urgency=medium
 
   [ Ondřej Nový ]
   * d/control: Update Vcs-* fields with new Debian Python Team Salsa
@@ -14,8 +14,9 @@ nb2plots (0.6-3) UNRELEASED; urgency=medium
   * Update standards version to 4.5.1, no changes needed.
   * Remove constraints unnecessary since buster:
     + Build-Depends: Drop versioned constraint on python3-six.
+  * New upstream snapshot.
 
- -- Sandro Tosi <morph@debian.org>  Mon, 04 Jan 2021 17:01:12 -0500
+ -- Sandro Tosi <morph@debian.org>  Sun, 17 Apr 2022 09:15:09 -0000
 
 nb2plots (0.6-2) unstable; urgency=medium
 
diff --git a/nb2plots.egg-info/PKG-INFO b/nb2plots.egg-info/PKG-INFO
index 56b6aba..5ba9e13 100644
--- a/nb2plots.egg-info/PKG-INFO
+++ b/nb2plots.egg-info/PKG-INFO
@@ -1,193 +1,13 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: nb2plots
-Version: 0.6
+Version: 0+unknown
 Summary: Converting between ipython notebooks and sphinx docs
 Home-page: http://github.com/matthew-brett/nb2plots
 Author: Matthew Brett
 Author-email: matthew.brett@gmail.com
+Maintainer: Matthew Brett
+Maintainer-email: matthew.brett@gmail.com
 License: BSD license
-Description-Content-Type: UNKNOWN
-Description: ##################################################
-        nb2plots - converting between notebooks and sphinx
-        ##################################################
-        
-        See the nb2plots documentation_ for more information.
-        
-        .. shared-text-body
-        
-        ************
-        What it does
-        ************
-        
-        ``nb2plots`` converts Jupyter_ notebooks to ReST_ files for Sphinx_, and back
-        again.
-        
-        Nb2plots assumes that the ReST document will become the source for your Sphinx
-        web pages, but also for future versions of the notebook.  The notebook may
-        serve as a draft for the polished ReST page, and an output format from the
-        Sphinx build.  Why? Read on.
-        
-        ****************************************
-        Why convert Jupyter notebooks to Sphinx?
-        ****************************************
-        
-        Jupyter notebooks are just what the doctor ordered when hacking up a quick
-        tutorial, or preparing a software demo.  The problems start when you want to
-        do not-trivial edits to the notebooks, or you need features that notebooks
-        don't have, such as flexible cross-referencing, extensible markup, and so on.
-        Notebooks are also painful to use with version control.  These times make you
-        wish your notebook was in a standard extensible text format, such as ReST_.
-        
-        You could convert your notebook to ReST using the standard `nbconvert`_
-        command, but this gives rather ugly ReST, and you lose all the nice code
-        execution and figure generation that the notebook is good at.
-        
-        Enter Nb2plots.  The ``nb2plots`` command converts notebooks to specially
-        formatted ReST pages. Use with::
-        
-            nb2plots notebook.ipynb > with_plots.rst
-        
-        Nb2plots converts your notebook to not-very-ugly ReST, where the code cells
-        become ``nbplot`` directives in your ReST file.
-        
-        Specifically, a notebook code cell like this::
-        
-            a = 1
-        
-        becomes (in the ReST document)::
-        
-            .. nbplot::
-        
-                >>> a = 1
-        
-        The ``nbplot`` directives run the contained code when Sphinx builds your ReST
-        files, and embed the results of any plots that your code makes.  Actually,
-        ``nbplot`` is an extended and edited version of the `matplotlib plot
-        directive`_.  Building your pages runs all the code and regenerates the
-        figures, and you get much of the reproducible goodness of the notebook
-        experience.
-        
-        You can also run the standard Sphinx ``doctest`` extension over your pages to
-        check the doctest output of the code cells.
-        
-        The ReST version of your notebook has many advantages - it is easier to edit
-        in your favorite text editor, and you can extend and configure the execution
-        and display of the code in several different ways.  For example, you can hide
-        some code cells (Nbplot directives) if the code is not interesting to your
-        point, but you still want the generated figure.  You can configure your Nbplot
-        directives to run different code for different configurations.  For these
-        options, see |nbplot-documentation|.  But - what do you lose, when going from
-        a notebook to a Nb2plots ReST document?
-        
-        **********************************
-        I want notebooks and .py files too
-        **********************************
-        
-        You may also want a version of your document that your users can execute.
-        Perhaps the page build is generating some tricky errors or warnings, and you
-        want to experiment with the code in the page interactively.  Perhaps your
-        users are used to notebooks, and prefer the code in that format.
-        
-        Nb2plots also contains Sphinx extensions that cause the Sphinx build to
-        generate Python code files and Jupyter notebooks from the ReST source.  When
-        you add the Nb2plots ReST directive ``code-links`` to your ReST page, it will
-        cause the Sphinx build to create a Python code file and notebook versions of
-        your page, and adds download links to these versions::
-        
-            .. code-links::
-        
-        See |code-links-documentation| for details.
-        
-        **************************
-        Show me what it looks like
-        **************************
-        
-        For a very simple example, see |worked-example|.
-        
-        For a moderate-sized teaching site that makes extensive use of Nb2plots, see
-        https://matthew-brett.github.com/teaching.
-        
-        ************
-        Installation
-        ************
-        
-        ::
-        
-            pip install nb2plots
-        
-        You will need Pandoc_ installed and available as the ``pandoc`` command.
-        
-        To install Pandoc on OSX, we recommend homebrew_::
-        
-            brew install pandoc
-        
-        *************
-        Configuration
-        *************
-        
-        Add the following to your Sphinx ``conf.py`` file::
-        
-            extensions = ["nb2plots"]
-        
-        See |nbplot-documentation| for the various ``conf.py`` configuration settings.
-        
-        ****
-        Code
-        ****
-        
-        See https://github.com/matthew-brett/nb2plots
-        
-        Released under the BSD two-clause license - see the file ``LICENSE`` in the
-        source distribution.
-        
-        `travis-ci <https://travis-ci.org/matthew-brett/nb2plots>`_ kindly tests the
-        code automatically under Python versions 2.7, and 3.3 through 3.5.
-        
-        The latest released version is at https://pypi.python.org/pypi/nb2plots
-        
-        *****
-        Tests
-        *****
-        
-        * Install ``nb2plots``
-        * Install the pytest_ testing framework, the ``mock`` package, and the
-          ``scripttester`` package.
-        
-            pip install pytest mock scripttester
-        
-        * Run the tests with::
-        
-            py.test --pyargs nb2plots
-        
-        *******
-        Support
-        *******
-        
-        Please put up issues on the `nb2plots issue tracker`_.
-        
-        .. standalone-references
-        
-        .. |nbplot-documentation| replace:: `nbplots documentation`_
-        .. |worked-example| replace:: `worked example`_
-        .. |code-links-documentation| replace:: `code-links documentation`_
-        .. _nbplots documentation:
-            https://matthew-brett.github.com/nb2plots/nbplots.html
-        .. _code-links documentation:
-            https://matthew-brett.github.com/nb2plots/code_links.html
-        .. _worked example:
-            https://matthew-brett.github.com/nb2plots/worked_example.html
-        .. _documentation: https://matthew-brett.github.com/nb2plots
-        .. _pandoc: http://pandoc.org
-        .. _jupyter: jupyter.org
-        .. _homebrew: brew.sh
-        .. _sphinx: http://sphinx-doc.org
-        .. _rest: http://docutils.sourceforge.net/rst.html
-        .. _nb2plots issue tracker: https://github.com/matthew-brett/nb2plots/issues
-        .. _matplotlib plot directive: http://matplotlib.org/sampledoc/extensions.html
-        .. _nbconvert: http://nbconvert.readthedocs.org/en/latest/
-        .. _pytest: https://pytest.readthedocs.io
-        .. _mock: https://github.com/testing-cabal/mock
-        
 Platform: UNKNOWN
 Classifier: Development Status :: 2 - Pre-Alpha
 Classifier: Environment :: Console
@@ -201,3 +21,188 @@ Classifier: Operating System :: Microsoft :: Windows
 Classifier: Operating System :: POSIX
 Classifier: Operating System :: Unix
 Classifier: Operating System :: MacOS
+Provides-Extra: test
+License-File: LICENSE
+
+##################################################
+nb2plots - converting between notebooks and sphinx
+##################################################
+
+See the nb2plots documentation_ for more information.
+
+.. shared-text-body
+
+************
+What it does
+************
+
+``nb2plots`` converts Jupyter_ notebooks to ReST_ files for Sphinx_, and back
+again.
+
+Nb2plots assumes that the ReST document will become the source for your Sphinx
+web pages, but also for future versions of the notebook.  The notebook may
+serve as a draft for the polished ReST page, and an output format from the
+Sphinx build.  Why? Read on.
+
+****************************************
+Why convert Jupyter notebooks to Sphinx?
+****************************************
+
+Jupyter notebooks are just what the doctor ordered when hacking up a quick
+tutorial, or preparing a software demo.  The problems start when you want to
+do not-trivial edits to the notebooks, or you need features that notebooks
+don't have, such as flexible cross-referencing, extensible markup, and so on.
+Notebooks are also painful to use with version control.  These times make you
+wish your notebook was in a standard extensible text format, such as ReST_.
+
+You could convert your notebook to ReST using the standard `nbconvert`_
+command, but this gives rather ugly ReST, and you lose all the nice code
+execution and figure generation that the notebook is good at.
+
+Enter Nb2plots.  The ``nb2plots`` command converts notebooks to specially
+formatted ReST pages. Use with::
+
+    nb2plots notebook.ipynb > with_plots.rst
+
+Nb2plots converts your notebook to not-very-ugly ReST, where the code cells
+become ``nbplot`` directives in your ReST file.
+
+Specifically, a notebook code cell like this::
+
+    a = 1
+
+becomes (in the ReST document)::
+
+    .. nbplot::
+
+        >>> a = 1
+
+The ``nbplot`` directives run the contained code when Sphinx builds your ReST
+files, and embed the results of any plots that your code makes.  Actually,
+``nbplot`` is an extended and edited version of the `matplotlib plot
+directive`_.  Building your pages runs all the code and regenerates the
+figures, and you get much of the reproducible goodness of the notebook
+experience.
+
+You can also run the standard Sphinx ``doctest`` extension over your pages to
+check the doctest output of the code cells.
+
+The ReST version of your notebook has many advantages - it is easier to edit
+in your favorite text editor, and you can extend and configure the execution
+and display of the code in several different ways.  For example, you can hide
+some code cells (Nbplot directives) if the code is not interesting to your
+point, but you still want the generated figure.  You can configure your Nbplot
+directives to run different code for different configurations.  For these
+options, see |nbplot-documentation|.  But - what do you lose, when going from
+a notebook to a Nb2plots ReST document?
+
+**********************************
+I want notebooks and .py files too
+**********************************
+
+You may also want a version of your document that your users can execute.
+Perhaps the page build is generating some tricky errors or warnings, and you
+want to experiment with the code in the page interactively.  Perhaps your
+users are used to notebooks, and prefer the code in that format.
+
+Nb2plots also contains Sphinx extensions that cause the Sphinx build to
+generate Python code files and Jupyter notebooks from the ReST source.  When
+you add the Nb2plots ReST directive ``code-links`` to your ReST page, it will
+cause the Sphinx build to create a Python code file and notebook versions of
+your page, and adds download links to these versions::
+
+    .. code-links::
+
+See |code-links-documentation| for details.
+
+**************************
+Show me what it looks like
+**************************
+
+For a very simple example, see |worked-example|.
+
+For a moderate-sized teaching site that makes extensive use of Nb2plots, see
+https://matthew-brett.github.io/teaching.
+
+************
+Installation
+************
+
+::
+
+    pip install nb2plots
+
+You will need Pandoc_ installed and available as the ``pandoc`` command.
+
+To install Pandoc on OSX, we recommend homebrew_::
+
+    brew install pandoc
+
+*************
+Configuration
+*************
+
+Add the following to your Sphinx ``conf.py`` file::
+
+    extensions = ["nb2plots"]
+
+See |nbplot-documentation| for the various ``conf.py`` configuration settings.
+
+****
+Code
+****
+
+See https://github.com/matthew-brett/nb2plots
+
+Released under the BSD two-clause license - see the file ``LICENSE`` in the
+source distribution.
+
+`travis-ci <https://travis-ci.org/matthew-brett/nb2plots>`_ kindly tests the
+code automatically under Python versions 2.7, and 3.5 through 3.8.
+
+The latest released version is at https://pypi.python.org/pypi/nb2plots
+
+*****
+Tests
+*****
+
+* Install ``nb2plots``
+* Install the pytest_ testing framework, the ``mock`` package, and the
+  ``scripttester`` package.
+
+    pip install pytest mock scripttester
+
+* Run the tests with::
+
+    py.test --pyargs nb2plots
+
+*******
+Support
+*******
+
+Please put up issues on the `nb2plots issue tracker`_.
+
+.. standalone-references
+
+.. |nbplot-documentation| replace:: `nbplots documentation`_
+.. |worked-example| replace:: `worked example`_
+.. |code-links-documentation| replace:: `code-links documentation`_
+.. _nbplots documentation:
+    https://matthew-brett.github.io/nb2plots/nbplots.html
+.. _code-links documentation:
+    https://matthew-brett.github.io/nb2plots/code_links.html
+.. _worked example:
+    https://matthew-brett.github.io/nb2plots/worked_example.html
+.. _documentation: https://matthew-brett.github.io/nb2plots
+.. _pandoc: http://pandoc.org
+.. _jupyter: jupyter.org
+.. _homebrew: brew.sh
+.. _sphinx: http://sphinx-doc.org
+.. _rest: http://docutils.sourceforge.net/rst.html
+.. _nb2plots issue tracker: https://github.com/matthew-brett/nb2plots/issues
+.. _matplotlib plot directive: http://matplotlib.org/sampledoc/extensions.html
+.. _nbconvert: http://nbconvert.readthedocs.org/en/latest/
+.. _pytest: https://pytest.readthedocs.io
+.. _mock: https://github.com/testing-cabal/mock
+
+
diff --git a/nb2plots.egg-info/requires.txt b/nb2plots.egg-info/requires.txt
index 9a0b220..9f11042 100644
--- a/nb2plots.egg-info/requires.txt
+++ b/nb2plots.egg-info/requires.txt
@@ -1,12 +1,12 @@
-ipython[notebook]>=3.0
+ipython[notebook]>=4.0
+matplotlib>=2.0
+numpy>=1.7.1
+six>=1.10
 sphinx>=1.4
-numpy>=1.6.1
-matplotlib>=1.1.0
-six>=1.7.0
-sphinxtesters
+sphinxtesters>=0.2
 texext
 
 [test]
-pytest
 mock
+pytest
 scripttester
diff --git a/nb2plots/_version.py b/nb2plots/_version.py
index eb85850..f4b03b8 100644
--- a/nb2plots/_version.py
+++ b/nb2plots/_version.py
@@ -8,11 +8,11 @@ import json
 
 version_json = '''
 {
- "date": "2018-02-03T21:09:07+0000",
- "dirty": false,
- "error": null,
- "full-revisionid": "8873eeca7d7ad617dcac9aa317ee0a7079e17c79",
- "version": "0.6"
+ "date": null,
+ "dirty": null,
+ "error": "unable to compute version",
+ "full-revisionid": null,
+ "version": "0+unknown"
 }
 '''  # END VERSION_JSON
 
diff --git a/nb2plots/codelinks.py b/nb2plots/codelinks.py
index e4069ef..30c3cb8 100644
--- a/nb2plots/codelinks.py
+++ b/nb2plots/codelinks.py
@@ -22,8 +22,8 @@ Kernel timeout
 --------------
 
 When you build the full notebook, Jupyter will execute the code in each cell.
-By default, Jupyter will time out of any cell takes longer than 30 seconds to
-execute.  You can change this default for the whole project with the
+By default, Jupyter will time out for any cell that takes longer than 30
+seconds to execute.  You can change this default for the whole project with the
 ``fill_notebook_timeout`` setting in the ``conf.py`` file (see below).  If you
 just want to change the setting for a single page, you can add the ``timeout``
 option to the ``code-links`` directive.  For example::
@@ -31,8 +31,8 @@ option to the ``code-links`` directive.  For example::
     .. code-links:
         :timeout: 120
 
-Set the timeout value to -1 or ``none`` to disable timeout entirely for this
-directive / page.
+Set the ``timeout`` value to -1 or ``none`` to disable timeout entirely for
+this directive / page.
 
 Configuration options
 ---------------------
diff --git a/nb2plots/converters.py b/nb2plots/converters.py
index f3582a5..60478d6 100644
--- a/nb2plots/converters.py
+++ b/nb2plots/converters.py
@@ -76,15 +76,16 @@ class Converter(object):
             (``app.cleanup()``) after use.
         """
         app = self._make_app(rst_text)
-        out_fname = pjoin(app.tmp_dir, 'contents.rst')
+        master_doc = app.config.master_doc
+        out_fname = pjoin(app.tmp_dir, master_doc + '.rst')
         with open(out_fname, 'wt') as fobj:
             fobj.write(rst_text)
         # Force build of everything
         app.build(True, [])
         if resolve:
-            dt = app.env.get_and_resolve_doctree('contents', app.builder)
+            dt = app.env.get_and_resolve_doctree(master_doc, app.builder)
         else:
-            dt = app.env.get_doctree('contents')
+            dt = app.env.get_doctree(master_doc)
         return dt, app
 
     def from_doctree(self, doctree, builder):
@@ -102,7 +103,7 @@ class Converter(object):
         output : str
             Representation in output format
         """
-        builder.prepare_writing(['contents'])
+        builder.prepare_writing([builder.config.master_doc])
         return builder.writer.write(doctree, UnicodeOutput())
 
     def from_rst(self, rst_text, resolve=True):
@@ -143,6 +144,7 @@ DEFAULT_EXTENSIONS = [ext_name for ext_name in
 
 
 DEFAULT_CONF =  """\
+master_doc = 'contents'   # For compatibility with Sphinx 2
 extensions = [{}]
 """.format(',\n'.join('"{}"'.format(ext_name)
                       for ext_name in DEFAULT_EXTENSIONS))
diff --git a/nb2plots/doctree2md.py b/nb2plots/doctree2md.py
index f8e2025..869e746 100644
--- a/nb2plots/doctree2md.py
+++ b/nb2plots/doctree2md.py
@@ -344,7 +344,11 @@ class Translator(nodes.NodeVisitor):
 
     def visit_literal_block(self, node):
         self._escape_text = False
-        code_type = node['classes'][1] if 'code' in node['classes'] else ''
+        if 'code' in node['classes']:  # Sphinx < 2
+            code_type = node['classes'][1]
+        else:  # Sphinx >= 2
+            language = node.get('language', '')
+            code_type = '' if language == 'default' else language
         self.add('```' + code_type + '\n')
 
     def depart_literal_block(self, node):
diff --git a/nb2plots/from_notebook.py b/nb2plots/from_notebook.py
index bfaad15..05467ed 100644
--- a/nb2plots/from_notebook.py
+++ b/nb2plots/from_notebook.py
@@ -14,7 +14,7 @@ MPL_INLINE = re.compile(r"^\s*%\s*matplotlib\s+(inline|nbagg)\s*$",
 
 # Template to label code and output and plot blocks
 dl = DictLoader({'rst_plots.tpl': """\
-{%- extends 'rst.tpl' -%}
+{%- extends '__RST_DEFAULT_TEMPLATE__' -%}
 
 {% block input %}
 {%- if cell.source.strip() | has_mpl_inline -%}
@@ -50,7 +50,8 @@ dl = DictLoader({'rst_plots.tpl': """\
 {{ output.data['text/plain'] | ellipse_mpl | indent }}
 ##END_OUT_END##
 {%- endblock data_text -%}
-"""})
+""".replace('__RST_DEFAULT_TEMPLATE__',
+            nbconvert.RSTExporter().template_file)})
 
 
 def has_mpl_inline(code):
@@ -88,8 +89,8 @@ def to_doctests(code, first='>>> ', cont='... '):
     return '\n'.join(new_code)
 
 
-MPL_LIST_OUT = re.compile('\[<matplotlib\..*?>\]')
-MPL_OBJ_OUT = re.compile('<matplotlib\..*?>')
+MPL_LIST_OUT = re.compile(r'\[<matplotlib\..*?>\]')
+MPL_OBJ_OUT = re.compile(r'<matplotlib\..*?>')
 
 def ellipse_mpl(text):
     """ Replace outputs of matplotlib objects with ellipses
@@ -113,11 +114,11 @@ CODE_WITH_OUTPUT = re.compile(
     '^##CODE_START##\n'
     '(?P<code>.*?)'
     '^##CODE_END##(\n|$)'
-    '([\s\\n]*?'
+    '([\\s\\n]*?'
     '^##STDOUT_START##\n'
     '(?P<stdout>.*?)'
     '^##STDOUT_END##(\n|$))?'
-    '([\s\\n]*?'
+    '([\\s\\n]*?'
     '^##END_OUT_START##\n'
     '(?P<end_out>.*?)'
     '^##END_OUT_END##(\n|$))?', re.S | re.M)
diff --git a/nb2plots/nbplots.py b/nb2plots/nbplots.py
index 0c459a9..56b7bba 100644
--- a/nb2plots/nbplots.py
+++ b/nb2plots/nbplots.py
@@ -177,7 +177,11 @@ from __future__ import (absolute_import, division, print_function,
 
 import six
 
-from collections import defaultdict, Sequence
+try:
+    from collections.abc import Sequence
+except ImportError:
+    from collections import Sequence
+from collections import defaultdict
 import sys, os, shutil, io, re, textwrap
 from os.path import (relpath, abspath, join as pjoin, dirname, exists,
                      basename, splitext, isdir)
@@ -673,7 +677,7 @@ def remove_coding(text):
     """
     Remove the coding comment, which six.exec_ doesn't like.
     """
-    sub_re = re.compile("^#\s*-\*-\s*coding:\s*.*-\*-$", flags=re.MULTILINE)
+    sub_re = re.compile(r"^#\s*-\*-\s*coding:\s*.*-\*-$", flags=re.MULTILINE)
     return sub_re.sub("", text)
 
 #------------------------------------------------------------------------------
diff --git a/nb2plots/runroles.py b/nb2plots/runroles.py
index ff67853..ec62dc0 100644
--- a/nb2plots/runroles.py
+++ b/nb2plots/runroles.py
@@ -356,5 +356,6 @@ def setup(app):
     # code visit, depart methods with app.add_node as we have just done for the
     # html translator in the lines above.  See:
     # http://www.sphinx-doc.org/en/1.4.8/extdev/tutorial.html#the-setup-function
+    app.set_translator('markdown', doctree2py.Translator)
     app.set_translator('pyfile', doctree2py.Translator)
     app.set_translator('ipynb', doctree2nb.Translator)
diff --git a/nb2plots/testing/__init__.py b/nb2plots/testing/__init__.py
index 8154b5d..76afcfd 100644
--- a/nb2plots/testing/__init__.py
+++ b/nb2plots/testing/__init__.py
@@ -7,7 +7,6 @@ import numpy as np
 
 from sphinxtesters import SourcesBuilder
 
-
 DATA_PATH = abspath(pjoin(
     dirname(__file__),
     '..',
@@ -30,4 +29,12 @@ class PlotsBuilder(SourcesBuilder):
     Used by several test functions.
     """
 
-    conf_source = 'extensions = ["nb2plots", "sphinx.ext.doctest"]'
+    conf_source = """\
+master_doc = "contents"  # Compatibility with Sphinx 2
+extensions = ["nb2plots", "sphinx.ext.doctest"]
+"""
+
+def stripeq(actual, expected):
+    """ True if LR stripped `actual` equal to LR stripped `expected`
+    """
+    return actual.strip() == expected.strip()
diff --git a/nb2plots/testing/nbtesters.py b/nb2plots/testing/nbtesters.py
index a16d22a..80733c0 100644
--- a/nb2plots/testing/nbtesters.py
+++ b/nb2plots/testing/nbtesters.py
@@ -1,9 +1,19 @@
 """ Utils for testing notebooks
 """
 
+from copy import deepcopy
+
 from nb2plots.ipython_shim import nbf
 
 
+def rm_ids(nb):
+    nb2 = deepcopy(nb)
+    for cell in nb2['cells']:
+        if 'id' in cell:
+            del cell['id']
+    return nb2
+
+
 def assert_nb_equiv(ipynb, expected):
     actual_nb = nbf.reads(ipynb)
     expected_nb = nbf.reads(expected)
@@ -11,4 +21,12 @@ def assert_nb_equiv(ipynb, expected):
     # It does not appear to be possible to request specific minor versions of
     # the Notebook format.
     expected_nb['nbformat_minor'] = actual_nb['nbformat_minor']
-    assert actual_nb == expected_nb
+    # 'language_info' key seems to have arrived in metadata as a result of
+    # nbconvert 5.3.1 -> 5.4.0 (5.4.0 released September 7 2018).  Previously
+    # it was empty.
+    actual_nb['metadata'].pop('language_info', None)
+    # 'execution' in cell metadata from nbconvert 6.0
+    for cell in actual_nb['cells']:
+        if 'execution' in cell['metadata']:
+            cell['metadata'].pop('execution')
+    assert rm_ids(actual_nb) == rm_ids(expected_nb)
diff --git a/nb2plots/tests/conftest.py b/nb2plots/tests/conftest.py
index 8589041..9154216 100644
--- a/nb2plots/tests/conftest.py
+++ b/nb2plots/tests/conftest.py
@@ -1,9 +1,8 @@
-""" Configuration for py.test test run
+""" Skip the origin Gohlke transforms for doctests.
+
+That file needs some specific doctest setup.
 """
 
-def pytest_ignore_collect(path, config):
-    """ Skip the origin Gohlke transforms for doctests.
+from os.path import join as pjoin
 
-    That file needs some specific doctest setup.
-    """
-    return path.basename in ('conf.py', 'rst_md_files')
+collect_ignore = [pjoin('proj1', "conf.py"), 'rst_md_files']
diff --git a/nb2plots/tests/test_builders.py b/nb2plots/tests/test_builders.py
index f676140..781dc31 100644
--- a/nb2plots/tests/test_builders.py
+++ b/nb2plots/tests/test_builders.py
@@ -3,6 +3,7 @@
 from __future__ import unicode_literals
 
 from os.path import join as pjoin, isfile
+import re
 
 from nb2plots.testing import PlotsBuilder
 
@@ -113,35 +114,37 @@ class TestBasedMarkdownBuild(TestMarkdownBuild):
     """ Markdown builder with specified base URL
     """
 
-    conf_source = ('extensions = ["nb2plots"]\n'
+    conf_source = ('master_doc = "contents"\n'
+                   'extensions = ["nb2plots"]\n'
                    'markdown_http_base = "https://dynevor.org"')
 
     def test_output(self):
         assert self.get_built_file('contents.md').strip() == ''
-        assert self.get_built_file('a_page.md') == """\
-## Refereed section
+        expected_re = r"""## Refereed section
 
-This section refers to [itself](https://dynevor.org/a_page.html#a-ref).
+This section refers to \[itself\]\(https://dynevor.org/a_page.html#a-ref\)\.
 
-It also refers forward to the [next section](https://dynevor.org/a_page.html#b-ref).
+It also refers forward to the \[next section\]\(https://dynevor.org/a_page.html#b-ref\)\.
 
-Then, and finally, it refers to itself with its own name: [Refereed section](https://dynevor.org/a_page.html#a-ref).
+Then, and finally, it refers to itself with its own name: \[Refereed section\]\(https://dynevor.org/a_page\.html#a-ref\)\.
 
 ## Rerefereed
 
-This section refers to this document at [Refereed section](https://dynevor.org/a_page.html), and with an
-explicit title, to [this document](https://dynevor.org/a_page.html).
+This section refers to this document at \[Refereed section\]\(https://dynevor\.org/a_page\.html\), and with an
+explicit title, to \[this document\]\(https://dynevor\.org/a_page.html\)\.
 
-Then to [Refereed section](https://dynevor.org/a_page.html).  Again to [another doc](https://dynevor.org/a_page.html).
+Then to \[Refereed section\]\(https://dynevor\.org/a_page.html\)\.  Again to \[another doc\]\(https://dynevor\.org/a_page.html\)\.
 
-Now [a_page.rst](https://dynevor.org/_downloads/a_page.rst).
+Now \[a_page\.rst\]\(https://dynevor.org/_downloads/([a-f0-9]+/)?a_page.rst\)\.
 
-Then [another page](https://dynevor.org/_downloads/a_page.rst).
+Then \[another page\]\(https://dynevor\.org/_downloads/([a-f0-9]+/)?a_page.rst\)\.
 
-Then [a link](https://another-place.com/page.html).
+Then \[a link\]\(https://another-place.com/page.html\)\.
 
-Again, we [link to another doc](https://dynevor.org/subdir1/b_page.html).
+Again, we \[link to another doc\]\(https://dynevor.org/subdir1/b_page\.html\)\.
 """
+        actual = self.get_built_file('a_page.md')
+        assert re.match(expected_re, actual)
         assert self.get_built_file(pjoin('subdir1', 'b_page.md')) == """\
 ## Another page
 
@@ -198,7 +201,8 @@ class TestBasedPythonBuild(TestPythonBuild):
     """ Python builder with specified base URL
     """
 
-    conf_source = ('extensions = ["nb2plots"]\n'
+    conf_source = ('master_doc = "contents"\n'
+                   'extensions = ["nb2plots"]\n'
                    'markdown_http_base = "https://dynevor.org"')
 
     def test_output(self):
@@ -230,6 +234,8 @@ A section
 .. code-links::
 """}
 
+    toctree_pages = list(rst_sources)
+
     def test_output(self):
         for suffix in ('.py', '.ipynb', '_full.ipynb'):
             assert isfile(pjoin(self.out_dir, 'foo', 'a_page' + suffix))
diff --git a/nb2plots/tests/test_codelinks.py b/nb2plots/tests/test_codelinks.py
index 4ac5bd0..06badf8 100644
--- a/nb2plots/tests/test_codelinks.py
+++ b/nb2plots/tests/test_codelinks.py
@@ -20,8 +20,7 @@ Text here
 .. code-links::
 
 More text here."""
-    both_re = re.compile("""\
-<document source=".*?">
+    both_re = re.compile(r"""<document source=".*?">
     <paragraph>
         Text here
     <code_links>
@@ -61,8 +60,7 @@ Text here
 
 More text here."""
     pxml = as_pxml(page)
-    assert re.match("""\
-<document source=".*?">
+    assert re.match(r"""<document source=".*?">
     <paragraph>
         Text here
     <code_links>
@@ -81,8 +79,7 @@ Text here
 
 More text here."""
     pxml = as_pxml(page)
-    assert re.match("""\
-<document source=".*?">
+    assert re.match(r"""<document source=".*?">
     <paragraph>
         Text here
     <code_links>
@@ -101,8 +98,7 @@ Text here
 
 More text here."""
     pxml = as_pxml(page)
-    assert re.match("""\
-<document source=".*?">
+    assert re.match(r"""<document source=".*?">
     <paragraph>
         Text here
     <code_links>
diff --git a/nb2plots/tests/test_converters.py b/nb2plots/tests/test_converters.py
index 99fe628..2cb18fe 100644
--- a/nb2plots/tests/test_converters.py
+++ b/nb2plots/tests/test_converters.py
@@ -25,7 +25,7 @@ More compelling text"""
     # pseudoxml converter
     conv = Converter('pseudoxml')
     pxml = conv.from_rst(NEW_PAGE)
-    assert re.search(r"""<document source=".*/contents.rst">
+    assert re.search(r"""<document source=".*/(contents|index)\.rst">
     <section ids="more-fancy-title" names="more\\ fancy\\ title">
         <title>
             More fancy title
diff --git a/nb2plots/tests/test_doctree2nb.py b/nb2plots/tests/test_doctree2nb.py
index fd3528c..3bc1936 100644
--- a/nb2plots/tests/test_doctree2nb.py
+++ b/nb2plots/tests/test_doctree2nb.py
@@ -2,6 +2,7 @@
 """
 from os.path import join as pjoin
 from glob import glob
+import re
 
 from nb2plots.converters import to_notebook
 from nb2plots.ipython_shim import nbf
@@ -16,6 +17,9 @@ from nb2plots.testing.convutils import fcontents, unsmart_nb
 from nb2plots.testing.nbtesters import assert_nb_equiv
 
 
+ID_RE = re.compile(r'"id":\s+".*?",\s*\n?')
+
+
 def to_nb_safe(rst_str):
     out = to_notebook.from_rst(rst_str)
     return unsmart_nb(out)
@@ -27,10 +31,14 @@ def cells2json(cells):
     return nbf.writes(nb)
 
 
+def rm_json_id(s):
+    return ID_RE.sub(s, '')
+
+
 def assert_rst_cells_equal(rst_text, cells):
     actual = to_notebook.from_rst(rst_text)
     expected = cells2json(cells)
-    assert actual == expected
+    assert rm_json_id(actual) == rm_json_id(expected)
 
 
 def test_basic():
diff --git a/nb2plots/tests/test_from_notebook.py b/nb2plots/tests/test_from_notebook.py
index dc0bae7..73be954 100644
--- a/nb2plots/tests/test_from_notebook.py
+++ b/nb2plots/tests/test_from_notebook.py
@@ -6,6 +6,7 @@ from os.path import dirname, join as pjoin
 from ..ipython_shim import nbformat
 from ..from_notebook import (convert_nb, convert_nb_fname, to_doctests,
                              has_mpl_inline, CODE_WITH_OUTPUT)
+from ..testing import stripeq
 
 
 DATA_PATH = pjoin(dirname(__file__), 'data')
@@ -20,12 +21,12 @@ def test_simple_cells():
     md_cell = v4.new_markdown_cell('# Some text')
     nb['cells'] = [md_cell]
     exp_text = "\nSome text\n=========\n"
-    assert convert_nb(nb) == exp_text
+    assert stripeq(convert_nb(nb), exp_text)
     # Code -> replaced with plot directive / doctest markers
     code_cell = v4.new_code_cell('a = 10')
     nb['cells'] = [code_cell]
     exp_code = PLT_HDR + "    >>> a = 10\n"
-    assert convert_nb(nb) == exp_code
+    assert stripeq(convert_nb(nb), exp_code)
     # Empty code -> no output
     empty_code_cell = v4.new_code_cell('')
     nb['cells'] = [empty_code_cell]
@@ -35,12 +36,12 @@ def test_simple_cells():
     # magic lines get stripped
     magic_code_cell = v4.new_code_cell('%timeit a = 1')
     nb['cells'] = [magic_code_cell]
-    assert convert_nb(nb) == exp_empty_code
+    assert stripeq(convert_nb(nb), exp_empty_code)
     # Magic lines stripped from within other code lines
     mixed_magic_code_cell = v4.new_code_cell('%timeit a = 1\nb = 2')
     exp_mixed_magic = PLT_HDR + "    >>> b = 2\n"
     nb['cells'] = [mixed_magic_code_cell]
-    assert convert_nb(nb) == exp_mixed_magic
+    assert stripeq(convert_nb(nb), exp_mixed_magic)
 
 
 def test_mpl_inline_works():
@@ -50,7 +51,7 @@ def test_mpl_inline_works():
     code_cell = v4.new_code_cell('%matplotlib inline\na = 10')
     nb['cells'] = [code_cell]
     exp_code = "\n.. mpl-interactive::\n{}    >>> a = 10\n".format(PLT_HDR)
-    assert convert_nb(nb) == exp_code
+    assert stripeq(convert_nb(nb), exp_code)
 
 
 def test_mpl_inline():
@@ -126,7 +127,7 @@ def test_small():
     rst_fname = pjoin(DATA_PATH, 'small.rst')
     out = convert_nb_fname(nb_fname)
     with open(rst_fname, 'rt') as fobj:
-        assert out + '\n' == fobj.read()
+        assert stripeq(out, fobj.read())
 
 
 code = \
diff --git a/nb2plots/tests/test_nbplots.py b/nb2plots/tests/test_nbplots.py
index aeb0b55..4b788ec 100644
--- a/nb2plots/tests/test_nbplots.py
+++ b/nb2plots/tests/test_nbplots.py
@@ -7,6 +7,10 @@ import os
 
 from docutils.nodes import paragraph, title
 
+import sphinx
+
+SPHINX_ge_1p8 = sphinx.version_info[:2] >= (1, 8)
+
 from nb2plots.nbplots import (run_code, parse_parts, nbplot_container,
                               nbplot_epilogue)
 from sphinxtesters import SourcesBuilder
@@ -20,6 +24,9 @@ import pytest
 
 HERE = dirname(__file__)
 
+# Variation in doctest block.
+DOCTEST_BLOCK_RE = r'<doctest_block (classes="doctest" )?xml:space="preserve">'
+
 
 def get_otherpage(fname):
     with open(pjoin(HERE, 'otherpages', fname), 'rt') as fobj:
@@ -445,7 +452,7 @@ See :ref:`the ref <a-ref>`.
         # Check that reference correctly included
         built = self.get_built_file('a_page.pseudoxml')
         expected_regexp = re.compile(
-r"""<document _plot_counter="1" source=".*?a_page.rst">
+r"""<document _plot_counter="1" source=".*?a_page.rst"( xmlns.*)?>
     <section ids="a-title" names="a\\ title">
         <title>
             A title
@@ -470,6 +477,12 @@ class TestFlags(PlotsBuilder):
 
     builder = 'pseudoxml'
 
+    literal_header = (
+        r'<literal_block ' +
+        (r'force(_highlighting)?="False" language="default" linenos="False" '
+        if SPHINX_ge_1p8 else '') +
+        'xml:space="preserve">')
+
     rst_sources=dict(a_page="""\
 A title
 -------
@@ -493,15 +506,17 @@ Some text
     def test_flags(self):
         # Check that flags correctly set from flag directives
         built = self.get_built_file('a_page.pseudoxml')
-        assert """
+        expected = r"""
         <title>
             A title
-        <literal_block xml:space="preserve">
-            {'a': 1, 'b': 2}
+        {literal_header}
+            {{'a': 1, 'b': 2}}
         <paragraph>
             Some text
-        <literal_block xml:space="preserve">
-            {'a': 1, 'b': 2, 'c': 3}""" in built
+        {literal_header}
+            {{'a': 1, 'b': 2, 'c': 3}}""".format(
+                literal_header=self.literal_header)
+        assert re.search(expected, built)
 
 
 class TestFlagsConfig(TestFlags):
@@ -515,16 +530,17 @@ nbplot_flags = {'flag1': 5, 'flag2': 6}
     def test_flags(self):
         # Check that global flags merged with local
         built = self.get_built_file('a_page.pseudoxml')
-        assert ("""
+        expected = r"""
         <title>
             A title
-        <literal_block xml:space="preserve">
-            {'a': 1, 'b': 2, 'flag1': 5, 'flag2': 6}
+        {literal_header}
+            {{'a': 1, 'b': 2, 'flag1': 5, 'flag2': 6}}
         <paragraph>
             Some text
-        <literal_block xml:space="preserve">
-            {'a': 1, 'b': 2, 'c': 3, 'flag1': 5, 'flag2': 6}"""
-                    in built)
+        {literal_header}
+            {{'a': 1, 'b': 2, 'c': 3, 'flag1': 5, 'flag2': 6}}""".format(
+                literal_header=self.literal_header)
+        assert re.search(expected, built)
 
 
 class TestWithoutSkip(PlotsBuilder):
@@ -626,7 +642,7 @@ class TestWithoutSkipStructure(TestWithoutSkip):
         <title>
             A title
         <nbplot_container>
-            <doctest_block xml:space="preserve">
+            {DOCTEST_BLOCK_RE}
                 >>> # always
                 >>> a = 'default'
         <nbplot_epilogue>
@@ -636,7 +652,7 @@ class TestWithoutSkipStructure(TestWithoutSkip):
         <paragraph>
             Some text
         <nbplot_container>
-            <doctest_block xml:space="preserve">
+            {DOCTEST_BLOCK_RE}
                 >>> a = 'skip is False'
         <nbplot_epilogue>
             <comment xml:space="preserve">
@@ -645,7 +661,7 @@ class TestWithoutSkipStructure(TestWithoutSkip):
         <paragraph>
             Keep text coming
         <nbplot_container>
-            <doctest_block xml:space="preserve">
+            {DOCTEST_BLOCK_RE}
                 >>> b = 'skip appears to be False'
                 >>> a == 'skip is False'
                 True
@@ -656,10 +672,10 @@ class TestWithoutSkipStructure(TestWithoutSkip):
         <paragraph>
             Text continues
         <nbplot_container>
-            <doctest_block xml:space="preserve">
+            {DOCTEST_BLOCK_RE}
                 >>> # doctest only run when skip flag False, always rendered
                 >>> b == 'skip appears to be False'
-                True""")
+                True""".format(**globals()))
         assert(regex.match(p_xml) is not None)
 
 
@@ -695,7 +711,7 @@ class TestWithSkipStructure(TestWithSkip):
         <title>
             A title
         <nbplot_container>
-            <doctest_block xml:space="preserve">
+            {DOCTEST_BLOCK_RE}
                 >>> # always
                 >>> a = 'default'
         <nbplot_epilogue>
@@ -705,7 +721,7 @@ class TestWithSkipStructure(TestWithSkip):
         <paragraph>
             Some text
         <nbplot_container>
-            <doctest_block xml:space="preserve">
+            {DOCTEST_BLOCK_RE}
                 >>> a = 'skip is True'
         <nbplot_epilogue>
             <comment xml:space="preserve">
@@ -714,7 +730,7 @@ class TestWithSkipStructure(TestWithSkip):
         <paragraph>
             Keep text coming
         <nbplot_container>
-            <doctest_block xml:space="preserve">
+            {DOCTEST_BLOCK_RE}
                 >>> b = 'skip appears to be True'
                 >>> a == 'skip is True'
                 True
@@ -734,10 +750,10 @@ class TestWithSkipStructure(TestWithSkip):
             <comment xml:space="preserve">
             <comment xml:space="preserve">
         <nbplot_container hide-from="all" show-to="doctest">
-            <doctest_block xml:space="preserve">
+            {DOCTEST_BLOCK_RE}
                 >>> # only when skip flag True
                 >>> b == 'skip appears to be True'
-                True""")
+                True""".format(**globals()))
         assert(regex.match(p_xml) is not None)
 
 
diff --git a/nb2plots/tests/test_proj1.py b/nb2plots/tests/test_proj1.py
index a1727c2..103d8a0 100644
--- a/nb2plots/tests/test_proj1.py
+++ b/nb2plots/tests/test_proj1.py
@@ -2,7 +2,7 @@
 
 from os.path import (join as pjoin, dirname, isdir, exists)
 
-from sphinxtesters import ModifiedPageBuilder
+from sphinxtesters import PageBuilder
 
 HERE = dirname(__file__)
 
@@ -12,15 +12,12 @@ A title
 
 """
 
-class Proj1Builder(ModifiedPageBuilder):
+class Proj1Builder(PageBuilder):
     """ Build using 'proj1' directory as template to modify
     """
 
     page_source_template = pjoin(HERE, 'proj1')
 
-    # default_page used in 'replace_page' class method
-    default_page = 'a_page.rst'
-
 
 class TestProj1(Proj1Builder):
 
diff --git a/nb2plots/tests/test_regression.py b/nb2plots/tests/test_regression.py
index 9dd703a..7a5a0e1 100644
--- a/nb2plots/tests/test_regression.py
+++ b/nb2plots/tests/test_regression.py
@@ -6,6 +6,7 @@ from os.path import join as pjoin, dirname
 from nb2plots.from_notebook import convert_nb_fname
 from nb2plots.converters import to_py, to_notebook
 
+from nb2plots.testing import stripeq
 from nb2plots.testing.convutils import fcontents
 from nb2plots.testing.nbtesters import assert_nb_equiv
 
@@ -19,7 +20,7 @@ def test_regression():
     output_rst_fname = pjoin(DATA, 'converted_example.rst')
     # Convert to ReST, add trailing CR from output script
     rst = convert_nb_fname(input_nb_fname) + '\n'
-    assert rst.encode('utf8') == fcontents(output_rst_fname)
+    assert stripeq(rst.encode('utf8'), fcontents(output_rst_fname))
     # Convert ReST to output formats
     py_file = to_py.from_rst(rst)
     assert (py_file.encode('utf8') ==
diff --git a/nb2plots/tests/test_runroles.py b/nb2plots/tests/test_runroles.py
index 0f30516..5147ea4 100644
--- a/nb2plots/tests/test_runroles.py
+++ b/nb2plots/tests/test_runroles.py
@@ -72,14 +72,14 @@ def test_runrole_doctrees():
         dict(code_type='clearnotebook',
              filebase='contents',
              base='/contents',
-             descr='Download this page as a Jupyter notebook \(no outputs\)'),
+             descr=r'Download this page as a Jupyter notebook \(no outputs\)'),
         "Text then :clearnotebook:`.` then text.")
     assert_rst_pxml(
         dict(code_type='fullnotebook',
              filebase='contents',
              base='/contents',
              descr=('Download this page as a Jupyter notebook '
-                    '\(with outputs\)')),
+                    r'\(with outputs\)')),
         "Text then :fullnotebook:`.` then text.")
     assert_rst_pxml(
         dict(code_type='pyfile',
diff --git a/nb2plots/tests/test_timeout.py b/nb2plots/tests/test_timeout.py
index ac91063..3a54448 100644
--- a/nb2plots/tests/test_timeout.py
+++ b/nb2plots/tests/test_timeout.py
@@ -19,7 +19,7 @@ Title
 .. nbplot::
 
     >>> from time import sleep
-    >>> sleep(2)
+    >>> sleep(5)
 """}
 
 
@@ -48,7 +48,7 @@ Title
 .. nbplot::
 
     >>> from time import sleep
-    >>> sleep(2)
+    >>> sleep(5)
 """}
 
     should_error = True
@@ -70,7 +70,7 @@ Add :longerfullnotebook:`.`
 .. nbplot::
 
     >>> from time import sleep
-    >>> sleep(2)
+    >>> sleep(5)
 """}
 
     should_error = True
@@ -103,7 +103,7 @@ Title
 .. nbplot::
 
     >>> from time import sleep
-    >>> sleep(2)
+    >>> sleep(5)
 """}
 
 
@@ -131,5 +131,5 @@ Add :longerfullnotebook:`long <long.ipynb>`
 .. nbplot::
 
     >>> from time import sleep
-    >>> sleep(3)
+    >>> sleep(5)
 """}
diff --git a/requirements.txt b/requirements.txt
index 22ee1b9..17d2afe 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,9 +1,9 @@
 # Minimum requirements
 #
-ipython[notebook]>=3.0
+ipython[notebook]>=4.0
 sphinx>=1.4
-numpy>=1.6.1
-matplotlib>=1.1.0
-six>=1.7.0
-sphinxtesters
+numpy>=1.7.1
+matplotlib>=2.0
+six>=1.10
+sphinxtesters>=0.2
 texext
diff --git a/setup.cfg b/setup.cfg
index ae9a957..45d7831 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [versioneer]
-vcs = git
+VCS = git
 style = pep440
 versionfile_source = nb2plots/_version.py
 versionfile_build = nb2plots/_version.py