Skip to content

Commit 31ee709

Browse files
committed
Add pandoc for PDF creation and GitHub Actions for auto-generation
1 parent e8a867e commit 31ee709

31 files changed

+307
-166
lines changed

.github/workflows/main.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Generate PDF using Pandoc
3+
4+
# Controls when the workflow will run
5+
on:
6+
# Triggers the workflow on push or pull request events but only for the master branch
7+
push:
8+
branches: [ master ]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "create_pdf"
16+
create_pdf:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-20.04
19+
20+
# Pandoc Docker image v2.17.0.1
21+
container:
22+
image: pandoc/latex:2.17.0.1
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- uses: actions/checkout@v2
28+
29+
# Run the PDF creation script in the container
30+
- uses: docker://pandoc/latex:2.17.0.1
31+
with:
32+
entrypoint: './pandoc-docker.sh'
33+
34+
# Create an output with the shortened version of the commit SHA
35+
- id: short_sha
36+
env:
37+
GITHUB_SHA: ${{ github.sha }}
38+
run: echo "::set-output name=short_sha::$(echo ${GITHUB_SHA::7})"
39+
40+
# Create a release with the PDFs as assets and the shortened SHA as the tag name
41+
- uses: softprops/action-gh-release@v1
42+
with:
43+
tag_name: v${{ steps.short_sha.outputs.short_sha }}
44+
draft: false
45+
files: |
46+
*.pdf

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Byte-compiled / optimized / DLL files
22
*.epub
3+
*.pdf
34
__pycache__/
45
*.py[cod]
56

@@ -61,4 +62,4 @@ target/
6162
scratch/
6263

6364
# IPython Notebook templates
64-
template.ipynb
65+
template.ipynb

README-zh-Hans.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ def get_user(self, user_id):
11931193
##### 缓存的缺点:
11941194

11951195
- 请求的数据如果不在缓存中就需要经过三个步骤来获取数据,这会导致明显的延迟。
1196-
- 如果数据库中的数据更新了会导致缓存中的数据过时。这个问题需要通过设置 TTL 强制更新缓存或者直写模式来缓解这种情况。
1196+
- 如果数据库中的数据更新了会导致缓存中的数据过时。这个问题需要通过设置 TTL 强制更新缓存或者直写模式来缓解这种情况。
11971197
- 当一个节点出现故障的时候,它将会被一个新的节点替代,这增加了延迟的时间。
11981198

11991199
#### 直写模式

0 commit comments

Comments
 (0)