-
Notifications
You must be signed in to change notification settings - Fork 18
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
Syntax extensions should be configurable #25
Comments
Ah ok cool 👍 |
@chrisjsewell can this be closed? |
yep, although at some point we should write a brief bit of documentation about how to use/configure the extension (in the README or better a small RTD site) |
Sounds good, let's leave this open then. |
* 🔌 Add card, grid, tabs directive plugins * 🎨 Add examples and upgrade packages! * 📸 Update Playwright Snapshots * 📖 Update README with a walkthrough gif Co-authored-by: Rowan Cockett <[email protected]>
I think it doesn't work this way anymore? In jupyterlab==3.6.1 and jupyterlab_myst==1.1.1? There seems to be no way to toggle the syntax extensions. |
@tavin good spot; we upgraded the package, and lost some "features" along the way. The extensibility of MyST in general is something that the community at-large need to figure out. Although there is prior art for what this might look like, this fits into the wider context of what version of MyST (e.g. 2023.02.03) is in use, i.e. the need for a version identifier. We also want to make it convenient to extend the syntax of myst at the data-level, so that it can easily be adapted to particular use cases. So, for now, watch this space. |
Good to know @agoose77. Where in the code is the list of enabled extensions, for the sake of hacking on it locally? |
Some of the plugin configuration is here: |
And here for the roles/directives: https://github.com/executablebooks/jupyterlab-myst/blob/main/src/myst.ts#L51-L54 |
Here's an idea about where to configure syntax extensions:
Maybe for this to work out, a user should somehow actively mark a directory as a "jupyter book project" or simply a "jupyter project" ... |
@agoose77 @rowanc1 I have a partial solution for this in #115. Through a labextension "token" I expose a simple interface that encapsulates the options object which is passed to the myst parser. The currently hardcoded roles, directives, syntax extensions, etc. are kept as defaults. It's relatively easy to write a labextension to alter these. You can imagine backing the interface with entries from the UI settings editor, or from notebook metadata, or whatever. I've used this to implement a few custom directives as well. For context and easy reference these are the options I'm talking about, which can be passed through the interface:
|
This is super cool, still looking through the PR! Do you have a demo of how to create a different lab extension to override the options? |
@rowanc1 this is a fully working labextension which modifies the myst parser options: https://github.com/tavin/myst-options-poc/tree/main/src |
Hello, just wanted to add that this would be extremely helpful! I need a small number of additional directives from sphinx proof for my class materials, and writing would be much easier and cleaner if I could see these directives rendered in the notebook. |
@meldefon we just added support for sphinx proof here: |
This is fantastic!! Thank you very much. The editing experience is massively improved. Sorry to keep demanding things, but I'm guessing that many of the users who need sphinx proof directives would also benefit from having sphinx exercise. Might be worth incorporating into the upcoming update. |
@meldefon added support for |
As per https://myst-parser.readthedocs.io/en/latest/syntax/optional.html and https://github.com/executablebooks/myst-vs-code#preview-enhancement, all syntax extension should be configurable, to enable/disable.
I don't think is possible yet @agoose77?
The text was updated successfully, but these errors were encountered: