agoose77 / jupyterlab-markup

JupyterLab extension to enable markdown-it rendering, with support for markdown-it plugins
BSD 3-Clause "New" or "Revised" License
48 stars 13 forks source link

How do you add plugins? #41

Closed BrendanMartin closed 3 years ago

BrendanMartin commented 3 years ago

I have installed the following plugin with npm: https://www.npmjs.com/package/markdown-it-image-figures

But I can't figure out how to activate it in the extension.

agoose77 commented 3 years ago

The plugins system in jupyterlab-markup enables the developer to make Jupyter Lab aware of a markdown-it plugin, but you still need to publish a Jupyter Lab extension in order to do this.

The jupyterlab-markup extension provides an interface that other extensions can hook into. It's like a central point of integration. All of these other extensions are basically just adaptors into the Jupyter Lab ecosystem.

If you want to create such an extension, take a look at jupyterlab-myst on github for an example of how to do this. You can use the Jupyter Lab cookie-cutter to create the skeleton for the extension.

BrendanMartin commented 3 years ago

Do you know of any extensions already out there that hook into jupyterlab-markup and allow installation of any markdown-it plugin?

agoose77 commented 3 years ago

Yep, take a look at the src/builtins directory in this repo - the simpleMarkdownItPlugin is the boilerplate that hooks into Jupyter Lab.

You can also look at https://github.com/executablebooks/jupyterlab-myst which connects the MyST plugins to Jupyter Lab

BrendanMartin commented 3 years ago

Okay, for now, I just forked the repo and added the image-figures plugin into builtins.

agoose77 commented 3 years ago

Cool, that's one approach! If you do want to implement a plugin as a JupyterLab extension, feel free to re-open this issue :)