Show More
@@ -100,14 +100,13 b' class Exporter(LoggingConfigurable):' | |||||
100 | def default_config(self): |
|
100 | def default_config(self): | |
101 | return Config() |
|
101 | return Config() | |
102 |
|
102 | |||
103 | @nbformat.docstring_nbformat_mod |
|
|||
104 | def from_notebook_node(self, nb, resources=None, **kw): |
|
103 | def from_notebook_node(self, nb, resources=None, **kw): | |
105 | """ |
|
104 | """ | |
106 | Convert a notebook from a notebook node instance. |
|
105 | Convert a notebook from a notebook node instance. | |
107 |
|
106 | |||
108 | Parameters |
|
107 | Parameters | |
109 | ---------- |
|
108 | ---------- | |
110 |
nb : :class:`~ |
|
109 | nb : :class:`~IPython.nbformat.current.NotebookNode` | |
111 | Notebook node |
|
110 | Notebook node | |
112 | resources : dict |
|
111 | resources : dict | |
113 | Additional resources that can be accessed read/write by |
|
112 | Additional resources that can be accessed read/write by |
@@ -27,7 +27,6 b' from IPython.utils.traitlets import MetaHasTraits, Unicode, List, Dict, Any' | |||||
27 | from IPython.utils.importstring import import_item |
|
27 | from IPython.utils.importstring import import_item | |
28 | from IPython.utils import py3compat, text |
|
28 | from IPython.utils import py3compat, text | |
29 |
|
29 | |||
30 | from IPython.nbformat.current import docstring_nbformat_mod |
|
|||
31 | from IPython.nbconvert import filters |
|
30 | from IPython.nbconvert import filters | |
32 | from .exporter import Exporter |
|
31 | from .exporter import Exporter | |
33 |
|
32 | |||
@@ -193,14 +192,13 b' class TemplateExporter(Exporter):' | |||||
193 | self.log.info("Loaded template %s", try_name) |
|
192 | self.log.info("Loaded template %s", try_name) | |
194 | break |
|
193 | break | |
195 |
|
194 | |||
196 | @docstring_nbformat_mod |
|
|||
197 | def from_notebook_node(self, nb, resources=None, **kw): |
|
195 | def from_notebook_node(self, nb, resources=None, **kw): | |
198 | """ |
|
196 | """ | |
199 | Convert a notebook from a notebook node instance. |
|
197 | Convert a notebook from a notebook node instance. | |
200 |
|
198 | |||
201 | Parameters |
|
199 | Parameters | |
202 | ---------- |
|
200 | ---------- | |
203 |
nb : :class:`~ |
|
201 | nb : :class:`~IPython.nbformat.current.NotebookNode` | |
204 | Notebook node |
|
202 | Notebook node | |
205 | resources : dict |
|
203 | resources : dict | |
206 | Additional resources that can be accessed read/write by |
|
204 | Additional resources that can be accessed read/write by |
@@ -2,7 +2,6 b'' | |||||
2 |
|
2 | |||
3 | from __future__ import print_function |
|
3 | from __future__ import print_function | |
4 |
|
4 | |||
5 | from xml.etree import ElementTree as ET |
|
|||
6 | import re |
|
5 | import re | |
7 |
|
6 | |||
8 | from IPython.utils.py3compat import unicode_type |
|
7 | from IPython.utils.py3compat import unicode_type | |
@@ -34,16 +33,6 b' current_nbformat_minor = nbformat_minor' | |||||
34 | current_nbformat_module = _v_latest.__name__ |
|
33 | current_nbformat_module = _v_latest.__name__ | |
35 |
|
34 | |||
36 |
|
35 | |||
37 | def docstring_nbformat_mod(func): |
|
|||
38 | """Decorator for docstrings referring to classes/functions accessed through |
|
|||
39 | nbformat.current. |
|
|||
40 |
|
||||
41 | Put {nbformat_mod} in the docstring in place of 'IPython.nbformat.v3'. |
|
|||
42 | """ |
|
|||
43 | func.__doc__ = func.__doc__.format(nbformat_mod=current_nbformat_module) |
|
|||
44 | return func |
|
|||
45 |
|
||||
46 |
|
||||
47 | class NBFormatError(ValueError): |
|
36 | class NBFormatError(ValueError): | |
48 | pass |
|
37 | pass | |
49 |
|
38 |
General Comments 0
You need to be logged in to leave comments.
Login now