Plugin stuff
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
functions:
|
||||
mdTest:
|
||||
path: "./markdown.ts:renderMarkdown"
|
||||
env: client
|
||||
command:
|
||||
name: "Markdown: Render"
|
||||
@@ -0,0 +1,16 @@
|
||||
import MarkdownIt from "markdown-it";
|
||||
import { syscall } from "../lib/syscall";
|
||||
|
||||
var taskLists = require("markdown-it-task-lists");
|
||||
|
||||
const md = new MarkdownIt({
|
||||
linkify: true,
|
||||
html: false,
|
||||
typographer: true,
|
||||
}).use(taskLists);
|
||||
|
||||
export async function renderMarkdown() {
|
||||
let text = await syscall("editor.getText");
|
||||
let html = md.render(text);
|
||||
await syscall("editor.showRhs", `<html><body>${html}</body></html>`);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "markdown",
|
||||
"dependencies": {
|
||||
"commonmark": "^0.30.0",
|
||||
"markdown-it": "^12.3.2",
|
||||
"markdown-it-task-lists": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/commonmark": "^0.27.5",
|
||||
"@types/markdown-it": "^12.2.3"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user