Skip to content

Commit

Permalink
modified book.json on pdf download.
Browse files Browse the repository at this point in the history
  • Loading branch information
houhuawei23 committed Dec 30, 2024
1 parent a1d7aae commit 8293657
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 7 deletions.
31 changes: 31 additions & 0 deletions Misc/GitBook.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,28 @@ GitBook 是基于 Node.js 的开源命令行工具,用于输出漂亮的电子
- [download-pdf-link](https://github.com/show0k/gitbook-plugin-download-pdf-link)
- [mermaid-newface](https://github.com/TakuroFukamizu/gitbook-plugin-mermaid-newface)

```yaml
# open base/Notes.pdf
"get-pdf": {
"base": "https://github.com/houhuawei23/Notes/tree/gh-pages",
"prefix": "Notes",
"label": "Download PDF"
},
# open url
"my-toolbar": {
"buttons": [
{
"label": "下载PDF",
"icon": "fa fa-file-pdf-o",
"url": "https://github.com/houhuawei23/Notes/tree/gh-pages/Notes.pdf",
"position": "left",
"text": "下载PDF",
"target": "_blank"
}
]
}
``

## Install

```bash
Expand Down Expand Up @@ -71,4 +93,13 @@ GitBook 约定了下面这些文件的作用:

```bash
gitbook pdf <gitbook-folder-location> <pdf-location>.pdf
```

```yaml
# gitbook-action.yml
- name: Install Calibre (for ebook-convert)
run: |
sudo apt-get update
sudo apt-get install -y calibre
```
20 changes: 13 additions & 7 deletions book.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,27 @@
"edit-link",
"back-to-top-button",
"intopic-toc",
"download-pdf-link"
"my-toolbar"
],
"pluginsConfig": {
"github": {
"url": "https://github.com/houhuawei23/Notes"
},
"edit-link": {
"base": "https://github.com/houhuawei23/Notes/edit/main",
"label": "Edit This Page"
"label": "Edit"
},
"download-pdf-link": {
"base": "https://github.com/houhuawei23/Notes/tree/gh-pages/Notes.pdf",
"label": {
"en": "Download PDF"
}
"my-toolbar": {
"buttons": [
{
"label": "Download PDF",
"icon": "fa fa-file-pdf-o",
"url": "https://github.com/houhuawei23/Notes/tree/gh-pages/Notes.pdf",
"position": "left",
"text": "Download PDF",
"target": "_blank"
}
]
}
},
"pdf": {
Expand Down
Binary file removed book.pdf
Binary file not shown.

0 comments on commit 8293657

Please sign in to comment.