letter-press
Advanced tools
Comparing version 3.1.1 to 3.2.0
@@ -10,5 +10,5 @@ #!/usr/bin/env node | ||
// ... | ||
]; | ||
] | ||
(async () => { | ||
;(async () => { | ||
let press | ||
@@ -15,0 +15,0 @@ try { |
@@ -30,3 +30,4 @@ const fs = require('fs') | ||
pdf: { | ||
format: 'A4' | ||
format: 'A4', | ||
printBackground: true | ||
} | ||
@@ -33,0 +34,0 @@ }, opts || {}) |
{ | ||
"name": "letter-press", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"main": "index.js", | ||
@@ -13,7 +13,7 @@ "scripts": { | ||
"author": "srilq <git@srilq.email>", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"dependencies": { | ||
"highlight.js": "^9.12.0", | ||
"markdown-it": "^8.4.0", | ||
"primer-css": "^9.3.0", | ||
"primer-css": "^9.4.0", | ||
"pug": "^2.0.0-rc.4", | ||
@@ -20,0 +20,0 @@ "puppeteer": "^0.10.2", |
@@ -38,17 +38,15 @@ # letter-press | ||
// ... | ||
]; | ||
] | ||
(async () => { | ||
const press = await letterpress.launch() | ||
const press = await letterpress.launch() | ||
const jobs = [] | ||
list.forEach(item => { | ||
const markdown = letter(item.sender, item.recipient) | ||
const job = press.print(item.id, markdown) | ||
jobs.push(job) | ||
}) | ||
const jobs = [] | ||
list.forEach(item => { | ||
const markdown = letter(item.sender, item.recipient) | ||
const job = press.print(item.id, markdown) | ||
jobs.push(job) | ||
}) | ||
await Promise.all(jobs) | ||
press.close() | ||
})() | ||
await Promise.all(jobs) | ||
press.close() | ||
``` | ||
@@ -59,4 +57,6 @@ | ||
### `letterpress.print(id, markdown, [opts])` | ||
Print the given `markdown` string to PDF. **Return:** Promise | ||
Print the given `markdown` string to PDF. | ||
**Return:** Promise | ||
Writes the following files:<br> | ||
@@ -67,7 +67,11 @@ `dist/id.html`<br> | ||
### `letterpress.launch([opts])` | ||
Launch a new Press. **Return:** Promise of Press | ||
Launch a new Press. | ||
**Return:** Promise of Press | ||
### `Press.prototype.print(id, markdown, [opts])` | ||
Print the given `markdown` string to PDF. **Return:** Promise of Press | ||
Print the given `markdown` string to PDF. | ||
**Return:** Promise of Press | ||
Writes the following files:<br> | ||
@@ -87,10 +91,10 @@ `dist/id.html`<br> | ||
`opts.quiet` Only log thrown exceptions. **Default:** `false` | ||
`opts.quiet` Only log when something goes awry. **Default:** `false` | ||
`opts.markdown` Options passed to **markdown-it**: `new MarkdownIt(opts)`. [API](https://github.com/markdown-it/markdown-it#api) | ||
`opts.markdown` Options passed to **markdown-it**: `new MarkdownIt(opts)`. [API](https://markdown-it.github.io/markdown-it/#MarkdownIt.new) | ||
`opts.template` Path to **pug** template file used when generating HTML. The template must contain a `!=content`, and may contain a `!=title`. **Default:** [Template File](https://github.com/srilq/letter-press/blob/latest/ghmd.pug) | ||
`opts.pug` Options passed to **pug**: `pug.renderFile`. [API](https://pugjs.org/api/reference.html) | ||
`opts.pug` Options passed to **pug**: `pug.renderFile`. [API](https://pugjs.org/api/reference.html#options) | ||
`opts.pdf` Options passed to **puppeteer**: `page.pdf(opts)`. [API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions) |
module.exports = (date, from, to) => | ||
`<p style="text-align: right">${date}</p> | ||
${from.salutation}, | ||
${from.salutation}, 🐈 | ||
@@ -10,2 +10,8 @@ Nullam quis risus eget urna mollis ornare vel eu leo ${to.info}, ${to.name}. | ||
[![downloads](https://img.shields.io/npm/dm/letter-press.svg?style=flat-square)](https://npmjs.org/package/letter-press) | ||
Inline-image: ![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1") | ||
The [Frogs Website][Frogs Website] | ||
\`\`\`js | ||
@@ -21,6 +27,7 @@ var x = ten() | ||
Table Heading | Another Heading | ||
------------- | --------------- | ||
Item | Item | ||
Item Row 2 | This is a cool table! | ||
Table Heading | Another Heading | ||
-------------- | --------------- | ||
Item | Item | ||
Item Row 2 | This is a cool table! | ||
Item Row other | nice | ||
@@ -31,2 +38,4 @@ function code () { | ||
Some \`inline code\` | ||
Nulla vitae elit libero, a pharetra augue. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. | ||
@@ -40,4 +49,9 @@ | ||
> A blockquote is here | ||
> and it's pretty cool! | ||
Nulla vitae elit libero, a pharetra augue. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas sed diam eget risus varius blandit sit amet non magna. Aenean lacinia bibendum nulla sed consectetur. Aenean lacinia bibendum nulla sed consectetur. | ||
*** | ||
Vestibulum id ligula porta felis euismod semper. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Vestibulum id ligula porta felis euismod semper. Maecenas faucibus mollis interdum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
@@ -47,2 +61,4 @@ | ||
${from.name} | ||
[Frogs Website]: https://www.frogs.fun | ||
` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
20032
0
440
97
Updatedprimer-css@^9.4.0