# markdown Deno Markdown module forked from https://github.com/ts-stack/markdown/tree/bb47aa8e625e89e6aa84f49a98536a3089dee831 ### Example usage Simple md2html.ts script: ```typescript 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)) ``` Now running: ```bash deno run --allow-read md2html.ts example.md > example.html ``` Will output: ```html

Hello World

This an example for md2html.ts

A small paragraph that will become a <p> tag


Code Block (md2html.ts)

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))

This module is forked from ts-stack/markdown

Made for Deno deno-logo

{"title":"Hello world!","subtitle":"Front-matter is supported!","boolean":true,"list-example":["this","is",{"a":"list"}]} ``` --- ### Notes I had to do some changes to the source code to make the compiler happy, mostly fixes for things that were uninitialized and possibly null or undefined