asciidoctor 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of asciidoctor might be problematic. Click here for more details.

Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +72 -5
  3. data/CONTRIBUTING.adoc +3 -3
  4. data/Gemfile +23 -0
  5. data/README-fr.adoc +416 -0
  6. data/README-jp.adoc +395 -0
  7. data/README-zh_CN.adoc +414 -0
  8. data/README.adoc +134 -72
  9. data/asciidoctor.gemspec +49 -0
  10. data/data/locale/attributes.adoc +470 -0
  11. data/data/stylesheets/asciidoctor-default.css +6 -5
  12. data/lib/asciidoctor.rb +22 -19
  13. data/lib/asciidoctor/abstract_block.rb +20 -10
  14. data/lib/asciidoctor/abstract_node.rb +3 -14
  15. data/lib/asciidoctor/cli/invoker.rb +5 -4
  16. data/lib/asciidoctor/cli/options.rb +1 -1
  17. data/lib/asciidoctor/converter/docbook5.rb +1 -1
  18. data/lib/asciidoctor/converter/factory.rb +1 -5
  19. data/lib/asciidoctor/converter/html5.rb +36 -31
  20. data/lib/asciidoctor/converter/manpage.rb +14 -9
  21. data/lib/asciidoctor/converter/template.rb +8 -4
  22. data/lib/asciidoctor/core_ext.rb +7 -6
  23. data/lib/asciidoctor/core_ext/{string → 1.8.7/string}/chr.rb +1 -1
  24. data/lib/asciidoctor/core_ext/1.8.7/string/limit.rb +28 -0
  25. data/lib/asciidoctor/core_ext/{symbol → 1.8.7/symbol}/length.rb +1 -1
  26. data/lib/asciidoctor/core_ext/nil_or_empty.rb +23 -0
  27. data/lib/asciidoctor/core_ext/string/limit.rb +10 -0
  28. data/lib/asciidoctor/document.rb +33 -26
  29. data/lib/asciidoctor/extensions.rb +16 -16
  30. data/lib/asciidoctor/helpers.rb +1 -1
  31. data/lib/asciidoctor/list.rb +3 -0
  32. data/lib/asciidoctor/parser.rb +47 -43
  33. data/lib/asciidoctor/path_resolver.rb +3 -1
  34. data/lib/asciidoctor/reader.rb +15 -14
  35. data/lib/asciidoctor/section.rb +2 -2
  36. data/lib/asciidoctor/stylesheets.rb +2 -1
  37. data/lib/asciidoctor/substitutors.rb +44 -46
  38. data/lib/asciidoctor/table.rb +41 -38
  39. data/lib/asciidoctor/version.rb +1 -1
  40. data/man/asciidoctor.1 +11 -4
  41. data/man/asciidoctor.adoc +7 -1
  42. data/test/attributes_test.rb +52 -0
  43. data/test/blocks_test.rb +8 -8
  44. data/test/document_test.rb +13 -1
  45. data/test/extensions_test.rb +38 -0
  46. data/test/invoker_test.rb +15 -0
  47. data/test/lists_test.rb +78 -53
  48. data/test/manpage_test.rb +15 -0
  49. data/test/paths_test.rb +3 -0
  50. data/test/reader_test.rb +2 -2
  51. data/test/sections_test.rb +10 -0
  52. data/test/substitutions_test.rb +12 -6
  53. data/test/tables_test.rb +76 -2
  54. metadata +16 -45
  55. data/lib/asciidoctor/core_ext/object/nil_or_empty.rb +0 -23
  56. data/test/fixtures/asciidoc_index.txt +0 -521
  57. data/test/fixtures/basic-docinfo-footer.html +0 -6
  58. data/test/fixtures/basic-docinfo-footer.xml +0 -8
  59. data/test/fixtures/basic-docinfo.html +0 -1
  60. data/test/fixtures/basic-docinfo.xml +0 -4
  61. data/test/fixtures/basic.asciidoc +0 -5
  62. data/test/fixtures/chapter-a.adoc +0 -3
  63. data/test/fixtures/child-include.adoc +0 -5
  64. data/test/fixtures/circle.svg +0 -8
  65. data/test/fixtures/custom-backends/erb/html5/block_paragraph.html.erb +0 -6
  66. data/test/fixtures/custom-backends/haml/docbook45/block_paragraph.xml.haml +0 -6
  67. data/test/fixtures/custom-backends/haml/html5-tweaks/block_paragraph.html.haml +0 -1
  68. data/test/fixtures/custom-backends/haml/html5/block_paragraph.html.haml +0 -3
  69. data/test/fixtures/custom-backends/haml/html5/block_sidebar.html.haml +0 -5
  70. data/test/fixtures/custom-backends/slim/docbook45/block_paragraph.xml.slim +0 -6
  71. data/test/fixtures/custom-backends/slim/html5/block_paragraph.html.slim +0 -3
  72. data/test/fixtures/custom-backends/slim/html5/block_sidebar.html.slim +0 -5
  73. data/test/fixtures/custom-docinfodir/basic-docinfo.html +0 -1
  74. data/test/fixtures/custom-docinfodir/docinfo.html +0 -1
  75. data/test/fixtures/docinfo-footer.html +0 -1
  76. data/test/fixtures/docinfo-footer.xml +0 -9
  77. data/test/fixtures/docinfo.html +0 -1
  78. data/test/fixtures/docinfo.xml +0 -3
  79. data/test/fixtures/dot.gif +0 -0
  80. data/test/fixtures/encoding.asciidoc +0 -13
  81. data/test/fixtures/grandchild-include.adoc +0 -3
  82. data/test/fixtures/hello-asciidoctor.pdf +0 -0
  83. data/test/fixtures/include-file.asciidoc +0 -24
  84. data/test/fixtures/include-file.xml +0 -5
  85. data/test/fixtures/master.adoc +0 -5
  86. data/test/fixtures/parent-include-restricted.adoc +0 -5
  87. data/test/fixtures/parent-include.adoc +0 -5
  88. data/test/fixtures/sample.asciidoc +0 -26
  89. data/test/fixtures/stylesheets/custom.css +0 -3
  90. data/test/fixtures/subs-docinfo.html +0 -2
  91. data/test/fixtures/subs.adoc +0 -7
  92. data/test/fixtures/tip.gif +0 -0
  93. data/test/test_helper.rb +0 -399
@@ -0,0 +1,395 @@
1
+ = Asciidoctor
2
+ Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
+ // settings:
4
+ :page-layout: base
5
+ :idprefix:
6
+ :idseparator: -
7
+ :source-language: ruby
8
+ :language: {source-language}
9
+ ifdef::env-github[:status:]
10
+ // URIs:
11
+ :uri-org: https://github.com/asciidoctor
12
+ :uri-repo: {uri-org}/asciidoctor
13
+ :uri-asciidoctorj: {uri-org}/asciidoctorj
14
+ :uri-asciidoctorjs: {uri-org}/asciidoctor.js
15
+ :uri-project: http://asciidoctor.org
16
+ ifdef::env-site[:uri-project: link:]
17
+ :uri-docs: {uri-project}/docs
18
+ :uri-news: {uri-project}/news
19
+ :uri-manpage: {uri-project}/man/asciidoctor
20
+ :uri-issues: {uri-repo}/issues
21
+ :uri-contributors: {uri-repo}/graphs/contributors
22
+ :uri-rel-file-base: link:
23
+ :uri-rel-tree-base: link:
24
+ ifdef::env-site[]
25
+ :uri-rel-file-base: {uri-repo}/blob/master/
26
+ :uri-rel-tree-base: {uri-repo}/tree/master/
27
+ endif::[]
28
+ :uri-changelog: {uri-rel-file-base}CHANGELOG.adoc
29
+ :uri-contribute: {uri-rel-file-base}CONTRIBUTING.adoc
30
+ :uri-license: {uri-rel-file-base}LICENSE.adoc
31
+ :uri-tests: {uri-rel-tree-base}test
32
+ :uri-discuss: http://discuss.asciidoctor.org
33
+ :uri-irc: irc://irc.freenode.org/#asciidoctor
34
+ :uri-rubygem: https://rubygems.org/gems/asciidoctor
35
+ :uri-what-is-asciidoc: {uri-docs}/what-is-asciidoc
36
+ :uri-user-manual: {uri-docs}/user-manual
37
+ :uri-install-docker: https://github.com/asciidoctor/docker-asciidoctor
38
+ //:uri-install-doc: {uri-docs}/install-toolchain
39
+ :uri-install-osx-doc: {uri-docs}/install-asciidoctor-macosx
40
+ :uri-render-doc: {uri-docs}/render-documents
41
+ :uri-themes-doc: {uri-docs}/produce-custom-themes-using-asciidoctor-stylesheet-factory
42
+ :uri-gitscm-repo: https://github.com/git/git-scm.com
43
+ :uri-prototype: {uri-gitscm-repo}/commits/master/lib/asciidoc.rb
44
+ :uri-freesoftware: https://www.gnu.org/philosophy/free-sw.html
45
+ :uri-foundation: http://foundation.zurb.com
46
+ :uri-tilt: https://github.com/rtomayko/tilt
47
+ :uri-ruby: https://ruby-lang.org
48
+ // images:
49
+ :image-uri-screenshot: https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/screenshot.png
50
+
51
+ {uri-project}/[Asciidoctor]は _高速な_ テキストプロセッサで {uri-what-is-asciidoc}[Asciidoc] をHTML5, DocBook 5(4.5)や他のフォーマットに変換するツールチェインを配布しています.
52
+ AsciidoctorはRubyで書かれており, RubyGemとしてパッケージされ, {uri-rubygem}[RubyGems.org] で配布されています.
53
+ gemはいくつかのLinuxディストリビューション, Fedora, Debian, Ubuntuにも含まれています.
54
+ Asciidoctorはオープンソース {uri-repo}[hosted on Github] で {uri-license}[the MIT licence]のもとに配布されます.
55
+
56
+ ifndef::env-site[]
57
+ .Translations of the document are available in the following languages:
58
+ * {uri-rel-file-base}README-zh_CN.adoc[汉语]
59
+ * {uri-rel-file-base}README.adoc[English]
60
+ * {uri-rel-file-base}README-fr.adoc[Français]
61
+ endif::[]
62
+
63
+ .Key documentation
64
+ [.compact]
65
+ * {uri-docs}/what-is-asciidoc[What is Asciidoc?]
66
+ * {uri-docs}/asciidoc-writers-guide[AsciiDoc Writer's Guide]
67
+ * {uri-docs}/asciidoc-syntax-quick-reference[AsciiDoc Syntax Reference]
68
+ * {uri-docs}/user-manual[Asciidoctor User Manual]
69
+
70
+ .Rubyの行く先, Asciidoctorの追うところ
71
+ ****
72
+ AsciidoctorはJRubyを用いてJVM上でも実行できます.
73
+ Javaや他のJVM言語からAsciidoctor APIを直接呼び出すには, {uri-asciidoctorj}[AsciidoctorJ] を使ってください.
74
+ AsciidoctorJに基づいた, AsciidoctorプロセッサをApache Maven, GradleやJavadocに統合するプラグインがあります.
75
+
76
+ AsciidoctorはJavaScriptでも実行可能です.
77
+ {uri-asciidoctorjs}[Asciidoctor.js], WebブラウザやNode.jsのようなJavaScript環境で動くAsciidoctorの完全機能版, を生成するために, RubyのソースをJavaScriptにトランスパイルするのに http://opalrb.org[Opal]を使います.
78
+ Asciidoctor.jsはChrome, Atom, Brackets や他のウェブベースのツールの拡張機能としてAsciiDocのプレビューのために使われます.
79
+ ****
80
+
81
+ ifdef::status[]
82
+ .*Project health*
83
+ image:https://img.shields.io/travis/asciidoctor/asciidoctor/master.svg[Build Status (Travis CI), link=https://travis-ci.org/asciidoctor/asciidoctor]
84
+ image:https://ci.appveyor.com/api/projects/status/ifplu67oxvgn6ceq/branch/master?svg=true&amp;passingText=green%20bar&amp;failingText=%23fail&amp;pendingText=building%2E%2E%2E[Build Status (AppVeyor), link=https://ci.appveyor.com/project/asciidoctor/asciidoctor]
85
+ //image:https://img.shields.io/coveralls/asciidoctor/asciidoctor/master.svg[Coverage Status, link=https://coveralls.io/r/asciidoctor/asciidoctor]
86
+ image:https://codeclimate.com/github/asciidoctor/asciidoctor/badges/gpa.svg[Code Climate, link="https://codeclimate.com/github/asciidoctor/asciidoctor"]
87
+ image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs, link="https://inch-ci.org/github/asciidoctor/asciidoctor"]
88
+ endif::[]
89
+
90
+ == The Big Picture
91
+
92
+ Asciidoctorは下図の左側のパネルに示されるように, 平文で書かれた内容を読み, 右のパネルに描かれるようにHTML5に変換します.
93
+ Asciidoctorは枠にとらわれない快適なエクスペリエンスのためにデフォルトスタイルシートをHTML5時メントに適用します.
94
+
95
+ image::{image-uri-screenshot}[Preview of AsciiDoc source and corresponding rendered HTML]
96
+
97
+ == AsciiDoc Processing
98
+ AsciidoctorはAsciiDoc文法で書かれたテキストを読み込み解釈し, それからHTML5, DocBook5(4.5)やman(ual)を出力するために内蔵コンバータセットにパースツリーを渡します.
99
+ 生成された出力をカスタマイズ, あるいは追加のフォーマットをつくるためにあなた自身のコンバータを使うことや {uri-tilt}[Tilt]-supported テンプレートを読み込むオプションがあります.
100
+
101
+ NOTE: AsciidoctorはオリジナルのAsciiDoc Pythonプロセッサ(`asciidoc.py`)の完全互換です.
102
+ Asciidoctorテストスイートは {uri-tests}[> 1,600 tests] をAsciiDoc文法との互換性を保証するために有しています.
103
+
104
+ クラシックなAsciiDoc文法に加えて, Asciidoctorは追加のマークアップとフォントベースのicons(例えば, `+icon:fire[]+`)などのフォーマッティングオプションとUIエレメント(`+button:[Save]+`)を 受け付けます.
105
+ AsciidoctorはHTML5出力をスタイルするため, モダンで, {uri-foundation}[Foundation] に基づいたレスポンシブテーマをも提供します.
106
+
107
+ == Requirements
108
+
109
+ AsciidoctorはLinux, OS X (Mac)とWindowsで動き, 下記の {uri-ruby}[Ruby]実装の一つを必要とします.
110
+
111
+ * MRI (Ruby 1.8.7, 1.9.3, 2.0, 2.1, 2.2 & 2.3)
112
+ * JRuby (1.7 in Ruby 1.8 and 1.9 modes, 9000)
113
+ * Rubinius 2.2.x
114
+ * Opal (JavaScript)
115
+
116
+ [CAUTION]
117
+ ====
118
+ もし非英語環境のWindowsを使っているなら, Asciidoctorを起動した時に`Encoding::UndefinedConversionError`に遭遇するでしょう.
119
+ これを解決するには使っているコンソールの有効なコードページをUTF-8:
120
+
121
+ chcp 65001
122
+
123
+ に変更することを推奨します.
124
+ 一度この変更をすると, Unicode関連の頭痛の種は消えるでしょう.
125
+ もしEclipseのようなIDEを使っているなら, 同様にエンコーディングをUTF-8にするのを忘れないでください.
126
+ AsciidoctorはUTF-8が使われているところで最高の働きを見せます.
127
+ ====
128
+
129
+ == Installation
130
+
131
+ Asciidoctorは (a) `gem install` コマンド, (b) Bundler あるいは (c) 有名Linuxディストリビューションのパッケージマネージャ を用いてインストールされます.
132
+
133
+ TIP: Linuxパッケージマネージャを用いてインストールすることの利点は, もしRubyやRubyGemsライブラリがまだインストールされていなかったら, それらを処理してくれることです.
134
+ 欠点はgemのリリース直後にはすぐには有効にならないことです.
135
+ もし最新バージョンを使いたければ, 必ず `gem` コマンドを使いましょう.
136
+
137
+ === (a) gem install
138
+
139
+ ターミナルを開, 入力しましょう (先頭の`$`は除く):
140
+
141
+ $ gem install asciidoctor
142
+
143
+ もし, 先行リリースバージョン(例えばリリース候補版)をインストールしたければ
144
+
145
+ $ gem install asciidoctor --pre
146
+
147
+ .アップグレード
148
+ [TIP]
149
+ ====
150
+ もしAsciidoctorの以前のバージョンあインストール済みであれば, 以下によってアップデートできます:
151
+
152
+ $ gem update asciidoctor
153
+
154
+ もし gem update の代わりに `gem install` を使ってgemを新バージョンにした場合, 複数バージョンばインストールされるでしょう.
155
+ そのときは, 以下のgemコマンドで古いバージョンを削除しましょう:
156
+
157
+ $ gem cleanup asciidoctor
158
+ ====
159
+
160
+ === (b) Bundler
161
+
162
+ . プロジェクトフォルダーのルート(かカレントディレクトリ)にGemfileを作成
163
+ . `asciidoctor` gemをGemfileに以下のように追加:
164
+ +
165
+ [source]
166
+ ----
167
+ source 'https://rubygems.org'
168
+ gem 'asciidoctor'
169
+ # or specify the version explicitly
170
+ # gem 'asciidoctor', '1.5.4'
171
+ ----
172
+
173
+ . Gemfileを保存
174
+ . ターミナルを開き, gemをインストール:
175
+
176
+ $ bundle
177
+
178
+ gemをアップグレードするには, Gemfileで新バージョンを指定し, `bundle` を再び実行してください.
179
+ `bundle update` は他のgemもアップデートするため推奨されて *いない* ので, 思わぬ結果になるかも知れません.
180
+
181
+ === (c) Linux package managers
182
+
183
+ ==== DNF (Fedora 21 or greater)
184
+
185
+ dnfを使いFedora21かそれ以上にインストールするには, ターミナルを開き, 以下を入力してください:
186
+
187
+ $ sudo dnf install -y asciidoctor
188
+
189
+ gemをアップグレードするには:
190
+
191
+ $ sudo dnf update -y asciidoctor
192
+
193
+ TIP: お使いのシステムは自動的にrpmパッケージをアップデートするよう設定されているかも知れません.その場合, gemのアップデートのためにあなたがすべきことはありません.
194
+
195
+ ==== apt-get (Debian, Ubuntu, Mint)
196
+
197
+ Debian, UbuntuまたはMintにインストールするには, ターミナルを開き, 以下を入力してください:
198
+
199
+ $ sudo apt-get install -y asciidoctor
200
+
201
+ gemをアップグレードするには:
202
+
203
+ $ sudo apt-get upgrade -y asciidoctor
204
+
205
+ TIP: お使いのシステムは自動的にdebパッケージをアップデートするよう設定されているかも知れません.その場合, gemのアップデートのためにあなたがすべきことはありません.
206
+
207
+ パッケージマネージャ(apt-get)によってインストールされたバージョンのAsciidoctorは最新リリースのAsciidoctorではないかもしれません.
208
+ ディストリビューションのリリース毎に, どのバージョンがパッケージされているかはパッケージリポジトリを調べてください.
209
+
210
+ * https://packages.debian.org/search?keywords=asciidoctor&searchon=names&exact=1&suite=all&section=all[asciidoctor package by Debian release]
211
+ * http://packages.ubuntu.com/search?keywords=asciidoctor&searchon=names&exact=1&suite=all&section=all[asciidoctor package by Ubuntu release]
212
+ * https://community.linuxmint.com/software/view/asciidoctor[asciidoctor package by Mint release]
213
+
214
+ [CAUTION]
215
+ ====
216
+ パッケージマネージャによって管理されているgemをアップデートするのに `gem udpate` コマンドを使うなといわれるでしょう.
217
+ そのようなことをするのは, パッケージマネージャがファイル(/usr/local下にインストールされた)を追跡できなくなるためにシステムが不安定な状態にするためです.
218
+ 単純に, システムgemはパッケージマネージャによってのみ管理されるべきです.
219
+
220
+ もし, パッケージマネージャによってインストールされたのより新しいバージョンのAsciidoctorを使いたければ, http://rvm.io[RVM] や https://github.com/rbenv/rbenv[rbenv]を使ってRubyをホームディレクトリ(すなわち, ユーザースペース)にインストールするべきです.
221
+ それから, 安心して `gem` コマンドをAsciidoctorのアップデート, インストールのために使うことができます.
222
+ RVMやrbenvを使っているなら, gemはシステムからは孤立した場所にインストールされます.
223
+ ====
224
+
225
+ ==== apk (Alpine Linux)
226
+
227
+ Alpine Linuxにgemをインストールするには, ターミナルを開き, 以下を入力してください:
228
+
229
+ $ sudo apk add asciidoctor
230
+
231
+ gemをアップグレードするには:
232
+
233
+ $ sudo apk add -u asciidoctor
234
+
235
+ TIP: お使いのシステムは自動的にapkパッケージをアップデートするよう設定されているかも知れません.その場合, gemのアップデートのためにあなたがすべきことはありません.
236
+
237
+ === Other installation options
238
+
239
+ * {uri-install-docker}[Installing Asciidoctor using Docker]
240
+ * {uri-install-osx-doc}[Installing Asciidoctor on Mac OS X]
241
+ // at the moment, the following entry is just a reiteration of the information in this README
242
+ //* {uri-install-doc}[Installing the Asciidoctor toolchain]
243
+
244
+ == Usage
245
+
246
+ Asciidoctorのインストールに成功すれば, `asciidoctor` コマンドラインインターフェース(CLI)がPATH中で有効になります.
247
+ 確認のために, 以下をターミナルで実行しましょう:
248
+
249
+ $ asciidoctor --version
250
+
251
+ AsciidoctorのバージョンとRuby環境についての情報がターミナルに出力されたのを見ることができるはずです.
252
+
253
+ [.output]
254
+ ....
255
+ Asciidoctor 1.5.4 [http://asciidoctor.org]
256
+ Runtime Environment (ruby 2.2.2p95 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)
257
+ ....
258
+
259
+ AsciidoctorはAPIを提供します.
260
+ APIは他のRubyソフトウェア, Rails, SinatraとGitHub, そして他の言語, Java (via {uri-asciidoctorj}[AsciidoctorJ] )とJavaScript (via {uri-asciidoctorjs}[Asciidoctor.js])との統合を意図しています.
261
+
262
+ === Command line interface (CLI)
263
+
264
+ `asciidoctorjs` コマンドはAsciidoctorをコマンドライン(つまりターミナル)から起動することを可能にします.
265
+
266
+ 次のコマンドはファイルREADME.adocをHTMLに変換し, 結果を同じディレクトリのREADME.htmlに保存します.
267
+ 生成されたHTMLファイルの名前はソースファイル依存し, その拡張子を `.html` に変えます.
268
+
269
+ $ asciidoctor README.adoc
270
+
271
+ Asciidoctorプロセッサに様々なフラグやスイッチを与えることで制御できます.それは以下を用いて調べることができます:
272
+
273
+ $ asciidoctor --help
274
+
275
+ 例えば, ファイルを異なるディレクトリに書き出すには:
276
+
277
+ $ asciidoctor -D output README.adoc
278
+
279
+ `asciidoctor` {uri-manpage}[man page] はコマンドライン・インタフェースの完全なリファレンスを提供します.
280
+
281
+ `asciidoctor` コマンドの使い方についてもっと学ぶには以下を参照してください.
282
+
283
+ * {uri-render-doc}[How do I convert a document?]
284
+ * {uri-themes-doc}[How do I use the Asciidoctor stylesheet factory to produce custom themes?]
285
+
286
+ === Ruby API
287
+
288
+ Asciidoctorをアプリケーションの中で使うには, まずgemをrequireする必要があります:
289
+
290
+ [source]
291
+ require 'asciidoctor'
292
+
293
+ それから, AsciiDocソースファイルをHTMLファイルに変換できます:
294
+
295
+ [source]
296
+ Asciidoctor.convert_file 'README.adoc', to_file: true, safe: :safe
297
+
298
+ WARNING: AsciidoctorをAPI経由で使っている時, デフォルトのセーフモードは `:secure` です.
299
+ セキュアモードでは, `include` ディレクティブを含むいくつかのコア機能は無効化されています.
300
+ もしこれらの機能を有効化したい場合, 明示的にセーフモードを `:server` (推奨)か `:safe` にする必要があります.
301
+
302
+ AsciiDoc文字列を埋め込みHTML(HTMLページヘの挿入)へ変換することもできます:
303
+
304
+ [source]
305
+ ----
306
+ content = '_Zen_ in the art of writing http://asciidoctor.org[AsciiDoc].'
307
+ Asciidoctor.convert content, safe: :safe
308
+ ----
309
+
310
+ もし完全なHTMLドキュメントを求めるのであれば, `header_footer` オプションを以下の通り有効にしてください:
311
+
312
+ [source]
313
+ ----
314
+ content = '_Zen_ in the art of writing http://asciidoctor.org[AsciiDoc].'
315
+ html = Asciidoctor.convert content, header_footer: true, safe: :safe
316
+ ----
317
+
318
+ パースされたドキュメントにアクセスしたいのなら, 変換を個々のステップに分割することが出来ます:
319
+
320
+ [source]
321
+ ----
322
+ content = '_Zen_ in the art of writing http://asciidoctor.org[AsciiDoc].'
323
+ document = Asciidoctor.load content, header_footer: true, safe: :safe
324
+ puts document.doctitle
325
+ html = document.convert
326
+ ----
327
+
328
+ Asciidoctorの生成する出力が気に入らないのであれば, _あなたはそれを変更できる_ ことを忘れないでください!
329
+ Asciidoctorはパースされたドキュメントを生成された出力に変換する処理を扱うカスタムコンバーターをサポートしています.
330
+
331
+ 断片的な出力をカスタマイズする簡単な方法の一つはテンプレートコンバーターを使うことです.
332
+ テンプレートコンバーターによって, ドキュメント中のあらゆるノードの変換を扱うために {uri-tilt}[Tilt]-supportedテンプレートファイルを使うことができます.
333
+
334
+ そのようにすれば, 出力を100%制御することが _できます_ .
335
+ APIの使い方や出力のカスタマイズ方法についてのより詳しい情報は {uri-user-manual}[user manual] を参照してください.
336
+
337
+ == Contributing
338
+
339
+ {uri-freesoftware}[free software] の精神においては, _everyone_ がこのプロジェクトを改良するのをたすけることが勧められている.
340
+ もしエラーや手抜かりをソースコード, ドキュメント, あるいはウェブサイトに見つけたのなら, 恥じることなく修正と共にpull requestの開設やissueの送信をしてください.
341
+ New contributors are always welcome!
342
+
343
+ *あなた* にもできることがあります:
344
+
345
+ * 先行バージョン(alpha, beta or preview)の使用
346
+ * バグレポート
347
+ * 新機能提案
348
+ * ドキュメントの執筆
349
+ * 仕様の執筆
350
+ * コーディング -- _パッチでも, 足りなすぎるなんてことはありません_
351
+ ** typoの修正
352
+ ** コメントの追加
353
+ ** 一貫性のないホワイトスペースの除去
354
+ ** テストの記述!
355
+ * リファクタリング
356
+ * {uri-issues}[issues] の修正
357
+ * パッチの批評
358
+
359
+ {uri-contribute}[Contributing] ガイドはどうやってスタイルをつくるか, issueを送るか, 機能リクエスト, コーディング, ドキュメンテーションをAsciidoctor Projectにするかの情報を提供しています.
360
+
361
+ == Getting Help
362
+
363
+ Asciidoctorプロジェクトはあなたが簡単に著作を書いて, 配布するのをたすけるため開発されています.
364
+ しかしあなたのフィードバックなしにはできません!
365
+ ディスカッションリストで, Twitterで, チャットルームで, 質問し, プロジェクトのあらゆる側面について話し合うようお勧めします.
366
+
367
+ Discussion list (Nabble):: {uri-discuss}
368
+ Twitter:: #asciidoctor hashtag or @asciidoctor mention
369
+ Chat (Gitter):: image:https://badges.gitter.im/Join%20In.svg[Gitter, link=https://gitter.im/asciidoctor/asciidoctor]
370
+
371
+ ifdef::env-github[]
372
+ Further information and documentation about Asciidoctor can be found on the project's website.
373
+
374
+ {uri-project}/[Home] | {uri-news}[News] | {uri-docs}[Docs]
375
+ endif::[]
376
+
377
+ GitHub上のAsciidoctorはプロジェクトのソースコード, イシュートラッカー, サブプロジェクトを管理しています.
378
+
379
+ Source repository (git):: {uri-repo}
380
+ Issue tracker:: {uri-issues}
381
+ Asciidoctor organization on GitHub:: {uri-org}
382
+
383
+ == Copyright and Licensing
384
+
385
+ Copyright (C) 2012-2016 Dan Allen, Ryan Waldron and the Asciidoctor Project.
386
+ Free use of this software is granted under the terms of the MIT License.
387
+
388
+ See the {uri-license}[LICENSE] file for details.
389
+
390
+ == Authors
391
+
392
+ *Asciidoctor* is led by https://github.com/mojavelinux[Dan Allen] and https://github.com/graphitefriction[Sarah White] and has received contributions from {uri-contributors}[many other individuals] in Asciidoctor's awesome community.
393
+ The project was initiated in 2012 by https://github.com/erebor[Ryan Waldron] and based on {uri-prototype}[a prototype] written by https://github.com/nickh[Nick Hengeveld].
394
+
395
+ *AsciiDoc* was started by Stuart Rackham and has received contributions from many other individuals in the AsciiDoc community.
@@ -0,0 +1,414 @@
1
+ = Asciidoctor
2
+ Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>; Ryan Waldron <https://github.com/erebor[@erebor]>
3
+ // settings:
4
+ :page-layout: base
5
+ :idprefix:
6
+ :idseparator: -
7
+ :source-language: ruby
8
+ :language: {source-language}
9
+ ifdef::env-github[:status:]
10
+ // URIs:
11
+ :uri-org: https://github.com/asciidoctor
12
+ :uri-repo: {uri-org}/asciidoctor
13
+ :uri-asciidoctorj: {uri-org}/asciidoctorj
14
+ :uri-asciidoctorjs: {uri-org}/asciidoctor.js
15
+ :uri-project: http://asciidoctor.org
16
+ ifdef::env-site[:uri-project: link:]
17
+ :uri-docs: {uri-project}/docs
18
+ :uri-news: {uri-project}/news
19
+ :uri-manpage: {uri-project}/man/asciidoctor
20
+ :uri-issues: {uri-repo}/issues
21
+ :uri-contributors: {uri-repo}/graphs/contributors
22
+ :uri-rel-file-base: link:
23
+ :uri-rel-tree-base: link:
24
+ ifdef::env-site[]
25
+ :uri-rel-file-base: {uri-repo}/blob/master/
26
+ :uri-rel-tree-base: {uri-repo}/tree/master/
27
+ endif::[]
28
+ :uri-changelog: {uri-rel-file-base}CHANGELOG.adoc
29
+ :uri-contribute: {uri-rel-file-base}CONTRIBUTING.adoc
30
+ :uri-license: {uri-rel-file-base}LICENSE.adoc
31
+ :uri-tests: {uri-rel-tree-base}test
32
+ :uri-discuss: http://discuss.asciidoctor.org
33
+ :uri-irc: irc://irc.freenode.org/#asciidoctor
34
+ :uri-rubygem: https://rubygems.org/gems/asciidoctor
35
+ :uri-what-is-asciidoc: {uri-docs}/what-is-asciidoc
36
+ :uri-user-manual: {uri-docs}/user-manual
37
+ :uri-install-docker: https://github.com/asciidoctor/docker-asciidoctor
38
+ //:uri-install-doc: {uri-docs}/install-toolchain
39
+ :uri-install-osx-doc: {uri-docs}/install-asciidoctor-macosx
40
+ :uri-render-doc: {uri-docs}/render-documents
41
+ :uri-themes-doc: {uri-docs}/produce-custom-themes-using-asciidoctor-stylesheet-factory
42
+ :uri-gitscm-repo: https://github.com/git/git-scm.com
43
+ :uri-prototype: {uri-gitscm-repo}/commits/master/lib/asciidoc.rb
44
+ :uri-freesoftware: https://www.gnu.org/philosophy/free-sw.html
45
+ :uri-foundation: http://foundation.zurb.com
46
+ :uri-tilt: https://github.com/rtomayko/tilt
47
+ :uri-ruby: https://ruby-lang.org
48
+ // images:
49
+ :image-uri-screenshot: https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/screenshot.png
50
+
51
+ {uri-project}/[Asciidoctor] 是一个 _快速_ 文本处理器和发布工具链,它可以将 {uri-what-is-asciidoc}[AsciiDoc] 文档转化成 HTML5、 DocBook 5 (或 4.5) 以及其他格式。
52
+ Asciidoctor 由 Ruby 编写,打包成 RubyGem,然后发布到 {uri-rubygem}[RubyGems.org] 上。
53
+ 这个 gem 还被包含道几个 Linux 发行版中,其中包括 Fedora、Debian 和 Ubuntu。
54
+ Asciidoctor 是开源的,{uri-repo}[代码托管在 GitHub],并且是以 {uri-license}[MIT 协议]授权。
55
+
56
+ .该文档有如下语言的翻译版:
57
+ * {uri-rel-file-base}README.adoc[English]
58
+ * {uri-rel-file-base}README-fr.adoc[Français]
59
+
60
+ .关键文档
61
+ [.compact]
62
+ * {uri-docs}/what-is-asciidoc[什么是 Asciidoctor?]
63
+ * {uri-docs}/asciidoc-writers-guide[AsciiDoc 作家指南]
64
+ * {uri-docs}/asciidoc-syntax-quick-reference[AsciiDoc 语法快速参考]
65
+ * {uri-docs}/user-manual[Asciidoctor 用户手册]
66
+
67
+ .Ruby 所至, Asciidoctor 相随
68
+ ****
69
+ 使用 JRuby 可以让 Asciidoctor 运行在 Java 虚拟机上。
70
+ 使用 {uri-asciidoctorj}[AsciidoctorJ] 就可以让 Java 或者其他 Java 虚拟机语言直接调用 Asciidoctor API。
71
+ 基于 AsciidoctorJ 有好多好多插件可用,这些插件可以将 Asciidoctor 整合到 Apache Maven,Gradle 或 Javadoc 构建中。
72
+
73
+ Asciidoctor 也可以运行在 JavaScript 上。
74
+ 我们可以使用 http://opalrb.org[Opal] 将 Ruby 源码编译成 JavaScript 并生成 {uri-asciidoctorjs}[Asciidoctor.js],这是一个全功能版的 Asciidoctor,可以运行在任意的 JavaScript 环境中,比如 Web 浏览器 或 Node.js。
75
+ Asciidoctor.js 被用于 AsciiDoc 预览,支持 Chrome 扩展,Atom,Brackets 或其他基于 Web 的工具。
76
+ ****
77
+
78
+ ifdef::badges[]
79
+ .*Project health*
80
+ image:https://img.shields.io/travis/asciidoctor/asciidoctor/master.svg[Build Status (Travis CI), link=https://travis-ci.org/asciidoctor/asciidoctor]
81
+ image:https://ci.appveyor.com/api/projects/status/ifplu67oxvgn6ceq/branch/master?svg=true&amp;passingText=green%20bar&amp;failingText=%23fail&amp;pendingText=building%2E%2E%2E[Build Status (AppVeyor), link=https://ci.appveyor.com/project/asciidoctor/asciidoctor]
82
+ //image:https://img.shields.io/coveralls/asciidoctor/asciidoctor/master.svg[Coverage Status, link=https://coveralls.io/r/asciidoctor/asciidoctor]
83
+ image:https://codeclimate.com/github/asciidoctor/asciidoctor/badges/gpa.svg[Code Climate, link="https://codeclimate.com/github/asciidoctor/asciidoctor"]
84
+ image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs, link="https://inch-ci.org/github/asciidoctor/asciidoctor"]
85
+ endif::[]
86
+
87
+ [#the-big-picture]
88
+ == 全局概况
89
+
90
+ Asciidoctor 以纯文本格式读取内容,见下图左边的面板,将它转换成 HTML5 呈现在右侧面板中。
91
+ Asciidoctor 将默认的样式表应用到 HTML5 文档上,提供一个愉快的开箱即用的体验。
92
+
93
+ image::{image-uri-screenshot}[AsciiDoc 源文预览和相应的 HTML 渲染]
94
+
95
+ [#asciidoc-processing]
96
+ == AsciiDoc Processing
97
+
98
+ Asciidoctor 读取并处理以 AsciiDoc 语法写作的文件,然后然后将解析出来的解析树交给内置的转化器生成 HTML5,DocBook 5 (或 4.5) 或帮助手册页面输出。
99
+ 你可以选择使用你自己的转化器或者加载 {uri-tilt}[Tilt] - 支持通过模板来自定义输出或产生附加的格式。
100
+
101
+ NOTE: Asciidoctor是为了直接替换原 AsciiDoc Python 处理器(`asciidoc.py`)。
102
+ Asciidoctor 测试套件含有 {uri-tests}[> 1,600 测试用例] 来确保和 AsciiDoc 语法的兼容性。
103
+
104
+ 除了经典的 AsciiDoc 语法,Asciidoctor 还添加额外的标记和格式设置选项,例如 font-based 图标(例如: `+icon:fire[]+`)和 UI 元素(例如: `+button:[Save]+`)。
105
+ Asciidoctor 还提供了一个基于 {uri-foundation}[Foundation] 的现代的、响应式主题来美化 HTML5 输出。
106
+
107
+ [#requirements]
108
+ == 要求
109
+
110
+ Asciidoctor 可以在 Linux,OSX (Mac) 和 Windows,并且需要下面其中一个 {uri-ruby}[Ruby] 实现:
111
+
112
+ * MRI (Ruby 1.8.7, 1.9.3, 2.0, 2.1, 2.2 & 2.3)
113
+ * JRuby (1.7 in Ruby 1.8 and 1.9 modes, 9000)
114
+ * Rubinius 2.2.x
115
+ * Opal (JavaScript)
116
+
117
+ 我们欢迎你来帮助在这些以及其他平台测试 Asciidoctor。
118
+ 参考 <<{idprefix}contributing,Contributing>> 来学习如何参与进来。
119
+
120
+ [CAUTION]
121
+ ====
122
+ 如果你使用一个非英语的 Windows 环境,当调用 Asciidoctor 时,可能会碰到 `Encoding::UndefinedConversionError` 错误。
123
+ 为了解决这个问题,我们建议将控制台的编码更改为 UTF-8:
124
+
125
+ chcp 65001
126
+
127
+ 一旦你做了这个改变,所有的编码问题,都将迎刃而解。
128
+ 只要你在任何地方都是 UTF-8,Asciidoctor 总会工作地很好。
129
+ ====
130
+
131
+ [#installation]
132
+ == 安装
133
+
134
+ Asciidoctor 可以通过三种方式安装:(a) 使用 `gem install` 命令;(b) 使用 Bundler;(c) 流行的 Linux 发行版的包管理器
135
+
136
+ TIP: 使用 Linux 包管理器安装的好处是如果 Ruby 和 RubyGems 库没有在你的机器上安装,它会一并安装上去。
137
+ 不利的是在 gem 发布之后,这类安装包并不是立即可用。
138
+ 如果你需要最新版,你应该总是优先使用 `gem` 命令安装。
139
+
140
+ [#a-gem-install]
141
+ === (a) gem 安装
142
+
143
+ 打开一个终端输入如下命令(不含开头的 `$`):
144
+
145
+ $ gem install asciidoctor
146
+
147
+ 如果想安装一个预览版(比如:候选发布版),请使用:
148
+
149
+ $ gem install asciidoctor --pre
150
+
151
+ .升级
152
+ [TIP]
153
+ ====
154
+ 如果你安装有一个旧版本的 Asciidoctor,你可以使用下面的命令来升级:
155
+
156
+ $ gem update asciidoctor
157
+
158
+ 如果使用 `gem install` 命令来安装一个新版本的 gem 来代替升级,则会安装多个版本。
159
+ 如果是这种情况,使用下面的 gem 命令来移除旧版本:
160
+
161
+ $ gem cleanup asciidoctor
162
+ ====
163
+
164
+ [#b-bundler]
165
+ === (b) Bundler
166
+
167
+ . 在项目的根目录(或者当前路径),创建一个 `Gemfile` 文件;
168
+ . 在这个文件中添加 `asciidoctor` gem 如下:
169
+ +
170
+ [source]
171
+ ----
172
+ source 'https://rubygems.org'
173
+ gem 'asciidoctor'
174
+ # 或者明确指明版本
175
+ # gem 'asciidoctor', '1.5.4'
176
+ ----
177
+
178
+ . 保存 `Gemfile` 文件
179
+ . 打开终端,使用如下命令安装 gem:
180
+
181
+ $ bundle
182
+
183
+ 要升级 gem 的话,在 `Gemfile` 文件中,指明新版本,然后再次运行 `bundle` 即可。
184
+ *不推荐* 直接使用 `bundle update` 命令,因为它还会升级其他 gem,也许会造成不可预料的结果。
185
+
186
+ [#c-linux-package-managers]
187
+ === (c) Linux 包管理
188
+
189
+ [#dnf-fedora-21-or-greater]
190
+ ==== DNF (Fedora 21 或更高版本)
191
+
192
+ 在 Fedora 21 或更高版本中安装这个 gem,可以使用 dnf。打开终端并输入如下命令:
193
+
194
+ $ sudo dnf install -y asciidoctor
195
+
196
+ 升级则使用:
197
+
198
+ $ sudo dnf update -y asciidoctor
199
+
200
+ TIP: 如果你的 Fedora 系统配置的是自动升级包,在这种情况下,不需要你亲自动手升级。
201
+
202
+ [#apt-get-debian-ubuntu-mint]
203
+ ==== apt-get (Debian, Ubuntu, Mint)
204
+
205
+ 在 Debian,Ubuntu 或 Mint 中安装这个 gem,请打开终端并输入如下命令:
206
+
207
+ $ sudo apt-get install -y asciidoctor
208
+
209
+ 升级则使用:
210
+
211
+ $ sudo apt-get upgrade -y asciidoctor
212
+
213
+ TIP: 如果你的 Debian 或 Ubuntu 系统配置的是自动升级包,在这种情况下,不需要你亲自动手升级。
214
+
215
+ 使用包管理器( apt-get )安装的 Asciidoctor 的版本也许不是最新发布版。
216
+ 请查看发行版的包库,来确定每个发行版是打包的哪个版本。
217
+
218
+ * https://packages.debian.org/search?keywords=asciidoctor&searchon=names&exact=1&suite=all&section=all[Debian 发行版中的 asciidoctor]
219
+ * http://packages.ubuntu.com/search?keywords=asciidoctor&searchon=names&exact=1&suite=all&section=all[Ubuntu 发行版中的 asciidoctor]
220
+ * https://community.linuxmint.com/software/view/asciidoctor[Mint 发行版中的 asciidoctor]
221
+
222
+ [CAUTION]
223
+ ====
224
+ 我们建议不要使用 `gem update` 来升级包管理的 gem。
225
+ 这样做会使系统进入不一致的状态,包管理工具将不再跟踪相关文件(通常安装在 /usr/local 下。)
226
+ 简单地说,系统的 gem 只能由包管理器进行管理。
227
+
228
+ 如果你想使用一个比包管理器安装的更新版本的 Asciidoctor,你应该使用 http://rvm.io[RVM] 在你的用户家目录(比如:用户空间)下安装 Ruby。
229
+ 然后,你就可以放心地使用 `gem` 命令来安装或者更新 Asciidoctor gem。
230
+ 当使用 RVM 时,gem 将被安装到与系统隔离的位置。
231
+ ====
232
+
233
+ [#apk-alpine-linux]
234
+ ==== apk (Alpine Linux)
235
+
236
+ 在 Alpine Linux 中安装这个 gem,请打开终端并输入如下命令:
237
+
238
+ $ sudo apk add asciidoctor
239
+
240
+ 升级则使用:
241
+
242
+ $ sudo apk add -u asciidoctor
243
+
244
+ TIP: 如果你的 Alpine Linux 系统配置的是自动升级包,在这种情况下,不需要你亲自动手升级。
245
+
246
+ [#other-installation-options]
247
+ === 其他安装选项
248
+
249
+ * {uri-install-docker}[使用 Docker 安装 Asciidoctor ]
250
+ * {uri-install-osx-doc}[在 Mac OS X 安装 Asciidoctor ]
251
+
252
+ [#usage]
253
+ == 使用
254
+
255
+ 如果成功安装 Asciidoctor,则在可执行程序路径中,`asciidoctor` 就可用了。
256
+ 为了验证它的可用性,你可以在终端中执行如下命令:
257
+
258
+ $ asciidoctor --version
259
+
260
+ 你应该看到关于 Asciidoctor 和 Ruby 环境信息将打印到你的终端上。
261
+
262
+ [.output]
263
+ ....
264
+ Asciidoctor 1.5.4 [http://asciidoctor.org]
265
+ Runtime Environment (ruby 2.2.2p95 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)
266
+ ....
267
+
268
+ Asciidoctor 还提供了一套 API。
269
+ 这套 API 是为了整合其他的 Ruby 软件,例如 Rails、Sinatra、Github,甚至其他语言,比如 Java (通过 {uri-asciidoctorj}[AsciidoctorJ]) 和 JavaScript (通过 {uri-asciidoctorjs}[Asciidoctor.js])。
270
+
271
+ [#command-line-interface-cli]
272
+ === 命令行(CLI)
273
+
274
+ `asciidoctor` 命令可以让你通过命令行(比如:终端)来调用 Asciidoctor。
275
+
276
+ 下面的命令将 README.adoc 文件转化为 HTML,并且保存到同一目录下的 README.html 文件中。
277
+ 生成的 HTML 文件名源自源文件名,只是将其扩展名改为了 `.html`。
278
+
279
+ $ asciidoctor README.adoc
280
+
281
+ 您可以通过添加各种标志和开关控制 Asciidoctor 处理器,通过下面的命令你可以学习它的更多用法:
282
+
283
+ $ asciidoctor --help
284
+
285
+ 比如,将文件写入到不同路径里,使用如下命令:
286
+
287
+ $ asciidoctor -D output README.adoc
288
+
289
+ `asciidoctor` {uri-manpage}[帮助页面] 提供了这个命令的完整参考。
290
+
291
+ 点击下面的资源,学习更多关于 `asciidoctor` 命令的用法。
292
+
293
+ * {uri-render-doc}[如何转化文档?]
294
+ * {uri-themes-doc}[如何使用 Asciidoctor 样式工厂来创建自定义主题?]
295
+
296
+ [#ruby-api]
297
+ === Ruby API
298
+
299
+ 为了在你应用中使用 Asciidoctor,首先需要引入这个 gem:
300
+
301
+ [source]
302
+ require 'asciidoctor'
303
+
304
+ 然后,你可以通过下面的代码将 AsciiDoc 源文件转化成一个 HTML 文件:
305
+
306
+ [source]
307
+ Asciidoctor.convert_file 'README.adoc', to_file: true, safe: :safe
308
+
309
+ WARNING: 当你通过 API 使用 Asciidoctor 时,默认的安全模式是 `:secure`。
310
+ 在 secure 模式下,很多核心特性将不可用,包括 `include` 特性。
311
+ 如果你想启用这些特性,你需要明确设置安全模式为 `:server` (推荐)或 `:safe`。
312
+
313
+ 你也可以将 AsciiDoc 字符串转化我内嵌的 HTML (为了插入到一个 HTML 页面),用法如下:
314
+
315
+ [source]
316
+ ----
317
+ content = '_Zen_ in the art of writing http://asciidoctor.org[AsciiDoc].'
318
+ Asciidoctor.convert content, safe: :safe
319
+ ----
320
+
321
+ 如果你想得到完整的 HTML 文档,只需要启用 `header_footer` 选项即可。如下:
322
+
323
+ [source]
324
+ ----
325
+ content = '_Zen_ in the art of writing http://asciidoctor.org[AsciiDoc].'
326
+ html = Asciidoctor.convert content, header_footer: true, safe: :safe
327
+ ----
328
+
329
+ 如果你想访问已经处理过的文档,可以将转化过程拆分成离散的几步:
330
+
331
+ [source]
332
+ ----
333
+ content = '_Zen_ in the art of writing http://asciidoctor.org[AsciiDoc].'
334
+ document = Asciidoctor.load content, header_footer: true, safe: :safe
335
+ puts document.doctitle
336
+ html = document.convert
337
+ ----
338
+
339
+ 请注意:如果你不喜欢 Asciidoctor 输出结果,_你完全可以改变它。_
340
+ Asciidoctor 支持自定义转化器,它可以操作从待处理文件到生成文档整个环节。
341
+
342
+ 一个简单的、细微地自定义输出的方式是使用模板转化器。
343
+ 模板转化器运行你提供一个 {uri-tilt}[Tilt] 模板,这样通过模板文件来操作转化出的文档的每个节点。
344
+
345
+ 这样,你就 _可以_ 百分之百地控制你的输出。
346
+ 关于更多关于 API 或自定义输出信息,请参考 {uri-user-manual}[用户帮助手册]。
347
+
348
+ [#contributing]
349
+ == 贡献
350
+
351
+ 自由软件的精神鼓励 _每个人_ 来帮助改善这个项目。
352
+ 如果你在源码、文档或网站内容中发现错误或漏洞,请不要犹豫,提交一个议题或者推送一个修复请求。
353
+ 随时欢迎新的贡献者!
354
+
355
+ 这里有几种 *你* 可以做出贡献的方式:
356
+
357
+ * 使用预发布版本(alpha, beta 或 preview)
358
+ * 报告 Bug
359
+ * 提议新功能
360
+ * 编写文档
361
+ * 编写规范
362
+ * 编写 -- _任何补丁都不小。_
363
+ ** 修正错别字
364
+ ** 添加评论
365
+ ** 清理多余空白
366
+ ** 编写测试!
367
+ * 重构代码
368
+ * 修复 {uri-issues}[议题]
369
+ * 审查补丁
370
+
371
+ {uri-contribute}[贡献] 指南提供了如何提供贡献,包括如何创建、修饰和提交问题、特性、需求、代码和文档给 Asciidoctor 项目。
372
+
373
+ [#getting-help]
374
+ == 获得帮助
375
+
376
+ 开发 Asciidoctor 项目是未来了帮助你更容易地书写和发布你的内容。
377
+ 但是,如果没有反馈,我们将寸步难行。
378
+ 我们鼓励你在讨论组、Twitter或聊天室里,提问为题,讨论项目的方方面面,
379
+
380
+ 讨论组 (Nabble):: {uri-discuss}
381
+ Twitter:: #asciidoctor 井号或 @asciidoctor 提醒
382
+ 聊天 (Gitter):: image:https://badges.gitter.im/Join%20In.svg[Gitter, link=https://gitter.im/asciidoctor/asciidoctor]
383
+
384
+ ifdef::env-github[]
385
+ Further information and documentation about Asciidoctor can be found on the project's website.
386
+
387
+ {uri-project}/[Home] | {uri-news}[News] | {uri-docs}[Docs]
388
+ endif::[]
389
+
390
+ Asciidoctor 组织在 Github 托管代码、议案跟踪和相关子项目。
391
+
392
+ 代码库 (git):: {uri-repo}
393
+ 议案跟踪:: {uri-issues}
394
+ 在 GitHub 的 Asciidoctor 组织:: {uri-org}
395
+
396
+ [#copyright-and-licensing]
397
+ == 版权和协议
398
+
399
+ Copyright (C) 2012-2016 Dan Allen, Ryan Waldron and the Asciidoctor Project.
400
+ 这个软件的免费使用是在MIT许可条款授予的。
401
+
402
+ 请看 {uri-license}[版权声明] 文件来获取更多详细信息。
403
+
404
+ [#authors]
405
+ == 作者
406
+
407
+ *Asciidoctor* 由 https://github.com/mojavelinux[Dan Allen] 和 https://github.com/graphitefriction[Sarah White] 领导,并从 Asciidoctor 社区的 {uri-contributors}[很多其他独立开发者] 上收到了很多贡献。
408
+ 项目最初由 https://github.com/erebor[Ryan Waldron] 于 2012年基于 https://github.com/nickh[Nick Hengeveld] 的 {uri-prototype}[原型] 创建。
409
+
410
+ *AsciiDoc* 由 Stuart Rackham 启动,并从 AsciiDoc 社区的其他独立开发者上收到很多贡献。
411
+
412
+ == Changelog
413
+
414
+ 请看 {uri-changelog}[CHANGELOG]。