Skip to content

Latest commit

 

History

History
176 lines (131 loc) · 4.8 KB

README.adoc

File metadata and controls

176 lines (131 loc) · 4.8 KB

docker-asciidoctor-cjk

Overview

  • Add Noto CJK fonts and themes directory to docker container.

  • Add and use common user: demo , I don’t like use root as primary user.

Language Code

  • sc (Simplified Chinese)

  • tc (Traditional Chinese)

  • hk (Hong Kong)

  • jp (Japanese)

  • kr (Korean)

How to pull it

If you select language code is tc.

docker pull ghcr.io/life888888/docker-asciidoctor-cjk/docker-asciidoctor-cjk-tc
docker tag ghcr.io/life888888/docker-asciidoctor-cjk/docker-asciidoctor-cjk-tc docker-asciidoctor-cjk

How to use it

Just run:

docker run -it -v `pwd`:/documents/ docker-asciidoctor-cjk

Create CJK PDF:

asciidoctor-pdf \
  -r asciidoctor-diagram \
  -r asciidoctor-mathematical \
  -a scripts=cjk \
  -a pdf-themesdir=/home/demo/downloaded-resources/themes \
  -a pdf-fontsdir="/home/demo/downloaded-resources/fonts;GEM_FONTS_DIR" \
  -a pdf-theme=default-ext-notosans-cjk-tc \
  README-zh_TW.adoc
Important

If you select language code is tc.

You can set pdf-theme=default-ext-notosans-cjk-tc

Theme Name List:

  • default-ext-notosans-cjk-tc

  • default-ext-notosansmono-cjk-tc

  • default-ext-notoserif-cjk-tc

  • default-notosans-cjk-tc

  • default-notosansmono-cjk-tc

  • default-notoserif-cjk-tc

  • notosans-cjk-tc

  • notosansmono-cjk-tc

  • notoserif-cjk-tc

Please change tc to your language code.

Add File Tree

  • -a pdf-themesdir=/home/demo/downloaded-resources/themes

  • -a pdf-fontsdir="/home/demo/downloaded-resources/fonts;GEM_FONTS_DIR"

  • -a pdf-theme=default-ext-notosans-cjk-tc

/home/demo
└── downloaded-resources
    ├── fonts
    │   ├── notosans-cjk-tc-bold_italic.ttf
    │   ├── notosans-cjk-tc-bold.ttf
    │   ├── notosans-cjk-tc-italic.ttf
    │   ├── notosans-cjk-tc-normal.ttf
    │   ├── notosansmono-cjk-tc-bold_italic.ttf
    │   ├── notosansmono-cjk-tc-bold.ttf
    │   ├── notosansmono-cjk-tc-italic.ttf
    │   ├── notosansmono-cjk-tc-normal.ttf
    │   ├── notoserif-cjk-tc-bold_italic.ttf
    │   ├── notoserif-cjk-tc-bold.ttf
    │   ├── notoserif-cjk-tc-italic.ttf
    │   └── notoserif-cjk-tc-normal.ttf
    └── themes
        ├── default-ext-notosans-cjk-tc-theme.yml
        ├── default-ext-notosansmono-cjk-tc-theme.yml
        ├── default-ext-notoserif-cjk-tc-theme.yml
        ├── default-notosans-cjk-tc-theme.yml
        ├── default-notosansmono-cjk-tc-theme.yml
        ├── default-notoserif-cjk-tc-theme.yml
        ├── notosans-cjk-tc-theme.yml
        ├── notosansmono-cjk-tc-theme.yml
        └── notoserif-cjk-tc-theme.yml

How to contribute / do it yourself?

Requirements

You need the following tools:

  • A bash compliant command line

  • Docker installed and in your path

Download Source Code

Unzip file.

How to build ?

JUST SELECT ONE FONT LANGUAGE CODE

sc (Simplified Chinese)

run command: ./build-docker-asciidoctor-cjk.sh sc

tc (Traditional Chinese)

run command: ./build-docker-asciidoctor-cjk.sh tc

hk (Hong Kong)

run command: ./build-docker-asciidoctor-cjk.sh hk

jp (Japanese)

run command: ./build-docker-asciidoctor-cjk.sh jp

kr (Korean)

run command: ./build-docker-asciidoctor-cjk.sh kr

$ docker image ls
docker-asciidoctor-cjk                 latest    24394fa1e002   3 hours ago     1.19GB
docker-asciidoctor-cjk-tc              latest    24394fa1e002   3 hours ago     1.19GB
life888888/docker-asciidoctor-cjk-tc   latest    24394fa1e002   3 hours ago     1.19GB
life888888/docker-asciidoctor-cjk-tc   0.0.1     24394fa1e002   3 hours ago     1.19GB

I use tag name docker-asciidoctor-cjk to point to docker-asciidoctor-cjk-tc

docker-asciidoctor-cjk → docker-asciidoctor-cjk-tc → life888888/docker-asciidoctor-cjk-tc → life888888/docker-asciidoctor-cjk-tc:0.0.1

docker-asciidoctor-cjk like a alias name, it will point to your language, like docker-asciidoctor-cjk-sc or docker-asciidoctor-cjk-jp.

License

MIT License Copyright (c) 2022 life888888

Third Party License

docker-asciidoctor - MIT License

asciidoctor-pdf-cjk-ext - MIT License