asciidoctor-pdf-cjk-ext PDF THEME supports 3 ways to use.
Supports 5 Language Code:
-
tc : Traditional Chinese
-
sc : Simplified Chinese
-
hk : Hong Kong
-
jp : Japanese
-
kr : Korean
Every Language supports 3 fonts:
-
Noto Sans CJK
-
Noto Sans Mono CJK
-
Noto Serif CJK
Run Command , ./install-zip-to-downloaded-resources-dir.sh xx
Please replace xx by your language code( EX: tc
).
$ ./install-zip-to-downloaded-resources-dir.sh tc
It will install asciidoctor-pdf-cjk-ext THEME to downloaded-resources
folder under your user home directory,
~/downloaded-resources
or /home/YOUR-USERNAME/downloaded-resources
asciidoctorPdf {
...
asciidoctorj {
...
requires "rouge"
...
attributes "build-gradle": file("build.gradle"),
"jrubyVersion": "9.3.8.0",
"toc": "",
...
"pdf-fontsdir": "${System.getProperty("user.home")}/downloaded-resources/fonts;GEM_FONTS_DIR;",
"pdf-themesdir": "${System.getProperty("user.home")}/downloaded-resources/themes",
"pdf-theme": "default-ext-notosans-cjk-tc"
If you don’t have Maven installed, or don’t want to install asciidoctor-pdf-cjk-ext to your Maven Local Repo, you can choose this method.
Run Command , ./install-jar-to-libs-dir.sh xx
Please replace xx by your language code( EX: tc
).
$ ./install-jar-to-libs-dir.sh tc
It will install asciidoctor-pdf-cjk-ext THEME to libs
folder under your user home directory,
~/libs
or /home/YOUR-USERNAME/libs
...
configurations {
asciidoctorExt
}
dependencies {
asciidoctorGems "rubygems:rouge:3.15.0"
asciidoctorExt fileTree(dir: "${System.getProperty("user.home")}/libs", include: "*.jar")
}
asciidoctorPdf {
dependsOn asciidoctorGemsPrepare
baseDirFollowsSourceFile()
asciidoctorj {
modules {
asciidoctorj {
version "2.5.6"
configurations "asciidoctorExt"
}
...
"pdf-fontsdir": "uri:classloader:/data/fonts;GEM_FONTS_DIR;",
"pdf-themesdir": "uri:classloader:/data/themes",
"pdf-theme": "default-ext-notoserif-cjk-tc"
Your machine needs to have Maven installed.
Run Command , ./install-jar-to-maven-local-repo.sh xx
Please replace xx by your language code( EX: tc
).
$ ./install-jar-to-maven-local-repo.sh tc
It will install asciidoctor-pdf-cjk-ext THEME to your maven local repo.
~/.m2
or /home/YOUR-USERNAME/.m2
Please replace xx by your language code( EX: tc
).
-
"com.life888888.lab:pdf-ext-notoserif-cjk-xx:0.1.0"
-
"com.life888888.lab:pdf-ext-notosansmono-cjk-xx:0.1.0"
-
"com.life888888.lab:pdf-ext-notosans-cjk-xx:0.1.0"
configurations {
asciidoctorExt
}
dependencies {
...
// * TC (Traditional Chinese)
asciidoctorExt "com.life888888.lab:pdf-ext-notoserif-cjk-tc:0.1.0"
asciidoctorExt "com.life888888.lab:pdf-ext-notosansmono-cjk-tc:0.1.0"
asciidoctorExt "com.life888888.lab:pdf-ext-notosans-cjk-tc:0.1.0"
...
}
asciidoctorj {
modules {
asciidoctorj {
...
configurations "asciidoctorExt"
}
...
"pdf-fontsdir": "uri:classloader:/data/fonts;GEM_FONTS_DIR;",
"pdf-themesdir": "uri:classloader:/data/themes",
"pdf-theme": "default-ext-notoserif-cjk-tc"
<plugins>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${asciidoctor.maven.plugin.version}</version>
<dependencies>
<!-- tc (Traditional Chinese) -->
<!-- Font notoserif-cjk-tc -->
<dependency>
<groupId>com.life888888.lab</groupId>
<artifactId>pdf-ext-notoserif-cjk-tc</artifactId>
<version>0.1.0</version>
</dependency>
<!-- Font notosans-cjk-tc -->
<dependency>
<groupId>com.life888888.lab</groupId>
<artifactId>pdf-ext-notosans-cjk-tc</artifactId>
<version>0.1.0</version>
</dependency>
<!-- Font notosansmono-cjk-tc -->
<dependency>
<groupId>com.life888888.lab</groupId>
<artifactId>pdf-ext-notosansmono-cjk-tc</artifactId>
<version>0.1.0</version>
</dependency>
...
<configuration>
<backend>pdf</backend>
<sourceDirectory>src/docs/asciidoc</sourceDirectory>
<sourceDocumentName>README-jp.adoc</sourceDocumentName>
<attributes>
<imagesdir>images</imagesdir>
<source-highlighter>rouge</source-highlighter>
<allow-uri-read/>
<icons>font</icons>
<pagenums/>
<toc/>
<idprefix/>
<idseparator>-</idseparator>
<!-- Fixes line wraps formatting inserting zero-width spaces (ZWSP) before CJ characters -->
<scripts>cjk</scripts>
<!-- Set asciidoctor-pdf-cjk-ext Japanese theme -->
<pdf-theme>default-ext-notosans-cjk-jp</pdf-theme>
<pdf-themesdir>uri:classloader:/data/themes</pdf-themesdir>
<pdf-fontsdir>uri:classloader:/data/fonts;GEM_FONTS_DIR;</pdf-fontsdir>
</attributes>
</configuration>