-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to markdown-it-py parser #123
Changes from 17 commits
1d84c69
b078d0f
bc0f77f
303c537
4a42c10
12b0bf1
5306dc1
6be709d
22eb218
b8fb808
615d052
7d98dbf
0a1d53e
f20333d
e65142b
89a1779
6214cd9
626e5c5
d132cd2
4fcf732
cd83c70
77af8e1
95a0404
034be2a
c97d2d7
81d0bfb
e64898a
d53a9b5
826015f
63f0e3e
73db682
60ea3a2
e2c8252
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python package | ||
|
||
on: [push, pull_request] | ||
# push: | ||
# branches: [ master ] | ||
# pull_request: | ||
# branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install .[sphinx,code_style,testing] | ||
- name: Pre-commit checks | ||
run: | | ||
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) | ||
# cd tests/test_commonmark && ./spec.sh | ||
- name: Test with pytest | ||
run: | | ||
pip install pytest | ||
pytest --cov=myst_parser --cov-report= | ||
- name: Upload to coveralls | ||
run: | | ||
pip install coveralls | ||
coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_KEY }} | ||
|
||
publish: | ||
|
||
name: Publish to PyPi | ||
needs: build | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
Comment on lines
+48
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @choldgraf, you can give conditionals to each job. In this case the 'publish' job is triggered conditional on the 'build' job passing, and if the full process was triggered by creating a release tag on the repo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shit that's cool! I'm really liking github-actions (I know I know, you're not allowed to make fun of me every time I praise a microsoft product) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😆 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh I am one step ahead of you on that one ;-) even have a friend that works on Microsoft Azure helping out! https://github.com/ExecutableBookProject/cli/issues/44 |
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
- name: Build package | ||
run: | | ||
pip install wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Publish | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_KEY }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,5 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
_archive/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ python: | |
extra_requirements: | ||
- sphinx | ||
- rtd | ||
- requirements: docs/requirements.txt |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
include LICENSE | ||
include myst_parser/cli/spec.md |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
```{toctree} | ||
:maxdepth: 2 | ||
|
||
tokens.rst | ||
directive.rst | ||
renderers.rst | ||
sphinx_parser.rst | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,71 +3,69 @@ | |
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 | ||
.... | ||
These renderers take the markdown-it parsed token stream and convert it to | ||
the docutils AST. The sphinx renderer is a subclass of the docutils one, | ||
with some additional methods only available *via* sphinx | ||
.e.g. multi-document cross-referencing. | ||
|
||
.. autoclass:: myst_parser.html_renderer.HTMLRenderer | ||
:special-members: __init__, __enter__, __exit__ | ||
:members: default_block_tokens, default_span_tokens | ||
:undoc-members: | ||
:member-order: alphabetical | ||
:show-inheritance: | ||
|
||
Docutils | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from a dogfooding perspective I feel like these should be written in markdown :-) (not blocking this PR though) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason why its not is because, autodoc has to read the python docstrings as rST. I'm sure you could get it to read them as markdown (and rewrite all you doctrings as such), but I doubt its worth the hassle! |
||
........ | ||
|
||
JSON | ||
.... | ||
|
||
.. autoclass:: myst_parser.json_renderer.JsonRenderer | ||
:special-members: __init__, __enter__, __exit__ | ||
:members: default_block_tokens, default_span_tokens | ||
.. autoclass:: myst_parser.docutils_renderer.DocutilsRenderer | ||
:special-members: __output__, __init__ | ||
:members: render, nested_render_text, add_line_and_source_path, current_node_context | ||
:undoc-members: | ||
:member-order: alphabetical | ||
:member-order: bysource | ||
:show-inheritance: | ||
|
||
Docutils | ||
........ | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.DocutilsRenderer | ||
:special-members: __init__, __enter__, __exit__ | ||
:members: default_block_tokens, default_span_tokens, new_document | ||
Sphinx | ||
...... | ||
|
||
.. autoclass:: myst_parser.sphinx_renderer.SphinxRenderer | ||
:special-members: __output__ | ||
:members: handle_cross_reference, render_math_block_eqno | ||
:undoc-members: | ||
:member-order: alphabetical | ||
:show-inheritance: | ||
|
||
Mocking | ||
....... | ||
|
||
These classes are parsed to sphinx roles and directives, | ||
to mimic the original docutls rST specific parser elements, | ||
but instead run nested parsing with the markdown parser. | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.MockInliner | ||
. autoclass:: myst_parser.mocking.MockInliner | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.MockState | ||
.. autoclass:: myst_parser.mocking.MockState | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.MockStateMachine | ||
.. autoclass:: myst_parser.mocking.MockStateMachine | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.MockIncludeDirective | ||
.. autoclass:: myst_parser.mocking.MockIncludeDirective | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Sphinx | ||
...... | ||
|
||
.. autoclass:: myst_parser.docutils_renderer.SphinxRenderer | ||
:special-members: __init__, __enter__, __exit__ | ||
:members: default_block_tokens, default_span_tokens, mock_sphinx_env | ||
:undoc-members: | ||
:member-order: alphabetical | ||
:show-inheritance: | ||
Additional Methods | ||
.................. | ||
|
||
.. autofunction:: myst_parser.docutils_renderer.make_document | ||
|
||
.. autofunction:: myst_parser.docutils_renderer.dict_to_docinfo | ||
|
||
.. autofunction:: myst_parser.sphinx_renderer.minimal_sphinx_app | ||
|
||
.. autofunction:: myst_parser.sphinx_renderer.mock_sphinx_env |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is a publish vs. a build triggered? this seems like a useful way to automate releases, just not sure how it works :-)