https://github.com/netmarkjp/dockerfile-mkdocs-pptrhtmltopdf
https://github.com/netmarkjp/dockerfile-mkdocs-pptrhtmltopdf
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/netmarkjp/dockerfile-mkdocs-pptrhtmltopdf
- Owner: netmarkjp
- Created: 2019-12-21T00:36:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T20:47:27.000Z (over 2 years ago)
- Last Synced: 2025-08-12T02:49:25.467Z (10 months ago)
- Language: Dockerfile
- Size: 65.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dockerfile-mkdocs-pptrhtmltopdf
# Example
in mkdocs.yml
```yaml
extra_css:
- extra.css
```
in src/extra.css
```css
body {
font-family: "Noto Sans", "Noto Sans CJK JP", sans-serif;
}
```
Example: When compact style is suitable.
```css
@import url(//fonts.googleapis.com/earlyaccess/notosansjapanese.css);
body {
font-family: "Noto Sans Japanese", "Noto Sans CJK JP", "Noto Sans", sans-serif;
}
p {
font-size: small;
text-indent: 1em;
}
.md-typeset p {
font-size: small;
margin-top: 0.25em;
margin-bottom: 0em;
}
.md-typeset ol li, .md-typeset ul li {
font-size: small;
margin-bottom: 0.25em;
line-height: 1.25em;
}
```
# Usage
## serve
```bash
docker run --rm -p 8000:8000 -v $(pwd):/mnt -u $(id -u):$(id -g) --entrypoint mkdocs ghcr.io/netmarkjp/mkdocs-pptrhtmltopdf serve
```
## build html and pdf
```bash
docker run --rm -v $(pwd):/mnt -u $(id -u):$(id -g) ghcr.io/netmarkjp/mkdocs-pptrhtmltopdf
```
=> `draft-html.zip` `draft.pdf` will generate.
# in GitLab CI
example of `.gitlab-ci.yml` is below.
```yaml
stages:
- release
release:
stage: release
tags:
- docker
image:
name: "ghcr.io/netmarkjp/mkdocs-pptrhtmltopdf:latest"
entrypoint: [""]
script:
- /opt/mkdocs-pptrhtmltopdf/build.sh
artifacts:
paths:
- draft.pdf
- draft-html.zip
```
# in GitHub Actions
example of `.github/workflows/build.yml` is below.
```yaml
name: Build document
on:
push:
branches:
- "*"
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run for any PRs.
pull_request:
jobs:
build:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build document
run: docker run --rm -v $(pwd):/mnt ghcr.io/netmarkjp/mkdocs-pptrhtmltopdf:latest
- uses: actions/upload-artifact@v2
with:
name: draft-files
path: |
draft.pdf
draft-html.zip
```