Skip to content

Commit

Permalink
docs: add mention to makeMd() to reamde.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tivie committed Nov 10, 2018
1 parent e4b0e69 commit a894a0e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,29 @@ Check our [wiki pages][wiki] for examples and a more in-depth documentation.

### Node

**Markdown to HTML**
```js
var showdown = require('showdown'),
converter = new showdown.Converter(),
text = '# hello, markdown!',
html = converter.makeHtml(text);
```

**HTML to Markdown**
```js
var showdown = require('showdown'),
converter = new showdown.Converter(),
html = '<a href="https://patreon.com/showdownjs">Please Support us!</a>',
md = converter.makeMarkdown(text);
```


### Browser

```js
var converter = new showdown.Converter(),
text = '# hello, markdown!',
html = converter.makeHtml(text);
html = converter.makeHtml('# hello, markdown!'),
md = converter.makeMd('<a href="https://patreon.com/showdownjs">Please Support us!</a>');
```

### Output
Expand All @@ -129,6 +139,10 @@ Both examples should output...
<h1 id="hellomarkdown">hello, markdown!</h1>
```

```md
[Please Support us!](https://patreon.com/showdownjs)
```

## Options

You can change some of showdown's default behavior through options.
Expand Down

0 comments on commit a894a0e

Please sign in to comment.