-
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
Consider how users can extend roles/directives #45
Comments
In jupyter book (well really docutils I guess) you can use a directive to define a custom role. I wonder if that could be supported and also maybe a simple way to define a custom directive, e.g.
I'm not sure what else might be doable beyond setting key-value parameters but that would already be useful. Of course this concept leads to repetition of boilerplate in markdown files and then you need an include system... so I dunno. It sounds like you have other approaches in mind, and it will be interesting to see what happens. |
Hello! Reviving this thread. I would like to use custom roles to use semantic markup rather than
rather than
And have the role generate appropriate presentation. This is a common I have this up and running in my Jupyter book with custom roles, but these Do you have a timeline for custom roles in jupyterlab-myst? A first approximation that would be good enough in a first step is if
would be rendered as Having an analog of latex's Happy to beta test anything! Thanks a lot in advance! More context and motivationThe Kwarc group at Erlangen is developing cool online technology so that, At this stage, the technology works for course notes written in LaTeX. We |
Thanks @nthiery! Excited to get to extensibility, I think it might be possible to get to a beta version of this over the summer as it is coming up much higher on the list in a bunch of places. Right now unknown roles do render as text: I think that is probably a sensible default for any unknown roles (maybe with some improved styling as well), and we could do that really fast. From the extensibility side, things are getting better, from a code perspective the effort involved is:
We then need some mechanism to extend Right now @agoose77 is putting a bunch of work into making things compatible with JupyterLab 4.0, which has changed a lot with regard to how we are structuring the extension. Our plan after that was to focus on citations/bibliography, but probably things will have settled down at an architecture level to maybe tackle both of these at once -- especially if @tavin's approach is possible, or @agoose77 has some thoughts/ideas/time! Curious on both of your thoughts there! @nthiery, let me know if a quick improvement to the rendering of unknown roles would be helpful, and we can get that done right away. |
Thank @rowanc1 for the quick feedback! Yes, a quick improvement to the rendering of unknown roles would definitely be helpful. Will read in detail your post later today; sounds exciting. And indeed I can see that jupyterlab 4 be a priority :-) |
#115 needs to be partially reworked now that #102 has been merged. Perhaps @rowanc1 or @agoose77 can weigh in on whether it's worth spending time on this? It would make it easy to distribute a labextension that renders custom roles/directives implemented in ecmascript. You could experiment with custom roles/directives written in myst inside such a labextension. |
I think there are some major changes coming in #142, and any changes should be based on that. I believe that @agoose77 also has some other restructuring in mind that he wants to do before that PR merges. Currently it is closer to #102 in how it works across everything. Supporting JupyterLab 4.0 required quite a few changes to the way the whole extension works, but hopefully we are getting to a slightly better pattern. Thanks both for your patience as we sort this out. :) |
Context
If a user wants to add a custom role or directive, I think they would need to inject these definitions into the list of roles / directives that the
markdown-it-docutils
plugin accepts in theoptions
argument. This may not be very easy - theoptions
can be modified from JupyterLab, but to pass in JS objects would require some extension to set these options.Proposal
Perhaps it would be better to expose a token from
jupyterlab-myst
that lets users write extensions to provide their own roles / directives. These extensions could be authored using https://github.com/jupyterlab/jupyterlab-plugin-playground to make it easy to play around with them from JupyterLab.Tasks and updates
No response
The text was updated successfully, but these errors were encountered: