forked from npm/marky-markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
33 lines (28 loc) · 713 Bytes
/
example.js
File metadata and controls
33 lines (28 loc) · 713 Bytes
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
26
27
28
29
30
31
32
33
var marky = require('./')
// Clean up a regular old markdown string
marky("# hello, I'm markdown").html()
// Pass in an npm `package` object to do stuff like
// rewriting relative URLs to their absolute equivalent on github,
// normalizing package metadata with redundant readme content,
// etcs
var pkg = {
name: 'foo is a thing',
repository: {
type: 'git',
url: 'https://github.com/kung/foo'
}
}
marky(
'# hello, I am the foo readme',
{package: pkg}
).html()
// Disable syntax highlighting
marky(
"# I'm a file with github flavored markdown",
{highlightSyntax: false}
).html()
// Pass in a `debug` for verbose output
marky(
"# hello, I'm an evil document",
{debug: true}
).html()