Skip to content

Commit

Permalink
Merge pull request #2823 from vidartf/nbval-ci
Browse files Browse the repository at this point in the history
Add more doc tests
  • Loading branch information
takluyver committed Sep 15, 2017
2 parents ff49a10 + f6de61d commit f315f23
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 30 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ install:
script:
- 'if [[ $GROUP == js* ]]; then travis_retry python -m notebook.jstest ${GROUP:3}; fi'
- 'if [[ $GROUP == python ]]; then nosetests -v --with-coverage --cover-package=notebook notebook; fi'
- 'if [[ $GROUP == docs ]]; then make -C docs/ html; fi'
- |
if [[ $GROUP == docs ]]; then
EXIT_STATUS=0
make -C docs/ html || EXIT_STATUS=$?
make -C docs/ linkcheck || EXIT_STATUS=$?
pytest --nbval --current-env docs || EXIT_STATUS=$?
exit $EXIT_STATUS
fi
matrix:
include:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ If you use ``conda``, you can get them with::

conda install -c conda-forge nodejs

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

brew install node

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

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

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

Expand Down
7 changes: 7 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@
#man_show_urls = False


# -- Options for link checks ----------------------------------------------

linkcheck_ignore = [
'http://127\.0\.0\.1/*'
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
Expand Down
2 changes: 1 addition & 1 deletion docs/source/config_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ front-end Notebook client (i.e. the familiar notebook interface).
documented in the configuration file and the user documentation.

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

.. _configure_nbclient:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@
"\n",
"> 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",
"- [The Hitchhiker's Guide to Packaging](https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/quickstart.html)\n",
"- [Repository Structure and Python](http://www.kennethreitz.org/essays/repository-structure-and-python) by Kenneth Reitz\n",
"- [Repository Structure and Python](https://www.kennethreitz.org/essays/repository-structure-and-python) by Kenneth Reitz\n",
"\n",
"> How you distribute them, too, is important:\n",
"- [Packaging and Distributing Projects](https://python-packaging-user-guide.readthedocs.io/distributing/)\n",
"- [conda: Building packages](http://conda.pydata.org/docs/building/build.html)\n",
"- [Packaging and Distributing Projects](https://python-packaging-user-guide.readthedocs.io/tutorials/distributing-packages/)\n",
"- [conda: Building packages](https://conda.io/docs/building/build.html)\n",
"\n",
"> Here are some tools to get you started:\n",
"- [generator-nbextension](https://github.com/Anaconda-Server/generator-nbextension)"
"- [generator-nbextension](https://github.com/Anaconda-Platform/generator-nbextension)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/Notebook/Importing Notebooks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"This is made difficult by the fact that Notebooks are not plain Python files,\n",
"and thus cannot be imported by the regular Python machinery.\n",
"\n",
"Fortunately, Python provides some fairly sophisticated [hooks](http://www.python.org/dev/peps/pep-0302/) into the import machinery,\n",
"Fortunately, Python provides some fairly sophisticated [hooks](https://www.python.org/dev/peps/pep-0302/) into the import machinery,\n",
"so we can actually make Jupyter notebooks importable without much difficulty,\n",
"and only using public APIs."
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,15 @@
" {\n",
" 'label' : 'run qtconsole',\n",
" 'icon' : 'fa-terminal', // select your icon from \n",
" // http://fortawesome.github.io/Font-Awesome/icons/\n",
" // http://fontawesome.io/icons/\n",
" 'callback': function(){Jupyter.notebook.kernel.execute('%qtconsole')}\n",
" }\n",
" // add more button here if needed.\n",
" ]);\n",
"```\n",
"with a [lot of icons] you can select from. \n",
"\n",
"[lot of icons]: http://fortawesome.github.io/Font-Awesome/icons/"
"[lot of icons]: http://fontawesome.io/icons/"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples/Notebook/Typesetting Equations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"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."
"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."
]
},
{
Expand Down Expand Up @@ -177,11 +177,11 @@
"\n",
"### Source\n",
"```\n",
"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",
"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",
"```\n",
"\n",
"### Display\n",
"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. "
"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. "
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions docs/source/examples/Notebook/What is the Jupyter Notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"- Images\n",
"- Video\n",
"\n",
"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)."
"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)."
]
},
{
Expand Down Expand Up @@ -79,7 +79,7 @@
"* See the results of computations with **rich media representations**, such as HTML, LaTeX, PNG, SVG, PDF, etc.\n",
"* Create and use **interactive JavaScript widgets**, which bind interactive user interface controls and visualizations to reactive kernel side computations.\n",
"* Author **narrative text** using the [Markdown](https://daringfireball.net/projects/markdown/) markup language.\n",
"* Include mathematical equations using **LaTeX syntax in Markdown**, which are rendered in-browser by [MathJax](http://www.mathjax.org/)."
"* Include mathematical equations using **LaTeX syntax in Markdown**, which are rendered in-browser by [MathJax](https://www.mathjax.org/)."
]
},
{
Expand All @@ -101,7 +101,7 @@
"\n",
"* Python(https://github.com/ipython/ipython)\n",
"* Julia (https://github.com/JuliaLang/IJulia.jl)\n",
"* R (https://github.com/takluyver/IRkernel)\n",
"* R (https://github.com/IRkernel/IRkernel)\n",
"* Ruby (https://github.com/minrk/iruby)\n",
"* Haskell (https://github.com/gibiansky/IHaskell)\n",
"* Scala (https://github.com/Bridgewater/scala-notebook)\n",
Expand Down Expand Up @@ -149,11 +149,11 @@
"* **Heading cells:** 6 levels of hierarchical organization and formatting\n",
"* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n",
"\n",
"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",
"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",
"\n",
"**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",
"**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",
"\n",
"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**."
"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**."
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"source": [
"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",
"\n",
"<http://daringfireball.net/projects/markdown/>"
"<https://daringfireball.net/projects/markdown/>"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/extending/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ ContentsManager.

.. _NBFormat: https://nbformat.readthedocs.io/en/latest/index.html
.. _PGContents: https://github.com/quantopian/pgcontents
.. _PostgreSQL: http://www.postgresql.org/
.. _PostgreSQL: https://www.postgresql.org/
2 changes: 1 addition & 1 deletion docs/source/links.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.. _nbconvert: https://nbconvert.readthedocs.io/en/latest/

.. Other tools and projects
.. _Markdown: http://daringfireball.net/projects/markdown/syntax
.. _Markdown: https://daringfireball.net/projects/markdown/syntax

.. _Rich Output: notebook_p5_
.. _notebook_p5: https://nbviewer.jupyter.org/github/ipython/ipython/blob/master/examples/IPython%20Kernel/Rich%20Output.ipynb
Expand Down
4 changes: 2 additions & 2 deletions docs/source/notebook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Main features of the web application



.. _MathJax: http://www.mathjax.org/
.. _MathJax: https://www.mathjax.org/


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

.. _JSON: http://en.wikipedia.org/wiki/JSON
.. _JSON: https://en.wikipedia.org/wiki/JSON

Notebooks may be exported to a range of static formats, including HTML (for
example, for blog posts), reStructuredText, LaTeX, PDF, and slide shows, via
Expand Down
6 changes: 3 additions & 3 deletions docs/source/public_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This document describes how you can
To use JupyterHub, you need a Unix server (typically Linux) running
somewhere that is accessible to your users on a network. This may run over
the public internet, but doing so introduces additional
`security concerns <https://jupyterhub.readthedocs.io/en/latest/getting-started.html#security>`_.
`security concerns <https://jupyterhub.readthedocs.io/en/latest/getting-started/security-basics.html>`_.



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

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

.. _notebook_public_server:

Expand Down Expand Up @@ -326,7 +326,7 @@ Docker CMD
~~~~~~~~~~

Using ``jupyter notebook`` as a
`Docker CMD <https://docs.docker.com/reference/builder/#cmd>`_ results in
`Docker CMD <https://docs.docker.com/engine/reference/builder/#cmd>`_ results in
kernels repeatedly crashing, likely due to a lack of `PID reaping
<https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/>`_.
To avoid this, use the `tini <https://github.com/krallin/tini>`_ ``init`` as your
Expand Down
2 changes: 1 addition & 1 deletion notebook/templates/notebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
{% set
sections = (
(
("http://nbviewer.ipython.org/github/ipython/ipython/blob/3.x/examples/Notebook/Index.ipynb", _("Notebook Help"), True),
("http://nbviewer.jupyter.org/github/ipython/ipython/blob/3.x/examples/Notebook/Index.ipynb", _("Notebook Help"), True),
("https://help.github.com/articles/markdown-basics/",_("Markdown"),True),
),
)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
extras_require = {
':sys_platform != "win32"': ['terminado>=0.3.3'],
'test:python_version == "2.7"': ['mock'],
'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters'],
'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters', 'nbval'],
'test:sys_platform == "win32"': ['nose-exclude'],
}

Expand Down

0 comments on commit f315f23

Please sign in to comment.