forked from JacobWeisenburger/markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
25 lines (22 loc) · 1.91 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<h1 id="hello-world">Hello World</h1>
<h2 id="this-an-example-for-md2html-ts-">This an example for <code>md2html.ts</code></h2>
<p>A small paragraph that will become a <code><p></code> tag</p>
<hr>
<p>Code Block (md2html.ts)</p>
<pre><code class="lang-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));
</code></pre>
<p>This module is forked from <a href="https://github.com/ts-stack/markdown/tree/bb47aa8e625e89e6aa84f49a98536a3089dee831">ts-stack/markdown</a></p>
<p>Made for Deno
<img src="https://deno.land/logo.svg" alt="deno-logo"></p>
{
title: "Hello world!",
subtitle: "Front-matter is supported!",
boolean: true,
list-example: [ "this", "is", { a: "list" } ]
}