Skip to content

Commit

Permalink
chore: release v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ourongxing committed Dec 20, 2022
1 parent 4e6f338 commit 34bc162
Show file tree
Hide file tree
Showing 25 changed files with 97 additions and 66 deletions.
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A printer that can print multiple web pages as one pretty PDF
</p>
<p align="center">
<img src="https://img.shields.io/badge/TypeScript-blue" alt="language">
<a href="https://www.npmjs.com/package/@web-printer/core"><img src="https://img.shields.io/badge/v0.2.5-EE2C50" alt="version"></a>
<a href="https://www.npmjs.com/package/@web-printer/core"><img src="https://img.shields.io/badge/v0.3.0-EE2C50" alt="version"></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/MIT-yellow" alt="license"></a>
</p>

Expand Down Expand Up @@ -47,38 +47,45 @@ If you are not a novice, do what you want to do, just like install a npm package

```bash
pnpm i playwright @web-printer/core
pnpm exec playwright install chromium
# plugin you need
# If you have installed Chrome, you can skip it.
# Web Printer use chrome default. Other supported browsers can be viewed in PrinterOption.channel.
pnpm exec playwright install chrome
# install plugin you need
pnpm i @web-printer/javascript-info
```

Then create a `.ts` file, input

```ts
import { Printer } from "@web-printer/core"
// import plugin you install
import javascriptInfo from "@web-printer/javascript-info"
// import plugin you have installed
import vitepress from "@web-printer/vitepress"

new Printer()
.use(
javascriptInfo({
url: "https://javascript.info/"
vitepress({
url: {
Guide: "https://vuejs.org/guide/introduction.html",
API: "https://vuejs.org/api/application.html"
}
})
)
.print("The Modern JavaScript Tutorial")
.print("Vue 3.2 Documentation")
```

And run it by [tsx](https://github.com/esbuild-kit/tsx), in other ways may throw errors. I have no time to fix it now.

---

But if you are a novice, follow me, maybe easier.

First you shoud install [pnpm(with node)](https://pnpm.io/installation), [vscode(support typescript)](https://code.visualstudio.com/).

```bash
pnpm create printer@latest

# or complete in one step
pnpm create printer@latest web-printer -p vitepress
# or complete in one step. https://github.com/busiyiworld/web-printer/tree/main/packages/create-printer
pnpm create printer@latest web-printer -p vitepress -c chrome
```

And follow the tips. After customizing, use `pnpm print` to print. A pretty PDF will appear in `./output`.
Expand All @@ -100,8 +107,13 @@ new Printer({} as PrinterOption)

```ts
{
/**
* Chromium distribution channel. Choose you have installed.
* @default "chrome"
* */
channel?: "chromium" | "chrome" | "chrome-beta" | "chrome-dev" | "chrome-canary" | "msedge" | "msedge-beta" | "msedge-dev" | "msedge-canary"
/**
* Dir of userdata of Chromium
* Dir of userdata of Chrome. It is not recommended to use your system userData of Chrome.
* @default "./userData"
*/
userDataDir?: string
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@web-printer/monorepo",
"type": "module",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/core",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-printer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-printer",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"main": "dist/index.js",
"bin": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/javascript-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/javascript-info": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/javascript-info": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/juejin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/juejin": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/juejin": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-printer/template/manual/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A printer that can print multiple web pages as one pretty PDF
</p>
<p align="center">
<img src="https://img.shields.io/badge/TypeScript-blue" alt="language">
<a href="https://www.npmjs.com/package/@web-printer/core"><img src="https://img.shields.io/badge/v0.2.5-EE2C50" alt="version"></a>
<a href="https://www.npmjs.com/package/@web-printer/core"><img src="https://img.shields.io/badge/v0.3.0-EE2C50" alt="version"></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/MIT-yellow" alt="license"></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion packages/create-printer/template/manual/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/core": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/mdbook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/mdbook": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/mdbook": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/ruanyifeng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/ruanyifeng": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/ruanyifeng": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/vitepress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/vitepress": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/vitepress": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/wikipedia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/wikipedia": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/wikipedia": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/xiaobot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/xiaobot": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/xiaobot": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/zhihu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/zhihu": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/zhihu": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-printer/template/zhubai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"print": "tsx src/index.ts"
},
"devDependencies": {
"@web-printer/core": "^0.2.5",
"@web-printer/zhubai": "^0.2.5",
"@web-printer/core": "^0.3.0",
"@web-printer/zhubai": "^0.3.0",
"playwright": "^1.28.1",
"tsx": "^3.12.1",
"typescript": "^4.9.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/javascript-info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/javascript-info",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/juejin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/juejin",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/mdbook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/mdbook",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/ruanyifeng/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/ruanyifeng",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"author": "Ou RongXing<orongxing@gmail.com>",
"homepage": "https://github.com/busiyiworld/web-printer/tree/main/packages/ruanyifeng#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/vitepress",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"author": "Ou RongXing<orongxing@gmail.com>",
"homepage": "https://github.com/busiyiworld/web-printer/tree/main/packages/vitepress#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/wikipedia/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/wikipedia",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"author": "Ou RongXing<orongxing@gmail.com>",
"homepage": "https://github.com/busiyiworld/web-printer/tree/main/packages/wikipedia#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/xiaobot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/xiaobot",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"author": "Ou RongXing<orongxing@gmail.com>",
"homepage": "https://github.com/busiyiworld/web-printer/tree/main/packages/xiaobot#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/zhihu/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/zhihu",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/zhubai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@web-printer/zhubai",
"version": "0.2.5",
"version": "0.3.0",
"license": "MIT",
"author": "Ou RongXing<orongxing@gmail.com>",
"homepage": "https://github.com/busiyiworld/web-printer/tree/main/packages/zhubai#readme",
Expand Down
Loading

0 comments on commit 34bc162

Please sign in to comment.