Show More
@@ -13,6 +13,10 b' from . import v2' | |||
|
13 | 13 | from . import v3 |
|
14 | 14 | from . import v4 |
|
15 | 15 | |
|
16 | __all__ = ['versions', 'validate', 'ValidationError', 'convert', 'from_dict', | |
|
17 | 'NotebookNode', 'current_nbformat', 'current_nbformat_minor', | |
|
18 | 'NBFormatError', 'NO_CONVERT', 'reads', 'read', 'writes', 'write'] | |
|
19 | ||
|
16 | 20 | versions = { |
|
17 | 21 | 1: v1, |
|
18 | 22 | 2: v2, |
@@ -1,20 +1,16 b'' | |||
|
1 | 1 | """The main API for the v3 notebook format. |
|
2 | ||
|
3 | Authors: | |
|
4 | ||
|
5 | * Brian Granger | |
|
6 | 2 | """ |
|
7 | 3 | |
|
8 | #----------------------------------------------------------------------------- | |
|
9 | # Copyright (C) 2008-2011 The IPython Development Team | |
|
10 | # | |
|
11 | # Distributed under the terms of the BSD License. The full license is in | |
|
12 | # the file COPYING, distributed as part of this software. | |
|
13 | #----------------------------------------------------------------------------- | |
|
4 | # Copyright (c) IPython Development Team. | |
|
5 | # Distributed under the terms of the Modified BSD License. | |
|
14 | 6 | |
|
15 | #----------------------------------------------------------------------------- | |
|
16 | # Imports | |
|
17 | #----------------------------------------------------------------------------- | |
|
7 | __all__ = ['NotebookNode', 'new_code_cell', 'new_text_cell', 'new_notebook', | |
|
8 | 'new_output', 'new_worksheet', 'new_metadata', 'new_author', | |
|
9 | 'new_heading_cell', 'nbformat', 'nbformat_minor', 'nbformat_schema', | |
|
10 | 'reads_json', 'writes_json', 'read_json', 'write_json', | |
|
11 | 'to_notebook_json', 'reads_py', 'writes_py', 'read_py', 'write_py', | |
|
12 | 'to_notebook_py', 'downgrade', 'upgrade', 'parse_filename' | |
|
13 | ] | |
|
18 | 14 | |
|
19 | 15 | import os |
|
20 | 16 | |
@@ -35,9 +31,6 b' from .nbpy import to_notebook as to_notebook_py' | |||
|
35 | 31 | |
|
36 | 32 | from .convert import downgrade, upgrade |
|
37 | 33 | |
|
38 | #----------------------------------------------------------------------------- | |
|
39 | # Code | |
|
40 | #----------------------------------------------------------------------------- | |
|
41 | 34 | |
|
42 | 35 | def parse_filename(fname): |
|
43 | 36 | """Parse a notebook filename. |
@@ -3,6 +3,10 b'' | |||
|
3 | 3 | # Copyright (c) IPython Development Team. |
|
4 | 4 | # Distributed under the terms of the Modified BSD License. |
|
5 | 5 | |
|
6 | __all__ = ['nbformat', 'nbformat_minor', 'nbformat_schema', 'new_code_cell', | |
|
7 | 'new_markdown_cell', 'new_notebook', 'new_output', 'output_from_msg', | |
|
8 | 'reads', 'writes', 'to_notebook', 'downgrade', 'upgrade'] | |
|
9 | ||
|
6 | 10 | from .nbbase import ( |
|
7 | 11 | nbformat, nbformat_minor, nbformat_schema, |
|
8 | 12 | new_code_cell, new_markdown_cell, new_notebook, |
@@ -73,7 +73,8 b' def upgrade(nb, from_version=3, from_minor=0):' | |||
|
73 | 73 | def upgrade_cell(cell): |
|
74 | 74 | """upgrade a cell from v3 to v4 |
|
75 | 75 | |
|
76 |
heading cell |
|
|
76 | heading cell: | |
|
77 | - -> markdown heading | |
|
77 | 78 | code cell: |
|
78 | 79 | - remove language metadata |
|
79 | 80 | - cell.input -> cell.source |
@@ -21,8 +21,8 b" if __name__ == '__main__':" | |||
|
21 | 21 | # Extensions are documented elsewhere. |
|
22 | 22 | r'\.extensions', |
|
23 | 23 | r'\.config\.profile', |
|
24 |
# |
|
|
25 |
r'\.nbformat\.v |
|
|
24 | # Old nbformat versions | |
|
25 | r'\.nbformat\.v[1-2]', | |
|
26 | 26 | # Public API for this is in kernel.zmq.eventloops |
|
27 | 27 | r'\.kernel\.zmq\.gui', |
|
28 | 28 | # Magics are documented separately |
@@ -41,14 +41,21 b" if __name__ == '__main__':" | |||
|
41 | 41 | r'\.core\.magics\.deprecated', |
|
42 | 42 | # We document this manually. |
|
43 | 43 | r'\.utils\.py3compat', |
|
44 |
# These are exposed by nbformat |
|
|
44 | # These are exposed by nbformat | |
|
45 | 45 | r'\.nbformat\.convert', |
|
46 | 46 | r'\.nbformat\.validator', |
|
47 | r'\.nbformat\.notebooknode', | |
|
48 | # Deprecated | |
|
49 | r'\.nbformat\.current', | |
|
50 | # Exposed by nbformat.vN | |
|
51 | r'\.nbformat\.v[3-4]\.nbbase', | |
|
47 | 52 | # These are exposed in display |
|
48 | 53 | r'\.core\.display', |
|
49 | 54 | r'\.lib\.display', |
|
50 | 55 | # This isn't actually a module |
|
51 | 56 | r'\.html\.tasks', |
|
57 | # This is private | |
|
58 | r'\.html\.allow76' | |
|
52 | 59 | ] |
|
53 | 60 | |
|
54 | 61 | # These modules import functions and classes from other places to expose |
@@ -56,7 +63,9 b" if __name__ == '__main__':" | |||
|
56 | 63 | # non-API modules they import from should be excluded by the skip patterns |
|
57 | 64 | # above. |
|
58 | 65 | docwriter.names_from__all__.update({ |
|
59 |
'IPython.nbformat |
|
|
66 | 'IPython.nbformat', | |
|
67 | 'IPython.nbformat.v3', | |
|
68 | 'IPython.nbformat.v4', | |
|
60 | 69 | 'IPython.display', |
|
61 | 70 | }) |
|
62 | 71 |
General Comments 0
You need to be logged in to leave comments.
Login now