mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
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>
This commit is contained in:
22
extensions/markdown-notebook-math/notebook/extension.ts
Normal file
22
extensions/markdown-notebook-math/notebook/extension.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import type * as markdownIt from 'markdown-it';
|
||||
|
||||
import 'katex/dist/katex.min.css';
|
||||
|
||||
declare const extendMarkdownIt: undefined | (
|
||||
(f: (md: markdownIt.MarkdownIt) => void) => void
|
||||
);
|
||||
|
||||
(function () {
|
||||
const katex = require('@iktakahiro/markdown-it-katex');
|
||||
|
||||
if (typeof extendMarkdownIt !== 'undefined') {
|
||||
extendMarkdownIt((md: markdownIt.MarkdownIt) => {
|
||||
md.use(katex);
|
||||
});
|
||||
}
|
||||
}());
|
||||
|
||||
12
extensions/markdown-notebook-math/notebook/tsconfig.json
Normal file
12
extensions/markdown-notebook-math/notebook/tsconfig.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../shared.tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"jsx": "react",
|
||||
"lib": [
|
||||
"es2018",
|
||||
"DOM",
|
||||
"DOM.Iterable"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user