-
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
Move sphinx and docutils to optional dependencies #342
Comments
No, this is a sphinx extension, if they want to use just the parser, then that's what markdown-it-py is for. |
Maybe another way of phrasing this question - I think that the Python library could be useful for others outside of the Sphinx use case. Is there a way that we could offer this to others without requiring them to rewrite it from scratch with their own markdown it py config? If not, i agree with your assessment that documenting how to recreate a myst parser with markdown it py would be helpful |
I disagree: this is literally all the code that would be made available: from markdown_it import MarkdownIt
from mdit_py_plugins.dollarmath import dollarmath_plugin
from mdit_py_plugins.footnote import footnote_plugin
from mdit_py_plugins.front_matter import front_matter_plugin
from mdit_py_plugins.myst_blocks import myst_block_plugin
from mdit_py_plugins.myst_role import myst_role_plugin
md = (
MarkdownIt("commonmark")
.enable("table")
.use(front_matter_plugin)
.use(myst_block_plugin)
.use(myst_role_plugin)
.use(footnote_plugin)
.disable("footnote_inline")
.disable("footnote_tail")
.use(dollarmath_plugin) # potentially optional
) Also, sphinx was previously an extra and changed to a core requirement because it added extra complexity and the chance for broken dependency versions, for the core use-case as a sphinx extension, |
If you didn't want this to be the case, then you should have objected here: #170 (comment) 😜 |
Then I think we should document this pattern for others to follow, since the myst parser repo is also effectively the reference implementation this could be a helpful way for others to apply the myst spec in other contexts. I'll close this and re open another issue |
👍 |
(Coming from here https://twitter.com/juanluisback/status/1379101793653776387) Hi @chrisjsewell! I was surprised to see docutils 0.17 add experimental Markdown support using Recommonmark, so I found this thread on docutils-users https://sourceforge.net/p/docutils/mailman/docutils-users/thread/rkv4nb%24139g%241%40ciao.gmane.io/#msg37118232 (in which you participated I believe) and that's what sparked my original question to @choldgraf about the optional dependencies of myst-parser. It sounds like docutils could potentially use https://github.com/executablebooks/markdown-it-py for its Markdown support then? |
Yep, i think that is the answer. |
Grr you and me both, and I completely missed the response on the email thread. Ah well that's a different proposition: I literally have myst_parser/docutils_renderer.py and myst_parser/sphinx_renderer.py as a sub-class, so that it is certainly possible to use myst-parser with "docutils only" functionality. If I had known previously about such an intention to ship Markdown in docutils, I would certainly have considered splitting the "docutils only" aspects in to a separate "myst-docutils" package (and have that as a dependency here), which I think would probably be a better solution than just moving dependencies to extras. @choldgraf you've been promising to talk to the recommonmark guys about potentially combining our efforts (indeed myst-parser evolved from the recommonmark code), get on it! 😉 |
I now work on Read the Docs, so although it's still a bit bold to call me one of the "recommonmark guys", I'd love to stay in the loop of such conversations. If the release cadence of docutils is ~once a year, I'd say we have enough time to give this a try :) |
Ah fair lol
yep absolutely 👍 |
I'm 👍 on deprecating |
Ok cool, yeh feel free to get in touch about any question/issues, and I will think about how best to approach the docutils integration. |
If I'm not mistaken, the myst parser can be used independently of sphinx and docutils. Is that right? If so, perhaps we should move those dependencies into an extra install. This would make the parser more lightweight and potentially encourage others to use it in other ways. Wdyt @chrisjsewell ?
The text was updated successfully, but these errors were encountered: