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
This commit is contained in:
Matt Bierner
2021-04-26 16:30:34 -07:00
committed by GitHub
parent 495d162a4e
commit 4cb27d2ec7
21 changed files with 295 additions and 201 deletions

View File

@@ -18,23 +18,25 @@
"virtualWorkspaces": false
},
"contributes": {
"notebookMarkdownRenderer": [
"notebookMarkupRenderers": [
{
"id": "markdownItRenderer-katex",
"displayName": "Markdown it katex renderer",
"entrypoint": "./notebook-out/katex.js"
"entrypoint": "./notebook-out/katex.js",
"dependsOn": "markdownItRenderer"
},
{
"id": "markdownItRenderer-emoji",
"displayName": "Markdown it emoji renderer",
"entrypoint": "./notebook-out/emoji.js"
"entrypoint": "./notebook-out/emoji.js",
"dependsOn": "markdownItRenderer"
}
]
},
"scripts": {
"compile": "npm run build-notebook",
"watch": "npm run build-notebook",
"build-notebook": "npx webpack-cli --config webpack.notebook.js --mode production"
"build-notebook": "node ./esbuild"
},
"devDependencies": {
"@iktakahiro/markdown-it-katex": "https://github.com/mjbvz/markdown-it-katex.git",