Show More
@@ -100,14 +100,13 b' class Exporter(LoggingConfigurable):' | |||
|
100 | 100 | def default_config(self): |
|
101 | 101 | return Config() |
|
102 | 102 | |
|
103 | @nbformat.docstring_nbformat_mod | |
|
104 | 103 | def from_notebook_node(self, nb, resources=None, **kw): |
|
105 | 104 | """ |
|
106 | 105 | Convert a notebook from a notebook node instance. |
|
107 | 106 | |
|
108 | 107 | Parameters |
|
109 | 108 | ---------- |
|
110 |
nb : :class:`~ |
|
|
109 | nb : :class:`~IPython.nbformat.current.NotebookNode` | |
|
111 | 110 | Notebook node |
|
112 | 111 | resources : dict |
|
113 | 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 | 27 | from IPython.utils.importstring import import_item |
|
28 | 28 | from IPython.utils import py3compat, text |
|
29 | 29 | |
|
30 | from IPython.nbformat.current import docstring_nbformat_mod | |
|
31 | 30 | from IPython.nbconvert import filters |
|
32 | 31 | from .exporter import Exporter |
|
33 | 32 | |
@@ -193,14 +192,13 b' class TemplateExporter(Exporter):' | |||
|
193 | 192 | self.log.info("Loaded template %s", try_name) |
|
194 | 193 | break |
|
195 | 194 | |
|
196 | @docstring_nbformat_mod | |
|
197 | 195 | def from_notebook_node(self, nb, resources=None, **kw): |
|
198 | 196 | """ |
|
199 | 197 | Convert a notebook from a notebook node instance. |
|
200 | 198 | |
|
201 | 199 | Parameters |
|
202 | 200 | ---------- |
|
203 |
nb : :class:`~ |
|
|
201 | nb : :class:`~IPython.nbformat.current.NotebookNode` | |
|
204 | 202 | Notebook node |
|
205 | 203 | resources : dict |
|
206 | 204 | Additional resources that can be accessed read/write by |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | |
|
3 | 3 | from __future__ import print_function |
|
4 | 4 | |
|
5 | from xml.etree import ElementTree as ET | |
|
6 | 5 | import re |
|
7 | 6 | |
|
8 | 7 | from IPython.utils.py3compat import unicode_type |
@@ -34,16 +33,6 b' current_nbformat_minor = nbformat_minor' | |||
|
34 | 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 | 36 | class NBFormatError(ValueError): |
|
48 | 37 | pass |
|
49 | 38 |
General Comments 0
You need to be logged in to leave comments.
Login now