Hello community, here is the log from the commit of package python-jupyter_nbsphinx for openSUSE:Factory checked in at 2017-10-03 23:17:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-jupyter_nbsphinx (Old) and /work/SRC/openSUSE:Factory/.python-jupyter_nbsphinx.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jupyter_nbsphinx" Tue Oct 3 23:17:11 2017 rev:2 rq:527596 version:0.2.14 Changes: -------- --- /work/SRC/openSUSE:Factory/python-jupyter_nbsphinx/python-jupyter_nbsphinx.changes 2017-05-17 17:13:14.064386677 +0200 +++ /work/SRC/openSUSE:Factory/.python-jupyter_nbsphinx.new/python-jupyter_nbsphinx.changes 2017-10-03 23:17:11.587194621 +0200 @@ -1,0 +2,6 @@ +Tue Sep 19 20:55:07 UTC 2017 - toddrme2...@gmail.com + +- Update to 0.2.14 + * Add option ``nbsphinx_kernel_name`` + +------------------------------------------------------------------- Old: ---- nbsphinx-0.2.13.tar.gz New: ---- nbsphinx-0.2.14.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-jupyter_nbsphinx.spec ++++++ --- /var/tmp/diff_new_pack.2YAKMM/_old 2017-10-03 23:17:12.067127077 +0200 +++ /var/tmp/diff_new_pack.2YAKMM/_new 2017-10-03 23:17:12.067127077 +0200 @@ -18,34 +18,33 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-jupyter_nbsphinx -Version: 0.2.13 +Version: 0.2.14 Release: 0 Summary: Jupyter Notebook Tools for Sphinx License: MIT Group: Development/Languages/Python Url: https://github.com/spatialaudio/nbsphinx/ Source: https://files.pythonhosted.org/packages/source/n/nbsphinx/nbsphinx-%{version}.tar.gz -BuildRequires: fdupes -BuildRequires: python-rpm-macros +BuildRequires: %{python_module Sphinx >= 1.3.2} BuildRequires: %{python_module devel} -BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module Jinja2} -BuildRequires: %{python_module Sphinx} BuildRequires: %{python_module docutils} -BuildRequires: %{python_module jupyter_nbconvert} -BuildRequires: %{python_module jupyter_nbformat} BuildRequires: %{python_module jupyter_notebook} -BuildRequires: %{python_module sphinx_rtd_theme} +BuildRequires: %{python_module py} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros Requires: python-Jinja2 -Requires: python-Sphinx +Requires: python-Sphinx >= 1.3.2 Requires: python-docutils Requires: python-jupyter_nbconvert Requires: python-jupyter_nbformat -Requires: python-jupyter_notebook +Requires: python-py Requires: python-sphinx_rtd_theme Recommends: mathjax Recommends: pandoc -BuildRoot: %{_tmppath}/%{name}-%{version}-build +%ifpython2 +Recommends: python3-jupyter_nbsphinx +%endif BuildArch: noarch %python_subpackages ++++++ nbsphinx-0.2.13.tar.gz -> nbsphinx-0.2.14.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/LICENSE new/nbsphinx-0.2.14/LICENSE --- old/nbsphinx-0.2.13/LICENSE 2016-01-08 10:33:43.000000000 +0100 +++ new/nbsphinx-0.2.14/LICENSE 2017-06-09 19:53:29.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 2015-2016 Matthias Geier +Copyright (c) 2015-2017 Matthias Geier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/NEWS.rst new/nbsphinx-0.2.14/NEWS.rst --- old/nbsphinx-0.2.13/NEWS.rst 2017-01-25 20:02:24.000000000 +0100 +++ new/nbsphinx-0.2.14/NEWS.rst 2017-06-09 19:59:43.000000000 +0200 @@ -1,3 +1,6 @@ +Version 0.2.14 (2017-06-09): + * Add option ``nbsphinx_kernel_name`` + Version 0.2.13 (2017-01-25): * Minor fixes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/PKG-INFO new/nbsphinx-0.2.14/PKG-INFO --- old/nbsphinx-0.2.13/PKG-INFO 2017-01-25 20:03:52.000000000 +0100 +++ new/nbsphinx-0.2.14/PKG-INFO 2017-06-09 20:00:31.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: nbsphinx -Version: 0.2.13 +Version: 0.2.14 Summary: Jupyter Notebook Tools for Sphinx Home-page: http://nbsphinx.rtfd.io/ Author: Matthias Geier @@ -47,6 +47,7 @@ Platform: any Classifier: Framework :: Sphinx Classifier: Framework :: Sphinx :: Extension +Classifier: Framework :: Jupyter Classifier: Intended Audience :: Education Classifier: Intended Audience :: Science/Research Classifier: License :: OSI Approved :: MIT License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/doc/conf.py new/nbsphinx-0.2.14/doc/conf.py --- old/nbsphinx-0.2.13/doc/conf.py 2016-12-23 14:47:15.000000000 +0100 +++ new/nbsphinx-0.2.14/doc/conf.py 2017-06-09 19:53:29.000000000 +0200 @@ -22,6 +22,9 @@ # Execute notebooks before conversion: 'always', 'never', 'auto' (default) #nbsphinx_execute = 'never' +# Use this kernel instead of the one stored in the notebook metadata: +#nbsphinx_kernel_name = 'python3' + # List of arguments to be passed to the kernel that executes the notebooks: #nbsphinx_execute_arguments = ['--InlineBackend.figure_formats={"png", "pdf"}'] @@ -46,7 +49,7 @@ project = 'nbsphinx' author = 'Matthias Geier' -copyright = '2016, ' + author +copyright = '2017, ' + author linkcheck_ignore = [r'http://localhost:\d+/'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/doc/subdir/example.ipynb new/nbsphinx-0.2.14/doc/subdir/example.ipynb --- old/nbsphinx-0.2.13/doc/subdir/example.ipynb 1970-01-01 01:00:00.000000000 +0100 +++ new/nbsphinx-0.2.14/doc/subdir/example.ipynb 2017-03-29 22:00:02.000000000 +0200 @@ -0,0 +1,87 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# TEMS Tutorial: Data Download using MATLAB\n", + "* **How do I download TEMS data?**" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Check if get_tems_data method is in search path." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/var/matlab/ifog_analysis/get_tems_data.m\n" + ] + } + ], + "source": [ + "% check if get_tems_data method is in search path\n", + "which get_tems_data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "- Help information of get_tems_data." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "get_tems_data?" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Get some data." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Matlab", + "language": "matlab", + "name": "matlab" + }, + "language_info": { + "codemirror_mode": "octave", + "file_extension": ".m", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-matlab", + "name": "matlab", + "version": "0.13.0+3.g1ab53e8" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/doc/usage.ipynb new/nbsphinx-0.2.14/doc/usage.ipynb --- old/nbsphinx-0.2.13/doc/usage.ipynb 2016-12-23 13:48:39.000000000 +0100 +++ new/nbsphinx-0.2.14/doc/usage.ipynb 2017-05-10 19:21:54.000000000 +0200 @@ -17,10 +17,14 @@ "\n", "## Installation\n", "\n", + "### nbsphinx\n", + "\n", "Install `nbsphinx` with `pip`:\n", "\n", " python3 -m pip install nbsphinx --user\n", "\n", + "If you want to install it system-wide for all users (assuming you have the necessary rights), just drop the `--user` flag.\n", + "\n", "If you suddenly change your mind, you can un-install it with:\n", "\n", " python3 -m pip uninstall nbsphinx\n", @@ -29,6 +33,31 @@ "Recent versions of Python already come with `pip` pre-installed.\n", "If you don't have it, you can [install it manually](https://pip.pypa.io/en/latest/installing/).\n", "\n", + "To upgrade to the newest release, use the `--upgrade` flag:\n", + "\n", + " python3 -m pip install nbsphinx --upgrade --user\n", + "\n", + "If you don't want to use `pip`, you can also try to install `nbsphinx` with your package manager.\n", + "For example, there is a [package for conda-forge](https://anaconda.org/conda-forge/nbsphinx)\n", + "and packages for\n", + "[Debian](https://packages.debian.org/search?keywords=nbsphinx),\n", + "[Ubuntu](http://packages.ubuntu.com/search?keywords=nbsphinx), [Arch](https://aur.archlinux.org/packages/python-nbsphinx/)\n", + "and [Gentoo](https://packages.gentoo.org/packages/dev-python/nbsphinx) Linux.\n", + "Note that those might not provide the latest releases.\n", + "\n", + "### pandoc\n", + "\n", + "The stand-alone program [pandoc](http://pandoc.org/) is used to convert Markdown content to something Sphinx can understand. You have to install this program separately, ideally with your package manager. If you are using `conda`, you can select the [conda-forge](https://conda-forge.github.io/) channel to install the [pandoc](https://anaconda.org/conda-forge/pandoc) package.\n", + "If that doesn't work out for you, have a look at `pandoc`'s [installation instructions](http://pandoc.org/installing.html).\n", + "\n", + "<div class=\"alert alert-info\">\n", + "\n", + "**Note:**\n", + "\n", + "The use of `pandoc` in `nbsphinx` is temporary, but will likely stay that way for a long time, see [issue #36](https://github.com/spatialaudio/nbsphinx/issues/36).\n", + "\n", + "</div>\n", + "\n", "### Syntax Highlighting\n", "\n", "To get proper syntax highlighting in code cells, you'll need an appropriate *Pygments lexer*.\n", @@ -40,6 +69,20 @@ "\n", "You'll most likely have this installed already.\n", "\n", + "\n", + "<div class=\"alert alert-info\">\n", + "\n", + "**Note:**\n", + "\n", + "If you are using Anaconda and syntax highlighting in code cells doesn't seem to work,\n", + "you can try to install IPython with `pip`, or as a work-around,\n", + "add `'IPython.sphinxext.ipython_console_highlighting'` to `extensions` in my `conf.py`.\n", + "\n", + "For details, see [Anaconda issue #1430](https://github.com/ContinuumIO/anaconda-issues/issues/1430) and\n", + "[nbsphinx issue #24](https://github.com/spatialaudio/nbsphinx/issues/24).\n", + "\n", + "</div>\n", + "\n", "### Jupyter Kernel\n", "\n", "If you want to execute your notebooks during the Sphinx build process (see [Executing Notebooks](executing-notebooks.ipynb)), you need an appropriate [Jupyter kernel](http://jupyter.readthedocs.io/en/latest/projects/kernels.html) installed.\n", @@ -222,7 +265,7 @@ " channels:\n", " - conda-forge\n", " dependencies:\n", - " - python>=3\n", + " - python==3.5\n", " - sphinx>=1.4\n", " - pandoc\n", " - nbconvert\n", @@ -241,8 +284,6 @@ "\n", "The specification of the `conda-forge` channel is necessary for the `pandoc` package, which is not part of the default channel.\n", "\n", - "The currently pre-installed version of `pandoc` doesn't seem to convert HTML5 `<audio>` elements correctly. See [nbsphinx issue #69](https://github.com/spatialaudio/nbsphinx/issues/69) and [readthedocs.org issue #2521](https://github.com/rtfd/readthedocs.org/issues/2521).\n", - "\n", "</div>\n", "\n", "<div class=\"alert alert-info\">\n", @@ -348,6 +389,10 @@ " [example](http://nbsphinx.readthedocs.io/en/julia-theme/),\n", " [usage](https://github.com/spatialaudio/nbsphinx/compare/julia-theme^...julia-theme)\n", "\n", + "* [jupyter](https://github.com/jupyter/jupyter-sphinx-theme/):\n", + " [example](http://nbsphinx.readthedocs.io/en/jupyter-theme/),\n", + " [usage](https://github.com/spatialaudio/nbsphinx/compare/jupyter-theme^...jupyter-theme)\n", + "\n", "If you know of another Sphinx theme that should be included here, please open an [issue on Github](https://github.com/spatialaudio/nbsphinx/issues)." ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/nbsphinx.egg-info/PKG-INFO new/nbsphinx-0.2.14/nbsphinx.egg-info/PKG-INFO --- old/nbsphinx-0.2.13/nbsphinx.egg-info/PKG-INFO 2017-01-25 20:03:51.000000000 +0100 +++ new/nbsphinx-0.2.14/nbsphinx.egg-info/PKG-INFO 2017-06-09 20:00:30.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: nbsphinx -Version: 0.2.13 +Version: 0.2.14 Summary: Jupyter Notebook Tools for Sphinx Home-page: http://nbsphinx.rtfd.io/ Author: Matthias Geier @@ -47,6 +47,7 @@ Platform: any Classifier: Framework :: Sphinx Classifier: Framework :: Sphinx :: Extension +Classifier: Framework :: Jupyter Classifier: Intended Audience :: Education Classifier: Intended Audience :: Science/Research Classifier: License :: OSI Approved :: MIT License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/nbsphinx.egg-info/SOURCES.txt new/nbsphinx-0.2.14/nbsphinx.egg-info/SOURCES.txt --- old/nbsphinx-0.2.13/nbsphinx.egg-info/SOURCES.txt 2017-01-25 20:03:52.000000000 +0100 +++ new/nbsphinx-0.2.14/nbsphinx.egg-info/SOURCES.txt 2017-06-09 20:00:31.000000000 +0200 @@ -27,6 +27,7 @@ doc/images/raw_cells.png doc/images/stickfigure.png doc/subdir/a-notebook-in-a-subdir.ipynb +doc/subdir/example.ipynb doc/subdir/toctree.ipynb nbsphinx.egg-info/PKG-INFO nbsphinx.egg-info/SOURCES.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/nbsphinx.py new/nbsphinx-0.2.14/nbsphinx.py --- old/nbsphinx-0.2.13/nbsphinx.py 2017-01-25 20:02:43.000000000 +0100 +++ new/nbsphinx-0.2.14/nbsphinx.py 2017-06-09 19:57:24.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (c) 2015-2016 Matthias Geier +# Copyright (c) 2015-2017 Matthias Geier # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,7 +23,7 @@ http://nbsphinx.rtfd.org/ """ -__version__ = '0.2.13' +__version__ = '0.2.14' import copy import json @@ -141,8 +141,9 @@ {%- elif datatype in ['text/latex'] %} .. math:: + :nowrap: -{{ output.data['text/latex'] | strip_dollars | indent | indent }} +{{ output.data['text/latex'] | indent | indent }} {%- elif datatype == 'text/html' %} .. raw:: html @@ -175,10 +176,14 @@ .. raw:: latex - % This comment is needed to force a line break for adjacent ANSI cells + % \\begin{OriginalVerbatim}[commandchars=\\\\\\{\\}] {{ output.data[datatype] | ansi2latex | indent | indent }} \\end{OriginalVerbatim} + % The following \\relax is needed to avoid problems with adjacent ANSI + % cells and some other stuff (e.g. bullet lists) following ANSI cells. + % See https://github.com/sphinx-doc/sphinx/issues/3594 + \\relax {% else %} .. nbwarning:: Data type cannot be displayed: {{ datatype }} @@ -225,6 +230,7 @@ .. raw:: latex + % {{ cell.source | indent }} {%- elif raw_mimetype == 'text/html' %} .. raw:: html @@ -233,6 +239,7 @@ {%- elif raw_mimetype == 'text/latex' %} .. raw:: latex + % {{ cell.source | indent }} {%- elif raw_mimetype == 'text/markdown' %} {{ cell.source | markdown2rst }} @@ -477,6 +484,32 @@ } """ +CSS_STRING_CLOUD = """ +/* CSS overrides for cloud theme */ + +/* nicer titles and more space for info and warning logos */ + +div.admonition > .first { + background: rgba(0, 0, 0, .05); + margin: .5em -1em; + margin-top: -.5em !important; + padding: .5em .5em .5em 2.65em; +} + +/* indent single paragraph */ +div.admonition { + text-indent: 20px; +} +/* don't indent multiple paragraphs */ +div.admonition > p { + text-indent: 0; +} +/* remove excessive padding */ +div.admonition.inline-title p.admonition-title { + padding-left: .2em; +} +""" + class Exporter(nbconvert.RSTExporter): """Convert Jupyter notebooks to reStructuredText. @@ -489,10 +522,11 @@ """ - def __init__(self, execute='auto', execute_arguments=[], + def __init__(self, execute='auto', kernel_name='', execute_arguments=[], allow_errors=False, timeout=30, codecell_lexer='none'): """Initialize the Exporter.""" self._execute = execute + self._kernel_name = kernel_name self._execute_arguments = execute_arguments self._allow_errors = allow_errors self._timeout = timeout @@ -500,9 +534,10 @@ loader = jinja2.DictLoader({'nbsphinx-rst.tpl': RST_TEMPLATE}) super(Exporter, self).__init__( template_file='nbsphinx-rst.tpl', extra_loaders=[loader], - config= traitlets.config.Config( + config=traitlets.config.Config( {'HighlightMagicsPreprocessor': {'enabled': True}}), filters={ + 'convert_pandoc': convert_pandoc, 'markdown2rst': markdown2rst, 'get_empty_lines': _get_empty_lines, 'extract_toctree': _extract_toctree, @@ -537,6 +572,7 @@ 'allow_errors', self._allow_errors) timeout = nbsphinx_metadata.get('timeout', self._timeout) pp = nbconvert.preprocessors.ExecutePreprocessor( + kernel_name=self._kernel_name, extra_arguments=self._execute_arguments, allow_errors=allow_errors, timeout=timeout) nb, resources = pp.preprocess(nb, resources) @@ -587,6 +623,7 @@ exporter = Exporter( execute=env.config.nbsphinx_execute, + kernel_name=env.config.nbsphinx_kernel_name, execute_arguments=env.config.nbsphinx_execute_arguments, allow_errors=env.config.nbsphinx_allow_errors, timeout=env.config.nbsphinx_timeout, @@ -762,6 +799,18 @@ _class = 'warning' +def convert_pandoc(text, from_format, to_format): + """Simple wrapper for markdown2rst. + + In nbconvert version 5.0, the use of markdown2rst in the RST + template was replaced by the new filter function convert_pandoc. + + """ + if from_format != 'markdown' and to_format != 'rst': + raise ValueError('Unsupported conversion') + return markdown2rst(text) + + def markdown2rst(text): """Convert a Markdown string to reST via pandoc. @@ -778,7 +827,8 @@ 't': 'Math', 'c': [ {'t': 'DisplayMath', 'c': []}, - obj['c'][1], + # Special marker characters are removed below: + '\x0e:nowrap:\x0f\n\n' + obj['c'][1], ] }] return obj @@ -788,8 +838,8 @@ return json.dumps(json_data) rststring = pandoc(text, 'markdown', 'rst', filter_func=rawlatex2math) - return re.sub(r'^(\s*)\.\. math::$', - r'\1.. math::\1 :nowrap:', + return re.sub(r'^\n( *)\x0e:nowrap:\x0f$', + r'\1:nowrap:', rststring, flags=re.MULTILINE) @@ -1113,6 +1163,8 @@ style += CSS_STRING % app.config if doctree and app.config.html_theme in ('sphinx_rtd_theme', 'julia'): style += CSS_STRING_READTHEDOCS + if doctree and app.config.html_theme in ('cloud', 'redcloud'): + style += CSS_STRING_CLOUD if style: context['body'] = '\n<style>' + style + '</style>\n' + context['body'] @@ -1260,6 +1312,7 @@ _add_notebook_parser(app) app.add_config_value('nbsphinx_execute', 'auto', rebuild='env') + app.add_config_value('nbsphinx_kernel_name', '', rebuild='env') app.add_config_value('nbsphinx_execute_arguments', [], rebuild='env') app.add_config_value('nbsphinx_allow_errors', False, rebuild='') app.add_config_value('nbsphinx_timeout', 30, rebuild='') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/setup.cfg new/nbsphinx-0.2.14/setup.cfg --- old/nbsphinx-0.2.13/setup.cfg 2017-01-25 20:03:52.000000000 +0100 +++ new/nbsphinx-0.2.14/setup.cfg 2017-06-09 20:00:31.000000000 +0200 @@ -1,5 +1,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nbsphinx-0.2.13/setup.py new/nbsphinx-0.2.14/setup.py --- old/nbsphinx-0.2.13/setup.py 2016-12-23 13:48:39.000000000 +0100 +++ new/nbsphinx-0.2.14/setup.py 2017-06-09 19:53:29.000000000 +0200 @@ -29,6 +29,7 @@ classifiers=[ 'Framework :: Sphinx', 'Framework :: Sphinx :: Extension', + 'Framework :: Jupyter', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License',