Skip to content

Commit f315f23

Browse files
authored
Merge pull request #2823 from vidartf/nbval-ci
Add more doc tests
2 parents ff49a10 + f6de61d commit f315f23

16 files changed

+44
-30
lines changed

.travis.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ install:
4848
script:
4949
- 'if [[ $GROUP == js* ]]; then travis_retry python -m notebook.jstest ${GROUP:3}; fi'
5050
- 'if [[ $GROUP == python ]]; then nosetests -v --with-coverage --cover-package=notebook notebook; fi'
51-
- 'if [[ $GROUP == docs ]]; then make -C docs/ html; fi'
51+
- |
52+
if [[ $GROUP == docs ]]; then
53+
EXIT_STATUS=0
54+
make -C docs/ html || EXIT_STATUS=$?
55+
make -C docs/ linkcheck || EXIT_STATUS=$?
56+
pytest --nbval --current-env docs || EXIT_STATUS=$?
57+
exit $EXIT_STATUS
58+
fi
5259
5360
matrix:
5461
include:

CONTRIBUTING.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ If you use ``conda``, you can get them with::
3232

3333
conda install -c conda-forge nodejs
3434

35-
If you use `Homebrew <http://brew.sh/>`_ on Mac OS X::
35+
If you use `Homebrew <https://brew.sh/>`_ on Mac OS X::
3636

3737
brew install node
3838

@@ -152,7 +152,7 @@ containing all the necessary packages (except pandoc), use::
152152
activate notebook_docs # Windows
153153

154154
.. _conda environment:
155-
http://conda.pydata.org/docs/using/envs.html#use-environment-from-file
155+
https://conda.io/docs/user-guide/tasks/manage-environments.html#creating-an-environment-from-an-environment-yml-file
156156

157157
If you want to install the necessary packages with ``pip`` instead::
158158

docs/source/conf.py

+7
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,13 @@
313313
#man_show_urls = False
314314

315315

316+
# -- Options for link checks ----------------------------------------------
317+
318+
linkcheck_ignore = [
319+
'http://127\.0\.0\.1/*'
320+
]
321+
322+
316323
# -- Options for Texinfo output -------------------------------------------
317324

318325
# Grouping the document tree into Texinfo files. List of tuples

docs/source/config_overview.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ front-end Notebook client (i.e. the familiar notebook interface).
4747
documented in the configuration file and the user documentation.
4848

4949
- :ref:`Running a Notebook server <working_remotely>`
50-
- Related: `Configuring a language kernel <https://jupyter.readthedocs.io/en/latest/install.html#installing-kernels>`_
50+
- Related: `Configuring a language kernel <https://jupyter.readthedocs.io/en/latest/install-kernel.html>`_
5151
to run in the Notebook server enables your server to run other languages, like R or Julia.
5252

5353
.. _configure_nbclient:

docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@
124124
"\n",
125125
"> Of course, in addition to the files listed, there are number of other files one needs to build a proper package. Here are some good resources:\n",
126126
"- [The Hitchhiker's Guide to Packaging](https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/quickstart.html)\n",
127-
"- [Repository Structure and Python](http://www.kennethreitz.org/essays/repository-structure-and-python) by Kenneth Reitz\n",
127+
"- [Repository Structure and Python](https://www.kennethreitz.org/essays/repository-structure-and-python) by Kenneth Reitz\n",
128128
"\n",
129129
"> How you distribute them, too, is important:\n",
130-
"- [Packaging and Distributing Projects](https://python-packaging-user-guide.readthedocs.io/distributing/)\n",
131-
"- [conda: Building packages](http://conda.pydata.org/docs/building/build.html)\n",
130+
"- [Packaging and Distributing Projects](https://python-packaging-user-guide.readthedocs.io/tutorials/distributing-packages/)\n",
131+
"- [conda: Building packages](https://conda.io/docs/building/build.html)\n",
132132
"\n",
133133
"> Here are some tools to get you started:\n",
134-
"- [generator-nbextension](https://github.com/Anaconda-Server/generator-nbextension)"
134+
"- [generator-nbextension](https://github.com/Anaconda-Platform/generator-nbextension)"
135135
]
136136
},
137137
{

docs/source/examples/Notebook/Importing Notebooks.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"This is made difficult by the fact that Notebooks are not plain Python files,\n",
1616
"and thus cannot be imported by the regular Python machinery.\n",
1717
"\n",
18-
"Fortunately, Python provides some fairly sophisticated [hooks](http://www.python.org/dev/peps/pep-0302/) into the import machinery,\n",
18+
"Fortunately, Python provides some fairly sophisticated [hooks](https://www.python.org/dev/peps/pep-0302/) into the import machinery,\n",
1919
"so we can actually make Jupyter notebooks importable without much difficulty,\n",
2020
"and only using public APIs."
2121
]

docs/source/examples/Notebook/JavaScript Notebook Extensions.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -344,15 +344,15 @@
344344
" {\n",
345345
" 'label' : 'run qtconsole',\n",
346346
" 'icon' : 'fa-terminal', // select your icon from \n",
347-
" // http://fortawesome.github.io/Font-Awesome/icons/\n",
347+
" // http://fontawesome.io/icons/\n",
348348
" 'callback': function(){Jupyter.notebook.kernel.execute('%qtconsole')}\n",
349349
" }\n",
350350
" // add more button here if needed.\n",
351351
" ]);\n",
352352
"```\n",
353353
"with a [lot of icons] you can select from. \n",
354354
"\n",
355-
"[lot of icons]: http://fortawesome.github.io/Font-Awesome/icons/"
355+
"[lot of icons]: http://fontawesome.io/icons/"
356356
]
357357
},
358358
{

docs/source/examples/Notebook/Typesetting Equations.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"The Markdown parser included in the Jupyter Notebook is MathJax-aware. This means that you can freely mix in mathematical expressions using the [MathJax subset of Tex and LaTeX](http://docs.mathjax.org/en/latest/tex.html#tex-support). [Some examples from the MathJax site](http://www.mathjax.org/demos/tex-samples/) are reproduced below, as well as the Markdown+TeX source."
7+
"The Markdown parser included in the Jupyter Notebook is MathJax-aware. This means that you can freely mix in mathematical expressions using the [MathJax subset of Tex and LaTeX](http://docs.mathjax.org/en/latest/tex.html#tex-support). [Some examples from the MathJax site](https://www.mathjax.org/demos/tex-samples/) are reproduced below, as well as the Markdown+TeX source."
88
]
99
},
1010
{
@@ -177,11 +177,11 @@
177177
"\n",
178178
"### Source\n",
179179
"```\n",
180-
"This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](http://daringfireball.net/projects/markdown/) sentence. \n",
180+
"This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](https://daringfireball.net/projects/markdown/) sentence. \n",
181181
"```\n",
182182
"\n",
183183
"### Display\n",
184-
"This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](http://daringfireball.net/projects/markdown/) sentence. "
184+
"This expression $\\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a [Markdown-formatted](https://daringfireball.net/projects/markdown/) sentence. "
185185
]
186186
},
187187
{

docs/source/examples/Notebook/What is the Jupyter Notebook.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"- Images\n",
3232
"- Video\n",
3333
"\n",
34-
"These documents provide a **complete and self-contained record of a computation** that can be converted to various formats and shared with others using email, [Dropbox](http://dropbox.com), version control systems (like git/[GitHub](http://github.com)) or [nbviewer.jupyter.org](http://nbviewer.jupyter.org)."
34+
"These documents provide a **complete and self-contained record of a computation** that can be converted to various formats and shared with others using email, [Dropbox](https://www.dropbox.com/), version control systems (like git/[GitHub](https://github.com)) or [nbviewer.jupyter.org](http://nbviewer.jupyter.org)."
3535
]
3636
},
3737
{
@@ -79,7 +79,7 @@
7979
"* See the results of computations with **rich media representations**, such as HTML, LaTeX, PNG, SVG, PDF, etc.\n",
8080
"* Create and use **interactive JavaScript widgets**, which bind interactive user interface controls and visualizations to reactive kernel side computations.\n",
8181
"* Author **narrative text** using the [Markdown](https://daringfireball.net/projects/markdown/) markup language.\n",
82-
"* Include mathematical equations using **LaTeX syntax in Markdown**, which are rendered in-browser by [MathJax](http://www.mathjax.org/)."
82+
"* Include mathematical equations using **LaTeX syntax in Markdown**, which are rendered in-browser by [MathJax](https://www.mathjax.org/)."
8383
]
8484
},
8585
{
@@ -101,7 +101,7 @@
101101
"\n",
102102
"* Python(https://github.com/ipython/ipython)\n",
103103
"* Julia (https://github.com/JuliaLang/IJulia.jl)\n",
104-
"* R (https://github.com/takluyver/IRkernel)\n",
104+
"* R (https://github.com/IRkernel/IRkernel)\n",
105105
"* Ruby (https://github.com/minrk/iruby)\n",
106106
"* Haskell (https://github.com/gibiansky/IHaskell)\n",
107107
"* Scala (https://github.com/Bridgewater/scala-notebook)\n",
@@ -149,11 +149,11 @@
149149
"* **Heading cells:** 6 levels of hierarchical organization and formatting\n",
150150
"* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n",
151151
"\n",
152-
"Internally, notebook documents are **[JSON](http://en.wikipedia.org/wiki/JSON) data** with **binary values [base64](http://en.wikipedia.org/wiki/Base64)** encoded. This allows them to be **read and manipulated programmatically** by any programming language. Because JSON is a text format, notebook documents are version control friendly.\n",
152+
"Internally, notebook documents are **[JSON](https://en.wikipedia.org/wiki/JSON) data** with **binary values [base64](http://en.wikipedia.org/wiki/Base64)** encoded. This allows them to be **read and manipulated programmatically** by any programming language. Because JSON is a text format, notebook documents are version control friendly.\n",
153153
"\n",
154-
"**Notebooks can be exported** to different static formats including HTML, reStructeredText, LaTeX, PDF, and slide shows ([reveal.js](http://lab.hakim.se/reveal-js/#/)) using Jupyter's `nbconvert` utility.\n",
154+
"**Notebooks can be exported** to different static formats including HTML, reStructeredText, LaTeX, PDF, and slide shows ([reveal.js](http://lab.hakim.se/reveal-js/)) using Jupyter's `nbconvert` utility.\n",
155155
"\n",
156-
"Furthermore, any notebook document available from a **public URL on or GitHub can be shared** via [nbviewer](http://nbviewer.ipython.org). This service loads the notebook document from the URL and renders it as a static web page. The resulting web page may thus be shared with others **without their needing to install the Jupyter Notebook**."
156+
"Furthermore, any notebook document available from a **public URL on or GitHub can be shared** via [nbviewer](http://nbviewer.jupyter.org). This service loads the notebook document from the URL and renders it as a static web page. The resulting web page may thus be shared with others **without their needing to install the Jupyter Notebook**."
157157
]
158158
}
159159
],

docs/source/examples/Notebook/Working With Markdown Cells.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"source": [
1414
"Text can be added to Jupyter Notebooks using Markdown cells. Markdown is a popular markup language that is a superset of HTML. Its specification can be found here:\n",
1515
"\n",
16-
"<http://daringfireball.net/projects/markdown/>"
16+
"<https://daringfireball.net/projects/markdown/>"
1717
]
1818
},
1919
{

docs/source/extending/contents.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,4 @@ ContentsManager.
216216

217217
.. _NBFormat: https://nbformat.readthedocs.io/en/latest/index.html
218218
.. _PGContents: https://github.com/quantopian/pgcontents
219-
.. _PostgreSQL: http://www.postgresql.org/
219+
.. _PostgreSQL: https://www.postgresql.org/

docs/source/links.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.. _nbconvert: https://nbconvert.readthedocs.io/en/latest/
3131

3232
.. Other tools and projects
33-
.. _Markdown: http://daringfireball.net/projects/markdown/syntax
33+
.. _Markdown: https://daringfireball.net/projects/markdown/syntax
3434

3535
.. _Rich Output: notebook_p5_
3636
.. _notebook_p5: https://nbviewer.jupyter.org/github/ipython/ipython/blob/master/examples/IPython%20Kernel/Rich%20Output.ipynb

docs/source/notebook.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Main features of the web application
4747

4848

4949

50-
.. _MathJax: http://www.mathjax.org/
50+
.. _MathJax: https://www.mathjax.org/
5151

5252

5353
Notebook documents
@@ -61,7 +61,7 @@ are internally JSON_ files and are saved with the ``.ipynb`` extension. Since
6161
JSON is a plain text format, they can be version-controlled and shared with
6262
colleagues.
6363

64-
.. _JSON: http://en.wikipedia.org/wiki/JSON
64+
.. _JSON: https://en.wikipedia.org/wiki/JSON
6565

6666
Notebooks may be exported to a range of static formats, including HTML (for
6767
example, for blog posts), reStructuredText, LaTeX, PDF, and slide shows, via

docs/source/public_server.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This document describes how you can
3232
To use JupyterHub, you need a Unix server (typically Linux) running
3333
somewhere that is accessible to your users on a network. This may run over
3434
the public internet, but doing so introduces additional
35-
`security concerns <https://jupyterhub.readthedocs.io/en/latest/getting-started.html#security>`_.
35+
`security concerns <https://jupyterhub.readthedocs.io/en/latest/getting-started/security-basics.html>`_.
3636

3737

3838

@@ -145,7 +145,7 @@ certificate and follow the steps in :ref:`using-lets-encrypt` to set up a
145145
public server.
146146

147147
.. _OWASP: https://www.owasp.org
148-
.. _tutorial: http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars
148+
.. _tutorial: https://arstechnica.com/information-technology/2009/12/how-to-get-set-with-a-secure-sertificate-for-free/
149149

150150
.. _notebook_public_server:
151151

@@ -326,7 +326,7 @@ Docker CMD
326326
~~~~~~~~~~
327327

328328
Using ``jupyter notebook`` as a
329-
`Docker CMD <https://docs.docker.com/reference/builder/#cmd>`_ results in
329+
`Docker CMD <https://docs.docker.com/engine/reference/builder/#cmd>`_ results in
330330
kernels repeatedly crashing, likely due to a lack of `PID reaping
331331
<https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/>`_.
332332
To avoid this, use the `tini <https://github.com/krallin/tini>`_ ``init`` as your

notebook/templates/notebook.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
{% set
295295
sections = (
296296
(
297-
("http://nbviewer.ipython.org/github/ipython/ipython/blob/3.x/examples/Notebook/Index.ipynb", _("Notebook Help"), True),
297+
("http://nbviewer.jupyter.org/github/ipython/ipython/blob/3.x/examples/Notebook/Index.ipynb", _("Notebook Help"), True),
298298
("https://help.github.com/articles/markdown-basics/",_("Markdown"),True),
299299
),
300300
)

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
extras_require = {
157157
':sys_platform != "win32"': ['terminado>=0.3.3'],
158158
'test:python_version == "2.7"': ['mock'],
159-
'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters'],
159+
'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters', 'nbval'],
160160
'test:sys_platform == "win32"': ['nose-exclude'],
161161
}
162162

0 commit comments

Comments
 (0)