-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve API documentaion and add Inter-sphinx references (#109)
Also: * Make `MystParser` a sub-class of `sphinx.parsers.Parser` Rather than `docutils.parsers.Parser` (which sphinx sub-classes) * Improve API documentation, and add intersphinx links * mistletoe dependency version bump
- Loading branch information
1 parent
786d99b
commit 40b4de4
Showing
14 changed files
with
190 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
api/ | ||
_build/ | ||
_api/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(api/main)= | ||
|
||
# MyST-Parser API | ||
|
||
```{toctree} | ||
:maxdepth: 2 | ||
tokens.rst | ||
renderers.rst | ||
sphinx_parser.rst | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.. _api/renderers: | ||
|
||
MyST Renderers | ||
-------------- | ||
|
||
MyST-Parser builds on the mistletoe | ||
:ref:`core renderers <mistletoe:renderers/core>` | ||
by including the extended tokens, listed in :ref:`api/tokens`, | ||
and adding bridges to docutils/sphinx: | ||
|
||
HTML | ||
.... | ||
|
||
.. autoclass:: myst_parser.html_renderer.HTMLRenderer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
JSON | ||
.... | ||
|
||
.. autoclass:: myst_parser.json_renderer.JsonRenderer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Docutils | ||
........ | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.DocutilsRenderer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
|
||
.. autoclass:: myst_parser.docutils_renderer.MockInliner | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.MockState | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.MockStateMachine | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.MockIncludeDirective | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Sphinx | ||
...... | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.SphinxRenderer | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.. _api/sphinx_parser: | ||
|
||
Sphinx Parser | ||
------------- | ||
|
||
This class builds on the :py:class:`~myst_parser.docutils_renderer.SphinxRenderer` | ||
to generate a parser for Sphinx, using the :ref:`Sphinx parser API <sphinx:parser-api>`: | ||
|
||
.. autoclass:: myst_parser.sphinx_parser.MystParser | ||
:members: | ||
:no-undoc-members: | ||
:show-inheritance: | ||
:exclude-members: __init__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.. _api/tokens: | ||
|
||
Extended AST Tokens | ||
------------------- | ||
|
||
MyST builds on the mistletoe | ||
:ref:`core block tokens <mistletoe:tokens/block>` and | ||
:ref:`core span tokens <mistletoe:tokens/span>` | ||
to extend the syntax (as discussed in :ref:`example_syntax`). | ||
|
||
.. seealso:: | ||
|
||
:ref:`example_syntax` | ||
|
||
|
||
LineComment | ||
........... | ||
|
||
.. autoclass:: myst_parser.block_tokens.LineComment | ||
:members: | ||
:no-undoc-members: | ||
:show-inheritance: | ||
:exclude-members: __init__ | ||
|
||
|
||
BlockBreak | ||
.......... | ||
|
||
.. autoclass:: myst_parser.block_tokens.BlockBreak | ||
:members: | ||
:no-undoc-members: | ||
:show-inheritance: | ||
:exclude-members: __init__ | ||
|
||
|
||
Role | ||
.... | ||
|
||
.. autoclass:: myst_parser.span_tokens.Role | ||
:members: | ||
:no-undoc-members: | ||
:show-inheritance: | ||
:exclude-members: __init__ | ||
|
||
|
||
Math | ||
.... | ||
|
||
.. autoclass:: myst_parser.span_tokens.Math | ||
:members: | ||
:no-undoc-members: | ||
:show-inheritance: | ||
:exclude-members: __init__ | ||
|
||
|
||
Target | ||
...... | ||
|
||
.. autoclass:: myst_parser.span_tokens.Target | ||
:members: | ||
:no-undoc-members: | ||
:show-inheritance: | ||
:exclude-members: __init__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = "0.4.0" | ||
__version__ = "0.4.1" | ||
|
||
|
||
def text_to_tokens(text: str): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters