DenReg/markdown/md2html.ts

9 lines
282 B
TypeScript
Raw Normal View History

2020-10-14 00:56:11 +00:00
import { Marked } from "./mod.ts";
const decoder = new TextDecoder("utf-8");
const filename = Deno.args[0];
const markdown = decoder.decode(await Deno.readFile(filename));
const markup = Marked.parse(markdown);
console.log(markup.content);
console.log(JSON.stringify(markup.meta))