Plugin stuff

This commit is contained in:
Zef Hemel
2022-03-28 15:25:05 +02:00
parent 16fa05d4cc
commit bf32d6d0bd
36 changed files with 523 additions and 219 deletions
+6
View File
@@ -0,0 +1,6 @@
functions:
mdTest:
path: "./markdown.ts:renderMarkdown"
env: client
command:
name: "Markdown: Render"
+16
View File
@@ -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>`);
}
+12
View File
@@ -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"
}
}