-
Notifications
You must be signed in to change notification settings - Fork 130
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
What's the best way to add support for sphinx directives in markdown cells? #762
Comments
Currently, there is no automatic way to do that. For now it might be best to keep using MyST-NB. In the long run, I would like to support custom parsers for Markdown cells, but this is a big undertaking. |
Yep, getting rid of pandoc would be nice. I'd be down to help out with this, I think first I'd like to spend a little time looking at how we might be able to break this down given the size of the task. For now, from what I can tell a string like {ref}`this code snippet <this-py>` gets ingested by EDIT: Okay, after looking at this more closely, it seems like {ref}`this code snippet <this-py>` into {ref}\\ ``this code snippet <this-py>`` Which is not a valid sphinx reference. I tried implementing a pandoc filter that does what I want, but filters only operate on single objects (i.e. words) so this isn't a practical approach. |
I agree that a pandoc filter isn't the right approach. Pandoc would need to support MyST as a proper input format. I don't know if that's ever going to happen. The only relevant things I found in the issue tracker are these: jgm/pandoc#7622, jgm/commonmark-hs#100. Anyway, making this work with Pandoc would only be a temporary solution. |
I have a lot of existing notebooks that have sphinx directives embedded in their markdown cells - stuff like
or
I know I can turn these into properly supported links using
[this code snippet](path_to_file.rst#this-py)
or similar, but the code base I'm working with is huge, and has previously usedmyst-nb
to do this, so replacing every reference would be a serious effort. I'm trying to think about other ways to handle this withnbsphinx
; what's the best way to handle this?The text was updated successfully, but these errors were encountered: