mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
feat(markdown): add render command (fixes #75612)
This adds a command which renders the provided document, or the active
editor if one is provided. Following the pattern of some of the preview
commands, it returned `undefined` if there's no document provided and
no active text editor. Otherwise, seems to work...
```ts
const html = await vscode.commands.executeCommand<string>('markdown.render');
```
A way to render arbitrary strings in addition to documents may be useful at
some point in the future. However, I didn't implement that here as that'd
require some refactoring of the markdown engine. If we're interested though
I could certainly give that a shot.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
"onCommand:markdown.showLockedPreviewToSide",
|
||||
"onCommand:markdown.showSource",
|
||||
"onCommand:markdown.showPreviewSecuritySelector",
|
||||
"onCommand:markdown.render",
|
||||
"onWebviewPanel:markdown.preview"
|
||||
],
|
||||
"contributes": {
|
||||
@@ -325,4 +326,4 @@
|
||||
"webpack": "^4.1.0",
|
||||
"webpack-cli": "^2.0.10"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user