Codebase list nb2plots / 880a014
add initial Debian packaging Sandro Tosi 6 years ago
9 changed file(s) with 311 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 nb2plots (0.6-1) unstable; urgency=low
1
2 * Initial release (closes: #NNNNNN)
3
4 -- Sandro Tosi <morph@debian.org> Sun, 15 Apr 2018 04:27:23 +0000
5
0 Source: nb2plots
1 Section: python
2 Priority: optional
3 Maintainer: Sandro Tosi <morph@debian.org>
4 Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
5 Build-Depends: debhelper (>= 9), dh-python,
6 python3-all,
7 python3-ipython,
8 python3-matplotlib,
9 python3-numpy,
10 python3-setuptools,
11 python3-six (>= 1.7.0),
12 python3-sphinx,
13 Standards-Version: 4.1.3
14 Homepage: http://github.com/matthew-brett/nb2plots
15 Vcs-Git: https://salsa.debian.org/python-team/modules/nb2plots.git
16 Vcs-Browser: https://salsa.debian.org/python-team/modules/nb2plots
17
18 Package: python3-nb2plots
19 Architecture: all
20 Depends: ${misc:Depends}, ${python3:Depends},
21 Recommends: ${python3:Recommends}
22 Suggests: ${python3:Suggests}
23 Description: Converting between ipython notebooks and sphinx docs
24 ##################################################
25 nb2plots - converting between notebooks and sphinx
26 ##################################################
27 .
28 See the nb2plots documentation_ for more information.
29 .
30 .. shared-text-body
31 .
32 ************
33 What it does
34 ************
35 .
36 ``nb2plots`` converts Jupyter_ notebooks to ReST_ files for Sphinx_, and back
37 again.
38 .
39 Nb2plots assumes that the ReST document will become the source for your Sphinx
40 web pages, but also for future versions of the notebook. The notebook may
41 serve as a draft for the polished ReST page, and an output format from the
42 Sphinx build. Why? Read on.
43 .
44 ****************************************
45 Why convert Jupyter notebooks to Sphinx?
46 ****************************************
47 .
48 Jupyter notebooks are just what the doctor ordered when hacking up a quick
49 tutorial, or preparing a software demo. The problems start when you want to
50 do not-trivial edits to the notebooks, or you need features that notebooks
51 don't have, such as flexible cross-referencing, extensible markup, and so on.
52 Notebooks are also painful to use with version control. These times make you
53 wish your notebook was in a standard extensible text format, such as ReST_.
54 .
55 You could convert your notebook to ReST using the standard `nbconvert`_
56 command, but this gives rather ugly ReST, and you lose all the nice code
57 execution and figure generation that the notebook is good at.
58 .
59 Enter Nb2plots. The ``nb2plots`` command converts notebooks to specially
60 formatted ReST pages. Use with::
61 .
62 nb2plots notebook.ipynb > with_plots.rst
63 .
64 Nb2plots converts your notebook to not-very-ugly ReST, where the code cells
65 become ``nbplot`` directives in your ReST file.
66 .
67 Specifically, a notebook code cell like this::
68 .
69 a = 1
70 .
71 becomes (in the ReST document)::
72 .
73 .. nbplot::
74 .
75 >>> a = 1
76 .
77 The ``nbplot`` directives run the contained code when Sphinx builds your ReST
78 files, and embed the results of any plots that your code makes. Actually,
79 ``nbplot`` is an extended and edited version of the `matplotlib plot
80 directive`_. Building your pages runs all the code and regenerates the
81 figures, and you get much of the reproducible goodness of the notebook
82 experience.
83 .
84 You can also run the standard Sphinx ``doctest`` extension over your pages to
85 check the doctest output of the code cells.
86 .
87 The ReST version of your notebook has many advantages - it is easier to edit
88 in your favorite text editor, and you can extend and configure the execution
89 and display of the code in several different ways. For example, you can hide
90 some code cells (Nbplot directives) if the code is not interesting to your
91 point, but you still want the generated figure. You can configure your Nbplot
92 directives to run different code for different configurations. For these
93 options, see |nbplot-documentation|. But - what do you lose, when going from
94 a notebook to a Nb2plots ReST document?
95 .
96 **********************************
97 I want notebooks and .py files too
98 **********************************
99 .
100 You may also want a version of your document that your users can execute.
101 Perhaps the page build is generating some tricky errors or warnings, and you
102 want to experiment with the code in the page interactively. Perhaps your
103 users are used to notebooks, and prefer the code in that format.
104 .
105 Nb2plots also contains Sphinx extensions that cause the Sphinx build to
106 generate Python code files and Jupyter notebooks from the ReST source. When
107 you add the Nb2plots ReST directive ``code-links`` to your ReST page, it will
108 cause the Sphinx build to create a Python code file and notebook versions of
109 your page, and adds download links to these versions::
110 .
111 .. code-links::
112 .
113 See |code-links-documentation| for details.
114 .
115 **************************
116 Show me what it looks like
117 **************************
118 .
119 For a very simple example, see |worked-example|.
120 .
121 For a moderate-sized teaching site that makes extensive use of Nb2plots, see
122 https://matthew-brett.github.com/teaching.
123 .
124 ************
0 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
1 Upstream-Name: nb2plots
2 Upstream-Contact: Matthew Brett <matthew.brett@gmail.com>
3 Source: http://github.com/matthew-brett/nb2plots
4
5 Files: *
6 Copyright: and Licenses
7 License: BSD license
8
9 Files: debian/*
10 Copyright: 2018 © Sandro Tosi <morph@debian.org>
11 License: BSD license
12
13 License: BSD license
14 .. _license:
15 .
16 **********************
17 Copyright and Licenses
18 **********************
19 .
20 nb2plots
21 ========
22 .
23 The nb2plots package, including all examples, code snippets and attached
24 documentation is covered by the 2-clause BSD license.
25 .
26 Copyright (c) 2015-2018, Matthew Brett
27 All rights reserved.
28 .
29 Redistribution and use in source and binary forms, with or without
30 modification, are permitted provided that the following conditions are
31 met:
32 .
33 1. Redistributions of source code must retain the above copyright notice,
34 this list of conditions and the following disclaimer.
35 .
36 2. Redistributions in binary form must reproduce the above copyright
37 notice, this list of conditions and the following disclaimer in the
38 documentation and/or other materials provided with the distribution.
39 .
40 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
41 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
42 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
44 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
45 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
46 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
47 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
48 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
49 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
50 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 .
52 3rd party code and data
53 =======================
54 .
55 Some code distributed within the nb2plots sources was developed by other
56 projects. This code is distributed under their respective licenses that are
57 listed below.
58 .
59 Matplotlib plot extension
60 -------------------------
61 .
62 The ``nbplots`` module is an edited version of
63 ``matplotlib/lib/matplotlib/sphinxext/plot_directive.py``.
64 .
65 Among the major changes are the following:
66 .
67 * rename of 'plot' directive to 'nbplot';
68 * rename of 'plot_*' configuration options to 'nbplot_*' equivalent;
69 * nbplot removes the option to point to Python script file rather than
70 using the code in the directive;
71 * nbplot keeps the namespace across directives in the same page, by default;
72 * include-source is True by default;
73 * nbplot can include multiple "parts" that can be selected via the
74 "render-parts" and "run-parts" options;
75 * do not use cached output when rebuilding page to avoid errors from stale
76 output;
77 * fix bug including empty parens when ``nofigs`` not specified (also fixed
78 upstream);
79 * empty ``setup_module`` to avoid breakage of nose doctests;
80 * fix of plot doctest.
81 .
82 The following license covers the plot directive code:
83 .
84 LICENSE AGREEMENT FOR MATPLOTLIB 1.2.0
85 --------------------------------------
86 .
87 1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the
88 Individual or Organization ("Licensee") accessing and otherwise using
89 matplotlib software in source or binary form and its associated
90 documentation.
91 .
92 2. Subject to the terms and conditions of this License Agreement, JDH
93 hereby grants Licensee a nonexclusive, royalty-free, world-wide license
94 to reproduce, analyze, test, perform and/or display publicly, prepare
95 derivative works, distribute, and otherwise use matplotlib 1.2.0
96 alone or in any derivative version, provided, however, that JDH's
97 License Agreement and JDH's notice of copyright, i.e., "Copyright (c)
98 2002-2011 John D. Hunter; All Rights Reserved" are retained in
99 matplotlib 1.2.0 alone or in any derivative version prepared by
100 Licensee.
101 .
102 3. In the event Licensee prepares a derivative work that is based on or
103 incorporates matplotlib 1.2.0 or any part thereof, and wants to
104 make the derivative work available to others as provided herein, then
105 Licensee hereby agrees to include in any such work a brief summary of
106 the changes made to matplotlib 1.2.0.
107 .
108 4. JDH is making matplotlib 1.2.0 available to Licensee on an "AS
109 IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
110 IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND
111 DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
112 FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 1.2.0
113 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
114 .
115 5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
116 1.2.0 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
117 LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
118 MATPLOTLIB 1.2.0, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
119 THE POSSIBILITY THEREOF.
120 .
121 6. This License Agreement will automatically terminate upon a material
122 breach of its terms and conditions.
123 .
124 7. Nothing in this License Agreement shall be deemed to create any
125 relationship of agency, partnership, or joint venture between JDH and
126 Licensee. This License Agreement does not grant permission to use JDH
127 trademarks or trade name in a trademark sense to endorse or promote
128 products or services of Licensee, or any third party.
129 .
130 8. By copying, installing or otherwise using matplotlib 1.2.0,
131 Licensee agrees to be bound by the terms and conditions of this License
132 Agreement.
133 .
134 rst2md
135 ------
136 .
137 The files nb2plots/doctree2md.py and scripts/rst2md derive from the
138 "markdown.py" and "rst2md.py" files from "rst2md" project by Chris Wrench:
139 https://github.com/cgwrench/rst2md
140 .
141 ``rst2md`` has the following license:
142 .
143 Copyright (c) 2012, C. G. Wrench <c.g.wrench@gmail.com>
144 All rights reserved.
145 .
146 Redistribution and use in source and binary forms, with or without
147 modification, are permitted provided that the following conditions are
148 met:
149 .
150 1. Redistributions of source code must retain the above copyright notice,
151 this list of conditions and the following disclaimer.
152 2. Redistributions in binary form must reproduce the above copyright
153 notice, this list of conditions and the following disclaimer in the
154 documentation and/or other materials provided with the distribution.
155 .
156 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
157 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
158 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
159 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
160 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
161 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
162 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
163 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
164 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
165 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
166 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0 #! /usr/bin/make -f
1
2 export PYBUILD_NAME=nb2plots
3 %:
4 dh $@ --with python3 --buildsystem=pybuild
0 3.0 (quilt)
0 extend-diff-ignore="^[^/]+.egg-info/"
0 # try also https://pypi.debian.net/nb2plots/watch
1 version=3
2 opts=uversionmangle=s/(rc|a|b|c)/~$1/ \
3 https://pypi.debian.net/nb2plots/nb2plots-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))