File: api.rst

package info (click to toggle)
myst-nb 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,384 kB
  • sloc: python: 6,066; xml: 1,434; makefile: 33
file content (101 lines) | stat: -rw-r--r-- 2,346 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
.. _api/main:

Python API
==========

The parsing of a notebook consists of a number of stages, with each stage separated into a separate module:

1. The configuration is set (from a file or CLI)
2. The parser is called with an input string and source
3. The parser reads the input string to a notebook node
4. The notebook is converted to a Markdown-It tokens syntax tree
5. The notebook code outputs are potentially updated, via execution or from a cache
6. The syntax tree is transformed to a docutils document AST (calling the renderer plugin)
7. The docutils document is processed by docutils/sphinx, to create the desired output format(s)

Configuration
-------------

.. autoclass:: myst_nb.core.config.NbParserConfig
    :members:

Parsers
-------

.. autoclass:: myst_nb.docutils_.Parser
    :members:

.. autoclass:: myst_nb.sphinx_.Parser
    :members:

Read
----

.. autoclass:: myst_nb.core.read.NbReader
    :members:

.. autofunction:: myst_nb.core.read.create_nb_reader

.. autofunction:: myst_nb.core.read.is_myst_markdown_notebook

.. autofunction:: myst_nb.core.read.read_myst_markdown_notebook

Execute
-------

.. autofunction:: myst_nb.core.execute.create_client

.. autoclass:: myst_nb.core.execute.base.NotebookClientBase
    :members:

.. autoclass:: myst_nb.core.execute.direct.NotebookClientDirect

.. autoclass:: myst_nb.core.execute.cache.NotebookClientCache

.. autoclass:: myst_nb.core.execute.inline.NotebookClientInline

.. autoexception:: myst_nb.core.execute.base.ExecutionError

.. autoexception:: myst_nb.core.execute.base.EvalNameError

.. autoclass:: myst_nb.core.execute.base.ExecutionResult
    :members:

Render plugin
-------------

.. autoclass:: myst_nb.core.render.MimeData
    :members:

.. autoclass:: myst_nb.core.render.NbElementRenderer
    :members:

.. autoclass:: myst_nb.core.render.MimeRenderPlugin
    :members:
    :undoc-members:

.. autoclass:: myst_nb.core.render.ExampleMimeRenderPlugin
    :members:
    :undoc-members:

Lexers
------

.. autoclass:: myst_nb.core.lexers.AnsiColorLexer
    :members:
    :undoc-members:
    :show-inheritance:

Loggers
-------

.. autoclass:: myst_nb.core.loggers.DocutilsDocLogger
    :members:
    :undoc-members:
    :show-inheritance:


.. autoclass:: myst_nb.core.loggers.SphinxDocLogger
    :members:
    :undoc-members:
    :show-inheritance: