This repository contains a collection of sample projects that demonstrate numerous ways to use the Asciidoctor PDF CJK Ext Theme with Asciidoctor Gradle plugin in a Gradle project.
The following content is translated into English by Google Translate.
This projects is to show:
-
How to use Asciidoctor PDF CJK Ext Theme with Asciidoctor Gradle Plugin.
-
How to config Asciidoctor Gradle Plugin use Asciidoctor PDF 2.x
Clone the example repository using git:
$ git clone https://github.com/life888888/asciidoctor-pdf-cjk-ext-gradle-examples
Important
|
Prepare
Please read Usage Type first. And select one way to install something. |
You can treat each project as a distinct module. Refer to the README file in each individual project to learn how to run it.
$ cd xxxx $ ./gradlew clean asciidoctor
You can find the resulting pdf files in the build/docs/asciidocPdf directory of each project.
Warning
|
WARNING
Alternatively, you can optionally run all of examples at once using the following command from the repository root: $ ./gradlew clean asciidoctor While you can do this, I don’t recommend it. Because it takes a long time to execute all at once. In addition, some projects need to be installed according to specific types. See Usage Type. Build processing will fail if certain types of packages are not pre-installed. |
Suggested reading order for sample projects:
-
Use Asciidoctor PDF CJK Ext Theme (select Usage Type to select one.)
-
1.1 cjk-test-use-file-example
-
1.2 cjk-test-use-jar-example
-
1.3 cjk-test-use-maven-repo-example
-
-
Use custom theme with extends Asciidoctor PDF CJK Ext Theme (modify from asciidoctor-maven-examples/asciidoctor-pdf-with-theme-example)
-
2.1 cjk-test-with-theme-use-file-example
-
2.2 cjk-test-with-theme-use-jar-example
-
2.3 cjk-test-with-theme-use-maven-repo-example
-
Compare the effect of applying Custom Theme and not applying Custom
-
Use Asciidoctor PDF CJK Ext Theme (select Usage Type to select one.)
-
1.1 cjk-demo-use-file-example
-
1.2 cjk-demo-use-jar-example
-
1.3 cjk-demo-use-maven-repo-example
-
-
Use custom theme with extends Asciidoctor PDF CJK Ext Theme (modify from asciidoctor-maven-examples/asciidoctor-pdf-with-theme-example)
-
2.1 cjk-demo-with-theme-use-file-example
-
2.2 cjk-demo-with-theme-use-jar-example
-
2.3 cjk-demo-with-theme-use-maven-repo-example
-
-
manual-example (modify from https://github.com/asciidoctor/asciidoctor-gradle-examples/asciidoc-to-pdf-example)
default
theme and the font used is NotoSerif.-
Use Asciidoctor PDF CJK Ext Theme (select Usage Type to select one.)
-
2.1 manual-use-file-example
-
2.2 manual-use-jar-example
-
2.3 manual-use-maven-repo-example
-
-
Use custom theme with extends Asciidoctor PDF CJK Ext Theme (modify from https://github.com/asciidoctor/asciidoctor-maven-examples/asciidoctor-pdf-with-theme-example)
-
3.1 manual-with-theme-example
-
3.2 manual-with-theme-use-file-example
-
3.3 manual-with-theme-use-jar-example
-
- pdf-cjk-ext-adocs-examples
-
Cantains asciidoc (.adoc) files, image files. This project is only used to share asciidoc (.adoc) files, image files inside.
- asciidoctor-pdf-cjk-ext-examples-all-in-one
-
Combine all examples in one project include adoc files. Independent of the asciidoctor-pdf-cjk-ext-gradle-examples project.
Its build.gradle
file has a lot of comments that can make it difficult to read and understand.
So I divided this project into multiple projects, set them for different usage types, and removed all irrelevant annotations in build.gradle
.
Mainly divided into use-file, use-jar, use-maven-repo And use asciidoctor-pdf-cjk-ext theme or use custome theme.
Custome theme is extends asciidoctor-pdf-cjk-ext theme.
UsageType | asciidoctor-pdf-cjk-ext theme | use custome theme |
---|---|---|
use-file |
XXX-use-file-example |
XXX-with-theme-use-file-example |
use-jar |
XXX-use-jar-example |
XXX-with-theme-use-jar-example |
use-maven-repo |
XXX-use-maven-repo-example |
XXX-with-theme-use-maven-repo-example |
Change version to 3.3.2, Support Gradle 7.x.
plugins {
id "org.asciidoctor.jvm.pdf" version "3.3.2"
id "org.asciidoctor.jvm.gems" version "3.3.2"
}
Change repositories to mavenCentral().
repositories {
ruby.gems()
mavenCentral()
}
Change versions:
-
asciidoctorj: 2.5.6
-
pdf: 2.3.0
-
diagram: 2.2.3
asciidoctorPdf {
...
asciidoctorj {
modules {
asciidoctorj {
version "2.5.6"
}
pdf {
version "2.3.0"
}
diagram {
version "2.2.3"
}
}
Copyright © 2020 The life888888. Free use of this software is granted under the terms of the MIT License.
See the LICENSE.adoc file for details.
Most project is modify from asciidoctor-gradle-examples and asciidoctor-maven-examples .
See the LICENSE - AsciidoctorProject for details.