Comments (2)
The big issue here in the MyST context is a hybrid of JupyterLab constraints and markdown-it / MyST constraints
The big "missing feature" is that references are document-level, but right now MarkdownIt is handled per-cell. If we have a per-document renderer context, then we fix the per-cell problem, but then have state invalidation to deal with.
Ultimately, as a UX, I'd like:
- references to work (at the document level)
- partial renders to work (updating a single cell doesn't cause a total reflow)
In technical terms, this would mean:
- the ability to parse each cell into an AST.
- this AST can then be transformed by extensions
- one extension can declare a dependency upon a part of the AST
- this dependency tree is used to perform partial re-renders.
- rendering is stateless; all contextual information handled by AST transforms.
In practical terms, I think this probably means ultimately moving away from markdown-it
in favour of something like the unifiedjs ecosystem. We'd also need to modify how JLab invokes the rendering mechanism, namely that it cannot be entirely stateless from the markdown perspective - the mdast renderer could be, though. This might be as simple as bypassing the markdown rendering mechanism 🤮 and registering an mdast renderer. Then the JLab integration can also speak mdast, but we take charge at the notebook level of getting that mdast from the markdown source.
I wish this were trivial 😆
from jupyterlab-markup.
I think to get document-level features to work, the whole authoring experience needs to be rethought, not (just) the parsing/rendering one. For a few years, I've thought ProseMirror is the still the likeliest candidate, and JupyterLab 4 will probably be the right timeline, for CodeMirror 6 and simplified focus for RTC (just yjs).
For example, in a notebook, Instead of JSON cells that sometimes have markdown, the top-level document would be a prosemirror node (nbformat:notebook
) that only allowed nbformat:metadata
and nbformat:cells
at the top, with subsequent, extensible schema structures underneath, each with a dedicated UI.
This would mean most of the time, editing happens against directly properties on nodes, and round-tripping to nbformat JSON (and markdown source
) would happen only at hard save points.
One side effect of this might be a custom collaborative editing schema rather than moving the nbformat json schema, or raw text in the editor case, over CRDT.
The UI/DX of a notebook would play out where, much like a google doc, a cherry-picked metadata (title, author, etc) would optionally appear at the top, and unlike the current notebook ux, would start with an empty markdown cell, where tab would change it to a code cell, starting an embedded CM6 UI.
None of this changes #13, however... so there's still very much a need for a robust way to document the intent of the document owner vs whatever opinions their tool author had today. But taking over the whole document, it will be a lot more natural to own the metadata as well.
Done right, the user input and output result is quite pleasing, though:
- https://github.com/benrbray/prosemirror-math (leaving aside the whole katex/mathjax issue for now)
And composable with "big rocks" already being adopting in JupyterLab 4
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
- Accessing notebook cell metadata via a BUILTIN plugin HOT 7
- 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
- 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.