-
Notifications
You must be signed in to change notification settings - Fork 196
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
Plugin output is not being rendered #702
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
It seems like perhaps MyST-Parser's This might also explain what was going wrong in my WIP patch in #632 |
Ohh, I see, it's because the overridden render methods produces docutils AST nodes, correct? And the plugins produce HTML strings, which is why all the currently supported plugins have their equivalent render_xyz methods in the |
Heya, yep indeed myst-parser intentionally does not expose markdown-it-py as the underlying markdown parser, it would not be maintainable to support such an API. If you want to have a look at contributing your plugin to https://github.com/executablebooks/mdit-py-plugins, we can look to add it to myst-parser as an extension 😄 |
@chrisjsewell ah, yeah, I was just at that docutils link, although not quite sure how to write the I figured I can make a custom renderer by subclassing
I'm at least getting the Some tips on what I should be producing in |
Yeh no worries, if you get the PR into executablebooks/mdit-py-plugins, I should be able to take care of the myst-parser side (it should be relatively straight forward) |
@chrisjsewell any chance you can help me out with the myst-parser side as the plugin exists atm? I'd like to be able to start using in my own project ;-) |
Describe the bug
context
I've written a port of markdown-it-abbr to python, but when used with MyST-Parser, the replacement tokens are missing, due to an error of
WARNING: No render method for: abbr [myst.render]
.expectation
In the rendered HTML, I expected the
<abbr>
HTML tag and content to be output.E.g. the following markdown:
should generate:
bug
Instead, it generates:
I added
print(nodes)
at https://github.com/jessicah/mdit-py-abbr/blob/main/mdit_py_abbr/index.py#L157, and it showed up fine in console:So the token stream itself seems correct. Also, using markdown-it-py directly works correctly.
I did try adding a render method, but it had no effect. E.g.:
and
Reproduce the bug
I've created an example repo: https://github.com/jessicah/myst-demo
make [all]
runssphinx-build
, andmake test
runs the test file.List your environment
myst_parser: 0.18.1
sphinx: 5.3.0
docutils: 0.17.1
markdown_it: 1.1.0
The text was updated successfully, but these errors were encountered: