Comments (7)
At present we use the existing JupyterLab scaffolding for Markdown rendering. This means that the Markdown renderer only sees the Markdown source, rather than the cell model. Because of this, it is not currently possible to access the cell through a plugin unless you do this yourself.
You could hack this in - the plugin mechanism is just a wrapper around the JupyterLab extension mechanism. You could write a more advanced extension that references the notebook tracker, and try to do some kind of lookup, but it would be fairly fragile.
from jupyterlab-markup.
In the long run, there is definitely scope for thinking about how cells should interact with Markdown rendering. There are already areas where this has interesting ramifications (https://github.com/agoose77/jupyterlab-imarkdown/)
from jupyterlab-markup.
... the Markdown renderer only sees the Markdown source, rather than the cell model.
Ah, ok... I think that's probably beyond my skillset atm. I did have a look at jupyterlab-imarkdown/ and will see if I can get get enough of a grip on it to strip it back to just giving me access to a cell / cell markdown, customising metadata on the basis of tag settings, and then seeing if I can just render that customised markdown.
from jupyterlab-markup.
Dragons beware! It's pretty gnarly code, mainly because JupyterLab's notebook rendering is not very customisable at the moment. jupyterlab-imarkdown
overrides the machinery that returns a Markdown cell. It returns a special cell that listens for rendered markdown, and post-processes it to identify the special expression syntax. Meanwhile, there is a separate code path that evaluates the parsed cell expressions and replaces the placeholders in the HTML with the rendered results
from jupyterlab-markup.
Presumably the model.value.text
is the original, raw markdown. When the markdown cell has rendered, can you also access the rendered output on the cell?
from jupyterlab-markup.
Unfortunately the cell content is not identical to the text given to the markdown renderer - we strip out the math expressions first.
When the markdown cell has rendered, can you also access the rendered output on the cell?
By default, no. That's what the imarkdown
extension has to overload the cell class for.
from jupyterlab-markup.
The design of the notebook handler / renderer all seems completely messed up to me...
from jupyterlab-markup.
Related Issues (20)
- Binder url not working HOT 2
- Add support for plugin options HOT 1
- Sync scrolling in markdown preview? HOT 4
- Add `[[wiki]]` style link support HOT 1
- Synchronise checkboxes with source
- Separate existing plugins into sub-packages HOT 4
- How do you add plugins? HOT 5
- Feat: support settings reloading
- Support for PlantUML HOT 1
- Broken yaml code block syntax highlighting HOT 2
- Import error during development install HOT 1
- svgbob Code Fence Label inconsistent with sphinx-contrib/svgbob HOT 5
- Support new `IMarkdownParser` interface
- Update to markdown-it 13.x
- Add docs/demo with ReadTheDocs HOT 3
- Document-level rendering? HOT 2
- Explain why I would want this extension
- Support for pythonic preprocessing HOT 1
- Update mermaidjs to support Class diagram HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyterlab-markup.