This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 177
Solve some problems in use #102
Open
is2ac-zhao
wants to merge
8
commits into
fuergaosi233:master
Choose a base branch
from
is2ac-zhao:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c3470bb
update depency package
is2ac-zhao c3d2685
update user agent style
is2ac-zhao 525a949
update user agent style
is2ac-zhao 7586cb2
add Dockerfile
is2ac-zhao b946d67
add github actions
is2ac-zhao 0d447f0
add docker build github actions
is2ac-zhao ce530ed
Dockerfile Install open source Chinese fonts
is2ac-zhao 3e0410d
Merge branch 'master' into master
fuergaosi233 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/gitbook2pdf:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM python:3.8.12-bullseye | ||
|
||
RUN echo """deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free \ | ||
deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free \ | ||
deb http://mirrors.ustc.edu.cn/debian-security stable-security main contrib non-free""" > /etc/apt/sources.list | ||
|
||
RUN apt update \ | ||
&& apt-get install -y ttf-mscorefonts-installer fontconfig \ | ||
&& apt-get install ttf-wqy-microhei ttf-wqy-zenhei | ||
|
||
ENV LANG=zh_CN.UTF-8 LANGUAGE=zh_CN.UTF-8 | ||
|
||
RUN apt-get install -y locales \ | ||
&& dpkg-reconfigure --frontend=noninteractive locales | ||
|
||
RUN git clone https://github.com/is2ac-zhao/gitbook2pdf /app | ||
|
||
WORKDIR /app | ||
|
||
RUN python -m pip install --upgrade pip \ | ||
&& python -m pip install -r requirements.txt | ||
|
||
CMD ["python"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ def srcrepl(self, match): | |
pathStr = match.group(3) | ||
if pathStr.startswith(".."): | ||
pathStr = pathStr[3:] | ||
return "<" + match.group(1) + match.group(2) + "=" + "\"" + absolutePath + pathStr + "\"" + match.group( | ||
return "<" + match.group(1) + match.group(2) + "=" + "\"" + urljoin(absolutePath, pathStr) + "\"" + match.group( | ||
4) + ">" | ||
|
||
def relative_to_absolute_path(self, origin_text): | ||
|
@@ -189,7 +189,7 @@ def __init__(self, base_url, fname=None): | |
self.meta_list.append( | ||
('generator', 'gitbook2pdf') | ||
) | ||
weasyprint.HTML._ua_stylesheets = local_ua_stylesheets | ||
# weasyprint.HTML._ua_stylesheets = local_ua_stylesheets | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line is to ensure a consistent Style, why remove it? |
||
|
||
def run(self): | ||
content_urls = self.collect_urls_and_metadata(self.base_url) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use
COPY
notgit clone
?