├── Dockerfile ├── Makefile └── README.adoc /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM asciidoctor/docker-asciidoctor 2 | LABEL MAINTAINER Hitoshi TAKEUCHI 3 | 4 | ENV COMPASS_VERSION 0.12.7 5 | ENV ZURB_FOUNDATION_VERSION 4.3.2 6 | ENV MERMAID_VERSION 7.0.9 7 | WORKDIR /root 8 | 9 | RUN gem install asciidoctor-pdf-cjk-kai_gen_gothic --no-ri --no-rdoc && \ 10 | gem install --version ${COMPASS_VERSION} compass --no-ri --no-rdoc && \ 11 | gem install --version ${ZURB_FOUNDATION_VERSION} zurb-foundation --no-ri --no-rdoc && \ 12 | asciidoctor-pdf-cjk-kai_gen_gothic-install && \ 13 | ln -fs /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \ 14 | apk add --no-cache nodejs nodejs-npm ca-certificates openssl && \ 15 | rm -rf /tmp/* /var/tmp/* && \ 16 | wget -O VLGothic.zip "http://osdn.jp/frs/redir.php?m=jaist&f=%2Fvlgothic%2F62375%2FVLGothic-20141206.zip" && \ 17 | unzip VLGothic.zip && \ 18 | mkdir -p /root/.fonts && \ 19 | cp VLGothic/VL-Gothic-Regular.ttf /root/.fonts && \ 20 | rm -rf /root/VLGothic* && \ 21 | wget -qO- "https://github.com/dustinblackman/phantomized/releases/download/2.1.1/dockerized-phantomjs.tar.gz" | tar xz -C / && \ 22 | npm install -g phantomjs mermaid@${MERMAID_VERSION} && \ 23 | wget https://github.com/asciidoctor/asciidoctor-stylesheet-factory/archive/master.zip && \ 24 | unzip master.zip && \ 25 | cd asciidoctor-stylesheet-factory-master && \ 26 | compass compile && \ 27 | cp -pr stylesheets / && \ 28 | cd .. && \ 29 | rm -rf master.zip asciidoctor-stylesheet-factory-master 30 | 31 | WORKDIR /documents -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | docker build --rm -t htakeuchi/docker-asciidoctor-jp . 3 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = docker-asciidoctor-jp 2 | :icons: font 3 | 4 | link:https://hub.docker.com/r/asciidoctor/docker-asciidoctor/[Asciidoctor docker container] で日本語が使えるようカスタマイズしたlink:https://github.com/liquidz/docker-asciidoctor-jp[docker-asciidoctor-jp]をベースにしたDockerコンテナです。 5 | 6 | == 何ができるか 7 | 8 | * AsciidocテキストをHTML/PDF/EPUB3/mobiへ変換する 9 | ** 図形の描画 10 | *** Graphviz 11 | *** PlantUML 12 | *** ditaa 13 | *** mermaid 7.0.9 14 | *** blockdiag(seqdiag/actdiag/nwdiag) 15 | ** シンタックスハイライト(CodeRay/Pygments/highlightjs/prettify) 16 | * Reveal.jsのプレゼンテーションを作成する 17 | * その他(https://github.com/asciidoctor/docker-asciidoctor[docker-asciidoctor参照]) 18 | 19 | == 環境 20 | 21 | * Asciidoctor 1.5.6.1 22 | * asciidoctor-pdf (alpha) 23 | * Asciidoctor-epub3 (alpha) 24 | * asciidoctor-fopub 25 | * asciidoctor-confluence 26 | * asciidoctor-revealjs 27 | * asciidoctor-pdf-cjk-kai_gen_gothic] 28 | * asciidoctor-stylesheet-factory 29 | * link:http://vlgothic.dicey.org/[VL Gothic] 30 | 31 | == 使い方 32 | 33 | .コンテナを起動 34 | ---- 35 | docker run --rm -it -v $(pwd):/documents htakeuchi/docker-asciidoctor-jp 36 | ---- 37 | 38 | .PDFの生成 39 | ---- 40 | asciidoctor-pdf -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicJP foo.adoc 41 | ---- 42 | 43 | .HTMLの生成 44 | ---- 45 | asciidoctor foo.adoc 46 | ---- 47 | 48 | [NOTE] 49 | ==== 50 | 必要に応じてオプションを追加してください。(-aのオプションは文書の属性として書くこともできます) 51 | 52 | 図形を含む:: -r asciidoctor-diagram 53 | 数式を含む:: -r asciidoctor-mathematical 54 | シンタックスハイライト:: -a source-highlighter=highlightjs 55 | スタイルシートの指定:: -a stylesheet=/path/to/css/file.css 56 | ==== 57 | 58 | .図形を含むPDFの生成 59 | ---- 60 | asciidoctor-pdf -r asciidoctor-diagram -r asciidoctor-pdf-cjk-kai_gen_gothic -a pdf-style=KaiGenGothicJP foo.adoc 61 | ---- 62 | 63 | .HTMLの生成(シンタックスハイライト+スタイルシート指定) 64 | ---- 65 | asciidoctor -a source-highlighter=highlightjs -a stylesheet=/stylesheets/github.css foo.adoc 66 | ---- 67 | 68 | .EPUB3の生成 69 | ---- 70 | asciidoctor-epub3 foo.adoc 71 | ---- 72 | 73 | [NOTE] 74 | ==== 75 | EUB3を生成する場合、いくつかのルールがあります。link:https://github.com/asciidoctor/asciidoctor-epub3[asciidoctor/asciidoctor-epub3] のサンプルなどを参照してください。 76 | ==== 77 | 78 | .mobi(Kindleフォーマット)の生成 79 | ---- 80 | kindlegen foo.epub 81 | ---- 82 | 83 | .プレゼンテーション用HTMLの生成(asciidocotr-revealjs) 84 | ---- 85 | asciidoctor-revealjs -a revealjsdir=https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0 foo.adoc 86 | ---- 87 | 88 | == License 89 | MIT 90 | --------------------------------------------------------------------------------