Skip to content

Commit

Permalink
Add Markdown example.
Browse files Browse the repository at this point in the history
  • Loading branch information
westy92 committed May 12, 2021
1 parent 6f803c4 commit 1b394a0
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 74 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ const url = 'https://github.com/westy92/html-pdf-chrome';
const pdf = await htmlPdf.create(url, options);
```

### Using Markdown

```js
import * as htmlPdf from 'html-pdf-chrome';
import * as marked from 'marked';

const options: htmlPdf.CreateOptions = {
port: 9222, // port Chrome is listening on
};

const html = marked('# Hello [World](https://www.google.com/)!');
const pdf = await htmlPdf.create(html, options);
```

### Using a Template Engine

Pug (formerly known as Jade)
Expand Down
148 changes: 74 additions & 74 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"windows",
"mac",
"linux",
"markdown",
"nodejs"
],
"license": "MIT",
Expand Down

0 comments on commit 1b394a0

Please sign in to comment.