asciidoctor 2.0.9 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +193 -16
- data/LICENSE +1 -1
- data/README-de.adoc +12 -13
- data/README-fr.adoc +11 -15
- data/README-jp.adoc +242 -185
- data/README-zh_CN.adoc +17 -18
- data/README.adoc +133 -131
- data/asciidoctor.gemspec +6 -6
- data/data/locale/attributes-ar.adoc +4 -3
- data/data/locale/attributes-be.adoc +23 -0
- data/data/locale/attributes-bg.adoc +4 -3
- data/data/locale/attributes-ca.adoc +6 -5
- data/data/locale/attributes-cs.adoc +4 -3
- data/data/locale/attributes-da.adoc +6 -5
- data/data/locale/attributes-de.adoc +4 -4
- data/data/locale/attributes-en.adoc +4 -4
- data/data/locale/attributes-es.adoc +6 -5
- data/data/locale/attributes-fa.adoc +4 -3
- data/data/locale/attributes-fi.adoc +4 -3
- data/data/locale/attributes-fr.adoc +6 -5
- data/data/locale/attributes-hu.adoc +4 -3
- data/data/locale/attributes-id.adoc +4 -3
- data/data/locale/attributes-it.adoc +6 -5
- data/data/locale/attributes-ja.adoc +4 -3
- data/data/locale/{attributes-kr.adoc → attributes-ko.adoc} +4 -3
- data/data/locale/attributes-nb.adoc +4 -3
- data/data/locale/attributes-nl.adoc +6 -5
- data/data/locale/attributes-nn.adoc +4 -3
- data/data/locale/attributes-pl.adoc +8 -7
- data/data/locale/attributes-pt.adoc +6 -5
- data/data/locale/attributes-pt_BR.adoc +6 -5
- data/data/locale/attributes-ro.adoc +4 -3
- data/data/locale/attributes-ru.adoc +6 -5
- data/data/locale/attributes-sr.adoc +4 -4
- data/data/locale/attributes-sr_Latn.adoc +4 -4
- data/data/locale/attributes-sv.adoc +4 -4
- data/data/locale/attributes-tr.adoc +4 -3
- data/data/locale/attributes-uk.adoc +6 -5
- data/data/locale/attributes-zh_CN.adoc +4 -3
- data/data/locale/attributes-zh_TW.adoc +4 -3
- data/data/reference/syntax.adoc +14 -7
- data/data/stylesheets/asciidoctor-default.css +30 -30
- data/lib/asciidoctor.rb +40 -14
- data/lib/asciidoctor/abstract_block.rb +9 -4
- data/lib/asciidoctor/abstract_node.rb +16 -6
- data/lib/asciidoctor/attribute_list.rb +63 -71
- data/lib/asciidoctor/cli/invoker.rb +2 -0
- data/lib/asciidoctor/cli/options.rb +10 -9
- data/lib/asciidoctor/convert.rb +167 -162
- data/lib/asciidoctor/converter.rb +13 -12
- data/lib/asciidoctor/converter/docbook5.rb +5 -9
- data/lib/asciidoctor/converter/html5.rb +58 -45
- data/lib/asciidoctor/converter/manpage.rb +61 -38
- data/lib/asciidoctor/converter/template.rb +3 -0
- data/lib/asciidoctor/document.rb +44 -51
- data/lib/asciidoctor/extensions.rb +2 -4
- data/lib/asciidoctor/helpers.rb +20 -15
- data/lib/asciidoctor/load.rb +102 -101
- data/lib/asciidoctor/parser.rb +40 -32
- data/lib/asciidoctor/path_resolver.rb +14 -12
- data/lib/asciidoctor/reader.rb +20 -13
- data/lib/asciidoctor/rx.rb +7 -6
- data/lib/asciidoctor/substitutors.rb +69 -50
- data/lib/asciidoctor/syntax_highlighter.rb +15 -7
- data/lib/asciidoctor/syntax_highlighter/coderay.rb +1 -1
- data/lib/asciidoctor/syntax_highlighter/highlightjs.rb +12 -4
- data/lib/asciidoctor/syntax_highlighter/prettify.rb +7 -4
- data/lib/asciidoctor/syntax_highlighter/pygments.rb +6 -7
- data/lib/asciidoctor/syntax_highlighter/rouge.rb +33 -19
- data/lib/asciidoctor/table.rb +52 -23
- data/lib/asciidoctor/version.rb +1 -1
- data/man/asciidoctor.1 +8 -8
- data/man/asciidoctor.adoc +4 -4
- metadata +16 -15
data/README-jp.adoc
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
= Asciidoctor
|
2
2
|
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>; Ryan Waldron <https://github.com/erebor[@erebor]>
|
3
|
-
v2.0.
|
3
|
+
v2.0.14, 2021-04-19
|
4
4
|
// settings:
|
5
|
-
:page-layout: base
|
6
5
|
:idprefix:
|
7
6
|
:idseparator: -
|
8
7
|
:source-language: ruby
|
@@ -18,13 +17,17 @@ ifdef::env-github[]
|
|
18
17
|
:warning-caption: :warning:
|
19
18
|
endif::[]
|
20
19
|
// Variables:
|
21
|
-
:release-version: 2.0.
|
20
|
+
:release-version: 2.0.14
|
22
21
|
// URIs:
|
23
22
|
:uri-org: https://github.com/asciidoctor
|
24
23
|
:uri-repo: {uri-org}/asciidoctor
|
25
24
|
:uri-asciidoctorj: {uri-org}/asciidoctorj
|
26
25
|
:uri-asciidoctorjs: {uri-org}/asciidoctor.js
|
26
|
+
:uri-gradle-plugin: {uri-org}/asciidoctor-gradle-plugin
|
27
|
+
:uri-maven-plugin: {uri-org}/asciidoctor-maven-plugin
|
28
|
+
:uri-asciidoclet: {uri-org}/asciidoclet
|
27
29
|
:uri-project: https://asciidoctor.org
|
30
|
+
:uri-gem: https://rubygems.org/gems/asciidoctor
|
28
31
|
ifdef::env-site[:uri-project: link:]
|
29
32
|
:uri-docs: {uri-project}/docs
|
30
33
|
:uri-news: {uri-project}/news
|
@@ -33,7 +36,7 @@ ifdef::env-site[:uri-project: link:]
|
|
33
36
|
:uri-contributors: {uri-repo}/graphs/contributors
|
34
37
|
:uri-rel-file-base: link:
|
35
38
|
:uri-rel-tree-base: link:
|
36
|
-
ifdef::env-site[]
|
39
|
+
ifdef::env-site,env-yard[]
|
37
40
|
:uri-rel-file-base: {uri-repo}/blob/master/
|
38
41
|
:uri-rel-tree-base: {uri-repo}/tree/master/
|
39
42
|
endif::[]
|
@@ -41,85 +44,100 @@ endif::[]
|
|
41
44
|
:uri-contribute: {uri-rel-file-base}CONTRIBUTING.adoc
|
42
45
|
:uri-license: {uri-rel-file-base}LICENSE
|
43
46
|
:uri-tests: {uri-rel-tree-base}test
|
44
|
-
:uri-discuss:
|
45
|
-
:uri-
|
47
|
+
:uri-discuss: https://discuss.asciidoctor.org
|
48
|
+
:uri-chat: https://asciidoctor.zulipchat.com
|
46
49
|
:uri-rubygem: https://rubygems.org/gems/asciidoctor
|
47
50
|
:uri-what-is-asciidoc: {uri-docs}/what-is-asciidoc
|
48
51
|
:uri-user-manual: {uri-docs}/user-manual
|
49
52
|
:uri-install-docker: https://github.com/asciidoctor/docker-asciidoctor
|
50
53
|
//:uri-install-doc: {uri-docs}/install-toolchain
|
51
|
-
:uri-install-
|
52
|
-
:uri-
|
54
|
+
:uri-install-macos-doc: {uri-docs}/install-asciidoctor-macos
|
55
|
+
:uri-convert-doc: {uri-docs}/convert-documents
|
53
56
|
:uri-themes-doc: {uri-docs}/produce-custom-themes-using-asciidoctor-stylesheet-factory
|
54
57
|
:uri-gitscm-repo: https://github.com/git/git-scm.com
|
55
58
|
:uri-prototype: {uri-gitscm-repo}/commits/master/lib/asciidoc.rb
|
56
59
|
:uri-freesoftware: https://www.gnu.org/philosophy/free-sw.html
|
57
60
|
:uri-foundation: https://foundation.zurb.com
|
61
|
+
:uri-opal: https://opalrb.com
|
58
62
|
:uri-tilt: https://github.com/rtomayko/tilt
|
59
|
-
:uri-ruby: https://ruby-lang.org
|
63
|
+
:uri-ruby: https://www.ruby-lang.org
|
60
64
|
// images:
|
61
65
|
:image-uri-screenshot: https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/screenshot.png
|
62
66
|
|
63
|
-
{uri-project}
|
64
|
-
AsciidoctorはRubyで書かれており,
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
67
|
+
{uri-project}[Asciidoctor]は, {uri-what-is-asciidoc}[AsciiDoc] で書かれたコンテンツをHTML5, DocBook, PDFなどのフォーマットに変換する, _高速で_ {uri-license}[オープンソース] のテキストプロセッサおよびパブリッシングツールチェインです.
|
68
|
+
AsciidoctorはRubyで書かれており, すべての主要オペレーティングシステムで動作します.
|
69
|
+
Asciidoctorプロジェクトは {uri-repo}[GitHubにホスティング] されています.
|
70
|
+
|
71
|
+
インストールをシンプルにするため, AsciidoctorはRubyGem(gem)パッケージとして, {uri-rubygem}[RubyGems.org] で配布されています.
|
72
|
+
さらに, Asciidoctorは主要なLinuxディストリビューション用およびmacOS用パッケージとしても配布されています.
|
73
|
+
AsciidctorはRubyで動作するだけでなく, {uri-asciidoctorj}[AsciidoctorJ]としてJVM上でも動作します. また, {uri-asciidoctorjs}[Asciidoctor.js]としてどのようなJavaScript環境(ブラウザを含む)でも実行できます.
|
74
|
+
|
75
|
+
ifndef::env-site,env-yard[]
|
76
|
+
このドキュメントには以下の言語版が存在します: +
|
77
|
+
{uri-rel-file-base}README.adoc[English]
|
78
|
+
|
|
79
|
+
{uri-rel-file-base}README-zh_CN.adoc[汉语]
|
80
|
+
|
|
81
|
+
{uri-rel-file-base}README-de.adoc[Deutsch]
|
82
|
+
|
|
83
|
+
{uri-rel-file-base}README-fr.adoc[Français]
|
74
84
|
endif::[]
|
75
85
|
|
76
|
-
|
86
|
+
.主なドキュメント
|
77
87
|
[.compact]
|
78
88
|
* {uri-docs}/what-is-asciidoc[What is AsciiDoc?]
|
79
89
|
* {uri-docs}/asciidoc-writers-guide[AsciiDoc Writer's Guide]
|
80
|
-
* {uri-docs}/asciidoc-syntax-quick-reference[AsciiDoc Syntax Reference]
|
81
90
|
* {uri-docs}/user-manual[Asciidoctor User Manual]
|
82
|
-
|
83
|
-
.Rubyの行く先, Asciidoctorの追うところ
|
84
|
-
****
|
85
|
-
AsciidoctorはJRubyを用いてJVM上でも実行できます.
|
86
|
-
Javaや他のJVM言語からAsciidoctor APIを直接呼び出すには, {uri-asciidoctorj}[AsciidoctorJ] を使ってください.
|
87
|
-
AsciidoctorJに基づいた, AsciidoctorプロセッサをApache Maven, GradleやJavadocに統合するプラグインがあります.
|
88
|
-
|
89
|
-
AsciidoctorはJavaScriptでも実行可能です.
|
90
|
-
{uri-asciidoctorjs}[Asciidoctor.js], WebブラウザやNode.jsのようなJavaScript環境で動くAsciidoctorの完全機能版, を生成するために, RubyのソースをJavaScriptにトランスパイルするのに https://opalrb.com[Opal]を使います.
|
91
|
-
Asciidoctor.jsはChrome, Atom, Brackets や他のウェブベースのツールの拡張機能としてAsciiDocのプレビューのために使われます.
|
92
|
-
****
|
91
|
+
* {uri-docs}/asciidoc-syntax-quick-reference[AsciiDoc Syntax Reference]
|
93
92
|
|
94
93
|
ifdef::status[]
|
95
|
-
|
96
|
-
image:https://img.shields.io/
|
97
|
-
image:https://
|
98
|
-
|
99
|
-
image:https://
|
100
|
-
image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs, link="https://inch-ci.org/github/asciidoctor/asciidoctor"]
|
94
|
+
image:https://img.shields.io/gem/v/asciidoctor.svg[Latest Release, link={uri-gem}]
|
95
|
+
image:https://img.shields.io/badge/rubydoc.info-{release-version}-blue.svg[library (API) docs,link=https://www.rubydoc.info/gems/asciidoctor/{release-version}]
|
96
|
+
image:https://github.com/asciidoctor/asciidoctor/workflows/CI/badge.svg[Build Status (GitHub Actions),link={uri-repo}/actions]
|
97
|
+
image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs,link=https://inch-ci.org/github/asciidoctor/asciidoctor]
|
98
|
+
image:https://img.shields.io/badge/zulip-join_chat-brightgreen.svg[project chat,link=https://asciidoctor.zulipchat.com/]
|
101
99
|
endif::[]
|
102
100
|
|
103
|
-
==
|
101
|
+
== スポンサー
|
102
|
+
|
103
|
+
{uri-project}/supporters[スポンサー] のみなさまが, このプロジェクトをサポートし, より良いテクニカルドキュメンテーションの実現にコミットメントをしてくださっていることに感謝します.
|
104
|
+
スポンサーのみなさま, ありがとうございます!
|
105
|
+
みなさまの多くのサポートなくしてAsciidoctorは実現不可能です.
|
104
106
|
|
105
|
-
|
106
|
-
Asciidoctorは枠にとらわれない快適なエクスペリエンスのためにデフォルトスタイルシートをHTML 5ドキュメントに適用します.
|
107
|
+
https://opencollective.com/asciidoctor[OpenCollective] を通じてスポンサーになることにより, このプロジェクトを支援することができます.
|
107
108
|
|
108
|
-
|
109
|
+
== 全体像
|
109
110
|
|
110
|
-
|
111
|
-
|
112
|
-
生成された出力をカスタマイズ, あるいは追加のフォーマットをつくるためにあなた自身のコンバータを使うことや {uri-tilt}[Tilt]-supported テンプレートを読み込むオプションがあります.
|
111
|
+
Asciidoctorは, 下図左側のようなプレーンテキストを読み込んで, 右側のようなHTML5に変換します.
|
112
|
+
特別な設定をしなくてもきれいな表示が得られるよう, HTML5の出力にはデフォルトのスタイルシートが適用されます.
|
113
113
|
|
114
|
-
|
115
|
-
Asciidoctorテストスイートは {uri-tests}[> 1,600 tests] をAsciiDoc文法との互換性を保証するために有しています.
|
114
|
+
image::{image-uri-screenshot}[AsciiDocソースとレンダリングされたHTMLのプレビュー]
|
116
115
|
|
117
|
-
|
118
|
-
AsciidoctorはHTML 5出力をスタイルするため, モダンで, {uri-foundation}[Foundation] に基づいたレスポンシブテーマをも提供します.
|
116
|
+
== AsciiDocの処理
|
119
117
|
|
120
|
-
|
118
|
+
Asciidoctorは, AsciiDoc文法で書かれたテキストを読み込んでパースします. 次に内蔵コンバータにパースツリーを渡します. これによりHTML5, DocBook 5やman(マニュアルmanページ)が出力されます.
|
119
|
+
出力をカスタマイズしたりフォーマットを追加したりしたいときは, ユーザ独自のコンバータや {uri-tilt}[Tilt] 対応テンプレートを使用することができます.
|
121
120
|
|
122
|
-
Asciidoctor
|
121
|
+
AsciidoctorはオリジナルのAsciiDoc Pythonプロセッサ(`asciidoc.py`)に完全互換です.
|
122
|
+
Asciidoctorのテストスイートには, AsciiDoc文法との互換性を保証するために {uri-tests}[2350個を超えるテスト] が入っています.
|
123
|
+
|
124
|
+
Asciidoctorでは, AsciiDocの従来の文法のほかに, Asciidoctorで追加されたマークアップとフォーマッティングオプションが使用できます. フォントベースのアイコン (例えば, `+icon:fire[]+`) やUIエレメント(`+button:[Save]+`)がそれにあたります.
|
125
|
+
またAsciidoctorは, HTML5出力時のスタイルとして {uri-foundation}[Foundation] に基づいたモダンでレスポンシブなテーマも提供します.
|
126
|
+
|
127
|
+
== RubyのあるところAsciidoctorも動く
|
128
|
+
|
129
|
+
AsciidoctorはJRubyを用いてJVM上でも実行できます.
|
130
|
+
Javaや他のJVM言語からAsciidoctor APIを直接呼び出すには, {uri-asciidoctorj}[AsciidoctorJ] を使ってください.
|
131
|
+
AsciidoctorJを使ったAsciiDocの処理をビルドに直接組み込むビルドツール用プラグインとして, {uri-maven-plugin}[Apache Maven用], {uri-gradle-plugin}[Gradle用], および {uri-asciidoclet}[Javadoc用] が存在します.
|
132
|
+
|
133
|
+
AsciidoctorはJavaScriptでも実行可能です.
|
134
|
+
Rubyで書かれたソースを {uri-opal}[Opal] を使ってJavaScriptにトランスパイルすることで {uri-asciidoctorjs}[Asciidoctor.js] が作成されています.
|
135
|
+
Asciidoctor.jsはどんなJavaScript環境(WebブラウザやNode.jsを含む)でも動作する, JavaScript版の完全なAsciidoctorです.
|
136
|
+
Chrome, Atom, Bracketsやその他のウェブベースのツールで, AsciiDocをプレビューするための拡張機能にAsciidoctor.jsが使われています.
|
137
|
+
|
138
|
+
== 必要条件
|
139
|
+
|
140
|
+
AsciidoctorはLinux, macOS, およびWindowsで動作し, 下記の {uri-ruby}[Ruby]実装の一つを必要とします.
|
123
141
|
|
124
142
|
* CRuby (aka MRI) 2.3 - 2.6
|
125
143
|
* JRuby 9.1 - 9.2
|
@@ -128,58 +146,121 @@ AsciidoctorはLinux, OS X (Mac)とWindowsで動き, 下記の {uri-ruby}[Ruby]
|
|
128
146
|
|
129
147
|
[CAUTION]
|
130
148
|
====
|
131
|
-
もし非英語環境のWindowsを使っているなら, Asciidoctorを起動した時に `Encoding::UndefinedConversionError`
|
132
|
-
|
149
|
+
もし非英語環境のWindowsを使っているなら, Asciidoctorを起動した時に `Encoding::UndefinedConversionError` に遭遇するかもしれません.
|
150
|
+
これを解決するには, 以下のコマンドにより, 使っているコンソールの有効なコードページをUTF-8に変更することを推奨します:
|
133
151
|
|
134
152
|
chcp 65001
|
135
153
|
|
136
|
-
に変更することを推奨します.
|
137
154
|
一度この変更をすると, Unicode関連の頭痛の種は消えるでしょう.
|
138
155
|
もしEclipseのようなIDEを使っているなら, 同様にエンコーディングをUTF-8にするのを忘れないでください.
|
139
|
-
AsciidoctorはUTF-8
|
156
|
+
AsciidoctorはUTF-8の環境において最も良好に動作します.
|
140
157
|
====
|
141
158
|
|
142
|
-
==
|
159
|
+
== インストール
|
143
160
|
|
144
|
-
Asciidoctor
|
161
|
+
Asciidoctorは, (a) 主なLinuxディストリビューションのパッケージマネージャ, (b) macOSのHomebrew, (c) `gem install` コマンド(Windowsユーザに推奨), (d) Asciidoctor Dockerイメージ, あるいは(e) Bundlerを用いてインストールできます.
|
145
162
|
|
146
|
-
|
147
|
-
欠点はgemのリリース直後にはすぐには有効にならないことです.
|
148
|
-
もし最新バージョンを使いたければ, 必ず `gem` コマンドを使いましょう.
|
163
|
+
Linuxパッケージマネージャを用いてインストールする利点は, もしRubyやRubyGemsライブラリがまだインストールされていなかったら, それらをインストールしてくれることです.
|
149
164
|
|
150
|
-
=== (a)
|
165
|
+
=== (a) Linuxのパッケージマネージャ
|
151
166
|
|
152
|
-
|
167
|
+
パッケージマネージャによってインストールされるAsciidoctorは最新バージョンではないかもしれません.
|
168
|
+
ディストリビューションの各リリースにおいてどのバージョンのAsciidoctorがパッケージされているかを確認するには, パッケージリポジトリを参照してください.
|
153
169
|
|
154
|
-
|
170
|
+
* https://pkgs.alpinelinux.org/packages?name=asciidoctor[Alpine Linux (asciidoctor)]
|
171
|
+
* https://www.archlinux.org/packages/?name=asciidoctor[Arch Linux (asciidoctor)]
|
172
|
+
* https://packages.debian.org/sid/asciidoctor[Debian (asciidoctor)]
|
173
|
+
* https://apps.fedoraproject.org/packages/rubygem-asciidoctor[Fedora (asciidoctor)]
|
174
|
+
* https://software.opensuse.org/package/rubygem-asciidoctor[OpenSUSE (rubygem-asciidoctor)]
|
175
|
+
* https://packages.ubuntu.com/search?keywords=asciidoctor[Ubuntu (asciidoctor)]
|
155
176
|
|
156
|
-
|
177
|
+
パッケージマネージャによってインストールされるバージョンよりも新しいAsciidoctorを使用したい場合は, <<gem-install,gemのインストール方法>> を参照してください.
|
157
178
|
|
158
|
-
|
179
|
+
==== apk (Alpine Linux)
|
159
180
|
|
160
|
-
|
161
|
-
[TIP]
|
162
|
-
====
|
163
|
-
もしAsciidoctorの以前のバージョンがインストール済みであれば, 以下によってアップデートできます:
|
181
|
+
Alpine Linuxにgemをインストールするには, ターミナルを開き, 以下を入力してください:
|
164
182
|
|
165
|
-
$
|
183
|
+
$ sudo apk add asciidoctor
|
166
184
|
|
167
|
-
|
168
|
-
そのときは, 以下のgemコマンドで古いバージョンを削除しましょう:
|
185
|
+
==== pacman (Arch Linux)
|
169
186
|
|
170
|
-
|
171
|
-
|
187
|
+
Archベースのディストリビューションにgemをインストールするには, ターミナルを開き, 以下を入力してください:
|
188
|
+
|
189
|
+
$ sudo pacman -S asciidoctor
|
190
|
+
|
191
|
+
==== APT
|
192
|
+
|
193
|
+
Debian, またはUbuntuなどDebianベースのディストリビューションでは, APTを使ってAsciidoctorをインストールしてください.
|
194
|
+
Asciidoctorパッケージをインストールするには, ターミナルを開き, 以下を入力してください:
|
195
|
+
|
196
|
+
$ sudo apt-get install -y asciidoctor
|
197
|
+
|
198
|
+
==== DNF
|
199
|
+
|
200
|
+
Fedora, CentOS, RHELなどRPMベースのLinuxディストリビューションでは, DNFパッケージマネージャを使ってAsciidoctorをインストールしてください.
|
201
|
+
Asciidoctorパッケージをインストールするには, ターミナルを開き, 以下を入力してください:
|
202
|
+
|
203
|
+
$ sudo dnf install -y asciidoctor
|
204
|
+
|
205
|
+
=== (b) Homebrew (macOS)
|
206
|
+
|
207
|
+
macOSでは, パッケージマネージャHomebrewを使用してAsciidoctorをインストールすることができます.
|
208
|
+
Homebrewをお持ちでない場合は, まず https://brew.sh/[brew.sh] の説明に従ってHomebrewをインストールしてください.
|
209
|
+
Homebrewをインストールできたら, `asciidoctor` gemをインストールすることができます.
|
210
|
+
ターミナルを開き, 以下を入力してください:
|
211
|
+
|
212
|
+
$ brew install asciidoctor
|
213
|
+
|
214
|
+
Homebrewにより, システムレベルのgemとは別の独立したprefixのパスに `asciidoctor` gemがインストールされます.
|
215
|
+
|
216
|
+
=== (c) Windows
|
172
217
|
|
173
|
-
|
218
|
+
WindowsでAsciidoctorを使う場合は, 簡単な方法が2つあります.
|
174
219
|
|
175
|
-
|
220
|
+
==== Chocolatey
|
221
|
+
|
222
|
+
すでにお使いのマシンで https://chocolatey.org[chocolatey] を使用しているなら, 以下の方法を使用することができます:
|
223
|
+
|
224
|
+
[source]
|
225
|
+
----
|
226
|
+
choco install ruby
|
227
|
+
----
|
228
|
+
|
229
|
+
そのあとは <<gem-install,gemのインストール方法>> に従ってください.
|
230
|
+
|
231
|
+
==== Rubyinstaller
|
232
|
+
|
233
|
+
https://rubyinstaller.org/downloads/[Rubyinstaller] を使用したい場合は, お使いのWindowsのバージョンに適したRubyinstallerをダウンロードしてRubyをインストールしたあと, <<gem-install,gemのインストール方法>> に従ってください.
|
234
|
+
|
235
|
+
[#gem-install]
|
236
|
+
=== (d) gem install
|
237
|
+
|
238
|
+
Asciidoctorを `gem install` を使ってインストールするのであれば, その前に https://rvm.io[RVM] を使ってhomeディレクトリ(つまりユーザ領域)にRubyをインストールしておくべきです.
|
239
|
+
そうすれば, `gem` コマンドを使用して安全にAsciidoctor gemのインストールやアップデートができます.
|
240
|
+
RVMを使用すると, システムから隔離された場所にgemがインストールされます.
|
241
|
+
|
242
|
+
ターミナルを開き, 以下のように入力してください:
|
243
|
+
|
244
|
+
$ gem install asciidoctor
|
245
|
+
|
246
|
+
もし, 先行リリースバージョン(例えばリリース候補版)をインストールしたければ以下のようにします.
|
247
|
+
|
248
|
+
$ gem install asciidoctor --pre
|
249
|
+
|
250
|
+
=== (e) Docker
|
251
|
+
|
252
|
+
{uri-install-docker}[Installing Asciidoctor using Docker]を参照してください.
|
253
|
+
|
254
|
+
=== (f) Bundler
|
255
|
+
|
256
|
+
. プロジェクトのルートフォルダ(またはカレントディレクトリ)にGemfileを作成
|
176
257
|
. `asciidoctor` gemをGemfileに以下のように追加:
|
177
258
|
+
|
178
259
|
[source,subs=attributes+]
|
179
260
|
----
|
180
261
|
source 'https://rubygems.org'
|
181
262
|
gem 'asciidoctor'
|
182
|
-
#
|
263
|
+
# または明示的にバージョンを指定
|
183
264
|
# gem 'asciidoctor', '{release-version}'
|
184
265
|
----
|
185
266
|
|
@@ -189,111 +270,89 @@ gem 'asciidoctor'
|
|
189
270
|
$ bundle
|
190
271
|
|
191
272
|
gemをアップグレードするには, Gemfileで新バージョンを指定し, `bundle` を再び実行してください.
|
192
|
-
`bundle update`
|
273
|
+
`bundle update` を(gemを指定せずに)行うことは推奨 *されません* . 他のgemもアップデートされて思わぬ結果になるかもしれないためです.
|
193
274
|
|
194
|
-
|
275
|
+
== アップグレード
|
195
276
|
|
196
|
-
|
277
|
+
オペレーティングシステムのパッケージマネージャでAsciidoctorをインストールしたのであれば, おそらくパッケージは自動的にアップデートされるように設定されています. その場合は, gemを手動でアップデートする必要はありません.
|
197
278
|
|
198
|
-
|
279
|
+
=== apk (Alpine Linux)
|
199
280
|
|
200
|
-
|
201
|
-
|
202
|
-
gemをアップグレードするには:
|
203
|
-
|
204
|
-
$ sudo dnf update -y asciidoctor
|
205
|
-
|
206
|
-
TIP: お使いのシステムは自動的にrpmパッケージをアップデートするよう設定されているかも知れません.その場合, gemのアップデートのためにあなたがすべきことはありません.
|
281
|
+
gemをアップグレードするには, 以下を使用してください:
|
207
282
|
|
208
|
-
|
209
|
-
|
210
|
-
Debian, UbuntuまたはMintにインストールするには, ターミナルを開き, 以下を入力してください:
|
283
|
+
$ sudo apk add -u asciidoctor
|
211
284
|
|
212
|
-
|
285
|
+
=== APT
|
213
286
|
|
214
|
-
gem
|
287
|
+
gemをアップグレードするには, 以下を使用してください:
|
215
288
|
|
216
289
|
$ sudo apt-get upgrade -y asciidoctor
|
217
290
|
|
218
|
-
|
219
|
-
|
220
|
-
パッケージマネージャ(apt-get)によってインストールされたバージョンのAsciidoctorは最新リリースのAsciidoctorではないかもしれません.
|
221
|
-
ディストリビューションのリリース毎に, どのバージョンがパッケージされているかはパッケージリポジトリを調べてください.
|
222
|
-
|
223
|
-
* https://packages.debian.org/search?keywords=asciidoctor&searchon=names&exact=1&suite=all§ion=all[asciidoctor package by Debian release]
|
224
|
-
* https://packages.ubuntu.com/search?keywords=asciidoctor&searchon=names&exact=1&suite=all§ion=all[asciidoctor package by Ubuntu release]
|
225
|
-
* https://community.linuxmint.com/software/view/asciidoctor[asciidoctor package by Mint release]
|
291
|
+
=== DNF
|
226
292
|
|
227
|
-
|
228
|
-
====
|
229
|
-
パッケージマネージャによって管理されているgemをアップデートするのに `gem udpate` コマンドを使うなといわれるでしょう.
|
230
|
-
そのようなことをするのは, パッケージマネージャがファイル(/usr/local下にインストールされた)を追跡できなくなるためにシステムが不安定な状態にするためです.
|
231
|
-
単純に, システムgemはパッケージマネージャによってのみ管理されるべきです.
|
293
|
+
gemをアップグレードするには, 以下を使用してください:
|
232
294
|
|
233
|
-
|
234
|
-
それから, 安心して `gem` コマンドをAsciidoctorのアップデート, インストールのために使うことができます.
|
235
|
-
RVMやrbenvを使っているなら, gemはシステムからは孤立した場所にインストールされます.
|
236
|
-
====
|
295
|
+
$ sudo dnf update -y asciidoctor
|
237
296
|
|
238
|
-
|
297
|
+
=== Homebrew (macOS)
|
239
298
|
|
240
|
-
|
299
|
+
gemをアップグレードするには, 以下を使用してください:
|
241
300
|
|
242
|
-
$
|
301
|
+
$ brew update
|
302
|
+
$ brew upgrade asciidoctor
|
243
303
|
|
244
|
-
gem
|
304
|
+
=== gem install
|
245
305
|
|
246
|
-
|
306
|
+
`gem` コマンドを使ってAsciidoctorをインストールした場合は, 新しいバージョンのAsciidoctorがリリースされたら手動でアップグレードする必要があります.
|
307
|
+
以下を入力することでアップグレードできます:
|
247
308
|
|
248
|
-
|
309
|
+
$ gem install asciidoctor
|
249
310
|
|
250
|
-
|
311
|
+
`gem install` を使って新しいバージョンのgemをインストールすると, 複数のバージョンがインストールされた状態になります.
|
312
|
+
以下のコマンドを使って古いバージョンを削除してください.
|
251
313
|
|
252
|
-
|
253
|
-
* {uri-install-osx-doc}[Installing Asciidoctor on Mac OS X]
|
254
|
-
// at the moment, the following entry is just a reiteration of the information in this README
|
255
|
-
//* {uri-install-doc}[Installing the Asciidoctor toolchain]
|
314
|
+
$ gem cleanup asciidoctor
|
256
315
|
|
257
|
-
==
|
316
|
+
== 使い方
|
258
317
|
|
259
|
-
Asciidoctor
|
260
|
-
確認のために,
|
318
|
+
Asciidoctorのインストールが成功すると, `asciidoctor` コマンドがPATHに存在するようになり, Asciidoctorのコマンドラインインターフェース(CLI)が使用できるようになります.
|
319
|
+
確認のために, ターミナルで以下を実行しましょう:
|
261
320
|
|
262
321
|
$ asciidoctor --version
|
263
322
|
|
264
|
-
AsciidoctorのバージョンとRuby
|
323
|
+
AsciidoctorのバージョンとRuby環境についての情報がターミナルに出力されるはずです.
|
265
324
|
|
266
325
|
[.output,subs=attributes+]
|
267
326
|
....
|
268
327
|
Asciidoctor {release-version} [https://asciidoctor.org]
|
269
|
-
Runtime Environment (ruby 2.
|
328
|
+
Runtime Environment (ruby 2.6.0p0 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)
|
270
329
|
....
|
271
330
|
|
272
|
-
AsciidoctorはAPI
|
273
|
-
APIは他のRubyソフトウェア, Rails, Sinatra
|
331
|
+
AsciidoctorはAPIも提供します.
|
332
|
+
APIは他のRubyソフトウェア, たとえばRails, Sinatra, GitHub, そして他の言語, たとえばJava ({uri-asciidoctorj}[AsciidoctorJ] 経由)やJavaScript ({uri-asciidoctorjs}[Asciidoctor.js] 経由)と組み合わせて使用するためのものです.
|
274
333
|
|
275
|
-
===
|
334
|
+
=== コマンドラインインターフェース (CLI)
|
276
335
|
|
277
|
-
`asciidoctor`
|
336
|
+
`asciidoctor` コマンドによりコマンドライン(つまりターミナル)からAsciidoctorを起動することができます.
|
278
337
|
|
279
|
-
|
280
|
-
|
338
|
+
次のコマンドにより, README.adocというファイルがHTMLに変換され, 結果が同じディレクトリのREADME.htmlとして保存されます.
|
339
|
+
生成されるHTMLファイルの名前は, ソースファイルのファイル名の拡張子を `.html` に替えたものとなります.
|
281
340
|
|
282
341
|
$ asciidoctor README.adoc
|
283
342
|
|
284
|
-
Asciidoctor
|
343
|
+
さまざまなフラグやスイッチを与えることでAsciidoctorプロセッサをコントロールすることができます. フラグやスイッチの説明は以下のコマンドで表示されます:
|
285
344
|
|
286
345
|
$ asciidoctor --help
|
287
346
|
|
288
|
-
例えば,
|
347
|
+
例えば, ファイルを異なるディレクトリに書き出すには以下を使用します:
|
289
348
|
|
290
349
|
$ asciidoctor -D output README.adoc
|
291
350
|
|
292
|
-
`asciidoctor` {uri-manpage}[man
|
351
|
+
コマンドラインインタフェースの完全なリファレンスは `asciidoctor` の {uri-manpage}[manページ] にあります.
|
293
352
|
|
294
|
-
`asciidoctor`
|
353
|
+
`asciidoctor` コマンドの使い方の詳細については以下を参照してください.
|
295
354
|
|
296
|
-
* {uri-
|
355
|
+
* {uri-convert-doc}[How do I convert a document?]
|
297
356
|
* {uri-themes-doc}[How do I use the Asciidoctor stylesheet factory to produce custom themes?]
|
298
357
|
|
299
358
|
=== Ruby API
|
@@ -303,16 +362,16 @@ Asciidoctorをアプリケーションの中で使うには, まずgemをrequire
|
|
303
362
|
[source]
|
304
363
|
require 'asciidoctor'
|
305
364
|
|
306
|
-
|
365
|
+
そうすると, 以下のようにしてAsciiDocソースファイルをHTMLファイルに変換できます:
|
307
366
|
|
308
367
|
[source]
|
309
368
|
Asciidoctor.convert_file 'README.adoc', to_file: true, safe: :safe
|
310
369
|
|
311
|
-
WARNING: AsciidoctorをAPI
|
312
|
-
セキュアモードでは,
|
313
|
-
|
370
|
+
WARNING: AsciidoctorをAPI経由で使っているとき, デフォルトのセーフモードは `:secure` (セキュアモード)です.
|
371
|
+
セキュアモードでは, `include` ディレクティブを含むいくつかのコア機能が無効化されています.
|
372
|
+
これらの機能を有効化したい場合, 明示的にセーフモードを `:server` (推奨)か `:safe` にする必要があります.
|
314
373
|
|
315
|
-
AsciiDoc
|
374
|
+
AsciiDoc文字列を, 埋め込み用HTML(HTMLページヘの挿入用)に変換することもできます:
|
316
375
|
|
317
376
|
[source]
|
318
377
|
----
|
@@ -320,7 +379,7 @@ content = '_Zen_ in the art of writing https://asciidoctor.org[AsciiDoc].'
|
|
320
379
|
Asciidoctor.convert content, safe: :safe
|
321
380
|
----
|
322
381
|
|
323
|
-
もし完全なHTML
|
382
|
+
もし完全なHTMLドキュメントが必要であれば, 以下のように `header_footer` オプションを有効にしてください:
|
324
383
|
|
325
384
|
[source]
|
326
385
|
----
|
@@ -328,7 +387,7 @@ content = '_Zen_ in the art of writing https://asciidoctor.org[AsciiDoc].'
|
|
328
387
|
html = Asciidoctor.convert content, header_footer: true, safe: :safe
|
329
388
|
----
|
330
389
|
|
331
|
-
|
390
|
+
パースされたドキュメントにアクセスしたい場合は, 変換を複数のステップに分割します:
|
332
391
|
|
333
392
|
[source]
|
334
393
|
----
|
@@ -338,81 +397,79 @@ puts document.doctitle
|
|
338
397
|
html = document.convert
|
339
398
|
----
|
340
399
|
|
341
|
-
Asciidoctor
|
342
|
-
|
400
|
+
Asciidoctorの生成する出力が気に入らない場合は, _あなたはそれを変更できる_ ことを忘れないでください!
|
401
|
+
パースされたドキュメントを出力形式に変換するコンバータは, カスタマイズが可能です.
|
343
402
|
|
344
|
-
|
345
|
-
|
403
|
+
出力を部分的にカスタマイズする簡単な方法としてはテンプレートコンバータがあります.
|
404
|
+
テンプレートコンバータでは, ドキュメントの各ノードの変換に {uri-tilt}[Tilt]対応テンプレートファイルを使うことができます.
|
346
405
|
|
347
|
-
|
348
|
-
APIの使い方や出力のカスタマイズ方法についてのより詳しい情報は {uri-user-manual}[
|
406
|
+
さまざまな方法を使って出力は100%制御することが _できます_ .
|
407
|
+
APIの使い方や出力のカスタマイズ方法についてのより詳しい情報は {uri-user-manual}[ユーザマニュアル] を参照してください.
|
349
408
|
|
350
|
-
==
|
409
|
+
== コントリビューション
|
351
410
|
|
352
|
-
|
353
|
-
|
354
|
-
New contributors are always welcome!
|
411
|
+
新しいコントリビューションを常に歓迎します!
|
412
|
+
もしソースコード, ドキュメント, あるいはウェブサイトに間違いや不備を見つけたら遠慮なく, イシューを作成するか, 修正をおこなってpull requestを作成してください.
|
355
413
|
|
356
|
-
*あなた*
|
414
|
+
*あなた* にもできることがあります:
|
357
415
|
|
358
|
-
* 先行バージョン(alpha, beta
|
416
|
+
* 先行バージョン(alpha, beta, またはpreview版)の使用
|
359
417
|
* バグレポート
|
360
418
|
* 新機能提案
|
361
|
-
*
|
362
|
-
*
|
363
|
-
* コーディング -- _パッチでも, 足りなすぎるなんてことはありません_
|
419
|
+
* ドキュメントの執筆または編集
|
420
|
+
* テストをつけてコードを書くこと -- _どのようなパッチであれ小さすぎるなどということはありません_
|
364
421
|
** typoの修正
|
365
422
|
** コメントの追加
|
366
423
|
** 一貫性のないホワイトスペースの除去
|
367
424
|
** テストの記述!
|
368
425
|
* リファクタリング
|
369
|
-
*
|
370
|
-
*
|
426
|
+
* {uri-issues}[イシュー] の解決
|
427
|
+
* パッチのレビュー
|
371
428
|
|
372
|
-
{uri-contribute}[Contributing]
|
429
|
+
Asciidoctorプロジェクトにイシュー, 機能リクエスト, コード, ドキュメントを送る際の, 作成方法, スタイル, および送り方は, {uri-contribute}[Contributing] ガイドに記載されています.
|
373
430
|
|
374
|
-
==
|
431
|
+
== 助けを得る
|
375
432
|
|
376
|
-
Asciidoctor
|
377
|
-
|
378
|
-
|
433
|
+
Asciidoctorは, コンテンツの執筆と公開を簡単にするために開発されています.
|
434
|
+
しかしあなたからのフィードバックがなくてはAsciidoctorの開発は進みません!
|
435
|
+
ディスカッションリスト, Twitter, チャットルームを使って, 質問をしたりプロジェクトのさまざまな側面について話し合ったりすることをお勧めします.
|
379
436
|
|
380
|
-
|
381
|
-
|
382
|
-
|
437
|
+
チャット(Zulip):: {uri-chat}
|
438
|
+
ディスカッションリスト(Nabble):: {uri-discuss}
|
439
|
+
Twitter:: ハッシュタグ https://twitter.com/search?f=tweets&q=%23asciidoctor[#asciidoctor] またはメンション https://twitter.com/asciidoctor[@asciidoctor]
|
383
440
|
|
384
441
|
ifdef::env-github[]
|
385
|
-
|
442
|
+
以下のプロジェクトサイトに, Asciidoctorに関するさらに詳しい情報やドキュメントがあります.
|
386
443
|
|
387
|
-
{uri-project}
|
444
|
+
{uri-project}[Home] | {uri-news}[News] | {uri-docs}[Docs]
|
388
445
|
endif::[]
|
389
446
|
|
390
|
-
GitHub上のAsciidoctor
|
447
|
+
GitHub上のAsciidoctorのorganizationではプロジェクトのソースコード, イシュートラッカー, サブプロジェクトが管理されています.
|
391
448
|
|
392
|
-
|
393
|
-
|
394
|
-
Asciidoctor
|
449
|
+
ソースリポジトリ(git):: {uri-repo}
|
450
|
+
イシュートラッカー:: {uri-issues}
|
451
|
+
GitHub上のAsciidoctorのorganization:: {uri-org}
|
395
452
|
|
396
|
-
==
|
453
|
+
== ライセンス
|
397
454
|
|
398
|
-
Copyright (C) 2012-
|
399
|
-
本ソフトウェアはMIT
|
455
|
+
Copyright (C) 2012-2021 Dan Allen, Sarah White, Ryan Waldron, and the individual contributors to Asciidoctor.
|
456
|
+
本ソフトウェアはMITライセンスのもとで使用できます.
|
400
457
|
|
401
|
-
|
458
|
+
ライセンスの詳細については {uri-license}[LICENSE] ファイルを参照してください.
|
402
459
|
|
403
|
-
==
|
460
|
+
== 作者
|
404
461
|
|
405
|
-
*Asciidoctor* は https://github.com/mojavelinux[Dan Allen] と https://github.com/graphitefriction[Sarah White]
|
406
|
-
このプロジェクトは
|
462
|
+
*Asciidoctor* は https://github.com/mojavelinux[Dan Allen] と https://github.com/graphitefriction[Sarah White] がリードし, Asciidoctorの素晴らしきコミュニティの {uri-contributors}[数多くのメンバ] からコントリビューションを受けてきました.
|
463
|
+
このプロジェクトは https://github.com/nickh[Nick Hengeveld] の {uri-prototype}[プロトタイプ] をベースに https://github.com/erebor[Ryan Waldron] により2012年から創始されました.
|
407
464
|
|
408
465
|
*AsciiDoc* は Stuart Rackham により創始され, AsciiDocコミュニティの数多くのメンバからコントリビューションを受けてきました.
|
409
466
|
|
410
467
|
ifndef::env-site[]
|
411
|
-
==
|
468
|
+
== 変更履歴
|
412
469
|
|
413
470
|
ifeval::[{safe-mode-level} < 20]
|
414
471
|
include::CHANGELOG.adoc[tag=compact,leveloffset=+1]
|
415
472
|
endif::[]
|
416
473
|
|
417
|
-
|
474
|
+
過去のリリースの完全な変更点リストについては {uri-changelog}[CHANGELOG] を参照してください.
|
418
475
|
endif::[]
|