Commit Graph

18 Commits

Author SHA1 Message Date
Matt Bierner a6d26aa31c
Add insane for notebook markdown rendering 2021-08-18 15:09:23 -07:00
Matt Bierner 691e9cea33
Support clickable links between markdown cells
Fixes #103519
2021-08-13 14:17:10 -07:00
Matt Bierner bc14fe9e8d
Use templates for markdown styles
These styles shouldn't be added into the notebook itself, only into the shadow dom of the markdown cells
2021-06-09 15:17:21 -07:00
Matt Bierner 39dc60dec6
Move notebook empty markdown cell logic into markdown extension 2021-06-08 13:50:10 -07:00
Matt Bierner 30ed48f190
Move notebook markdown styles and shadow root to markdown-it extension 2021-06-08 13:08:44 -07:00
Matt Bierner fd430418a0
Refine `CellInfo` type (#125351)
For #125269

- Rename `CellInfo` - >`OutputItem` (only internally, we also need to update the published types)
- Move `id` into `OutputItem`
- Move `element` out of `OutputItem`
- Rename `renderCell` to `renderOutputItem`
- Rename `destoryCell` to `disposeOutputItem` (`dispose` is  the term we generally use in our APIs)
2021-06-03 13:01:02 -07:00
Johannes Rieken 9ef57b5c21
remove NotebookCellOutputItem#value, https://github.com/microsoft/vscode/issues/123884 2021-05-27 14:55:25 +02:00
Johannes Rieken effac5be7f
drop as-prefix for ICreateCellInfo 2021-05-21 17:30:29 +02:00
Johannes Rieken 494e827e35
expose output item bytes to renderers and provide util functions: asText, asJSON, asBytes, asBlob, fyi @connor4312, https://github.com/microsoft/vscode/issues/123884 2021-05-21 12:36:10 +02:00
Matt Bierner 66fa5c41b3
First cut at unifying notebook renderers apis
This implements the api described in #123540. Major points:

- Instead of having the `markdown-it` renderer pull it its dependencies, instead the dependencies can call `getRenderer` to import the object returned by the `markdown-it` renderer

- We try to detect if a renderer is using the old or new api. Old renderers are still run as globals while new ones are loaded with `import`

- I have only hooked up the new API for markdown renderers so far
2021-05-12 19:32:57 -07:00
Matt Bierner 13d81db250
Don't insert link element into the markdown cell preview body
Fixes #123012
2021-05-05 14:35:46 -07:00
Matt Bierner 7770708545
Reapply markup renderers change
Rewriting how we do replacements in the webviewPreloads function to hopefully handle optimization better
2021-04-28 10:44:25 -07:00
Matt Bierner fe7c5aba01
Revert "Better notebook markup renderer api (#121882)"
This reverts commit 4cb27d2ec7.
2021-04-26 19:43:16 -07:00
Matt Bierner 4cb27d2ec7
Better notebook markup renderer api (#121882)
* Better notebook markup renderer api

For #121256

- Use js modules for notebook output renderers
- Rename apis from `markdown` to `markup`
- Use imports and exports for apis instead of globals for apis
- Use esbuild instead of webpack so we can emit js modules
- Clearly split top level markup renderes from renderers that extend other renderers

* Use constant instead of comment for replacement
2021-04-26 16:30:34 -07:00
Matt Bierner d4412e708a
Render markdown preview cells inside a shadow dom (#120137)
* Render markdown preview cells inside a shadow dom

Fixes #119971

This moves all markdown previews into shadow doms. This lets us prevent styles from outside the preview leak into the preview, and also prevents styles from the preview leak out into the rest of the notebook

* Use composedPath for handling events in webviews

This lets us handle clicks triggered inside of a shadow dom
2021-03-30 14:17:15 -07:00
Matt Bierner 9b4f1aff5d Enable inline html tags in notebook markdown
Fixes #113351
2021-02-11 17:21:30 -08:00
Matt Bierner 6dd156d04b Support drag and drop copy for markdown cells
For #116393

Also removes some logging and improves drag/drop responsiveness
2021-02-10 17:37:51 -08:00
Matt Bierner 35f855796b
Add support for markdown notebook renderers (#115191)
* Use shared webpack version instead of installing locally for simple-browser

* Use npm for building markdown preview

* render markdown in webview.

* update markdown preview height and offset

* Add basic custom notebook renderer point

* update css

* style update.

* update markdown header padding left

* Add example of loading katex to extend the markdown-it renderer

* Rename global to make clear it only applies to markdown-in

* hide/remove markdown preview

* Add wait for initial markdown preview rendering before showing notebook

* Add double click to switch to editing mode

* Fix markdown cells not getting updated after editing

* style polish

* notebook.experimental.useMarkdownRenderer

* switch render strategy.

* Adding very intial drag drop support for notebook markdown cells

* Implement drag/drop stubs for test classes

* Revert unrelated file changes

* Move markdown notebook math to own extension

* Add missing imports

Co-authored-by: rebornix <penn.lv@gmail.com>
2021-02-10 16:41:53 -08:00