asciidoctor 1.5.8 → 2.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +11 -0
- data/CHANGELOG.adoc +628 -45
- data/LICENSE +2 -1
- data/README-de.adoc +28 -38
- data/README-fr.adoc +30 -43
- data/README-jp.adoc +255 -201
- data/README-zh_CN.adoc +40 -44
- data/README.adoc +170 -143
- data/asciidoctor.gemspec +22 -34
- data/bin/asciidoctor +5 -4
- 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 +6 -5
- 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 +8 -7
- 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-th.adoc +23 -0
- data/data/locale/attributes-tr.adoc +4 -3
- data/data/locale/attributes-uk.adoc +6 -5
- data/data/locale/attributes-vi.adoc +23 -0
- data/data/locale/attributes-zh_CN.adoc +4 -3
- data/data/locale/attributes-zh_TW.adoc +4 -3
- data/data/reference/syntax.adoc +296 -0
- data/data/stylesheets/asciidoctor-default.css +120 -114
- data/data/stylesheets/coderay-asciidoctor.css +15 -17
- data/lib/asciidoctor/abstract_block.rb +146 -140
- data/lib/asciidoctor/abstract_node.rb +152 -170
- data/lib/asciidoctor/attribute_list.rb +77 -89
- data/lib/asciidoctor/block.rb +29 -28
- data/lib/asciidoctor/callouts.rb +4 -2
- data/lib/asciidoctor/cli/invoker.rb +20 -24
- data/lib/asciidoctor/cli/options.rb +107 -96
- data/lib/asciidoctor/cli.rb +3 -2
- data/lib/asciidoctor/convert.rb +199 -0
- data/lib/asciidoctor/converter/composite.rb +40 -48
- data/lib/asciidoctor/converter/docbook5.rb +627 -644
- data/lib/asciidoctor/converter/html5.rb +1053 -951
- data/lib/asciidoctor/converter/manpage.rb +581 -532
- data/lib/asciidoctor/converter/template.rb +232 -271
- data/lib/asciidoctor/converter.rb +370 -185
- data/lib/asciidoctor/core_ext/float/truncate.rb +20 -0
- data/lib/asciidoctor/core_ext/hash/merge.rb +8 -0
- data/lib/asciidoctor/core_ext/match_data/names.rb +7 -0
- data/lib/asciidoctor/core_ext/nil_or_empty.rb +1 -0
- data/lib/asciidoctor/core_ext/regexp/is_match.rb +4 -2
- data/lib/asciidoctor/core_ext.rb +8 -17
- data/lib/asciidoctor/document.rb +503 -461
- data/lib/asciidoctor/extensions.rb +127 -174
- data/lib/asciidoctor/helpers.rb +184 -107
- data/lib/asciidoctor/inline.rb +9 -12
- data/lib/asciidoctor/list.rb +11 -29
- data/lib/asciidoctor/load.rb +119 -0
- data/lib/asciidoctor/logging.rb +22 -17
- data/lib/asciidoctor/parser.rb +673 -719
- data/lib/asciidoctor/path_resolver.rb +48 -33
- data/lib/asciidoctor/reader.rb +383 -338
- data/lib/asciidoctor/rouge_ext.rb +39 -0
- data/lib/asciidoctor/rx.rb +723 -0
- data/lib/asciidoctor/section.rb +17 -16
- data/lib/asciidoctor/stylesheets.rb +19 -37
- data/lib/asciidoctor/substitutors.rb +926 -1022
- data/lib/asciidoctor/syntax_highlighter/coderay.rb +88 -0
- data/lib/asciidoctor/syntax_highlighter/highlightjs.rb +34 -0
- data/lib/asciidoctor/syntax_highlighter/html_pipeline.rb +10 -0
- data/lib/asciidoctor/syntax_highlighter/prettify.rb +30 -0
- data/lib/asciidoctor/syntax_highlighter/pygments.rb +157 -0
- data/lib/asciidoctor/syntax_highlighter/rouge.rb +143 -0
- data/lib/asciidoctor/syntax_highlighter.rb +253 -0
- data/lib/asciidoctor/table.rb +152 -114
- data/lib/asciidoctor/timings.rb +7 -5
- data/lib/asciidoctor/version.rb +2 -1
- data/lib/asciidoctor/writer.rb +30 -0
- data/lib/asciidoctor.rb +266 -1340
- data/man/asciidoctor.1 +49 -47
- data/man/asciidoctor.adoc +54 -45
- metadata +50 -245
- data/CONTRIBUTING.adoc +0 -185
- data/Gemfile +0 -60
- data/Rakefile +0 -129
- data/bin/asciidoctor-safe +0 -15
- data/features/open_block.feature +0 -92
- data/features/pass_block.feature +0 -66
- data/features/step_definitions.rb +0 -49
- data/features/text_formatting.feature +0 -57
- data/features/xref.feature +0 -1039
- data/lib/asciidoctor/converter/base.rb +0 -59
- data/lib/asciidoctor/converter/docbook45.rb +0 -93
- data/lib/asciidoctor/converter/factory.rb +0 -226
- data/lib/asciidoctor/core_ext/1.8.7/base64/strict_encode64.rb +0 -6
- data/lib/asciidoctor/core_ext/1.8.7/concurrent/hash.rb +0 -5
- data/lib/asciidoctor/core_ext/1.8.7/hash/key.rb +0 -4
- data/lib/asciidoctor/core_ext/1.8.7/io/binread.rb +0 -6
- data/lib/asciidoctor/core_ext/1.8.7/io/write.rb +0 -5
- data/lib/asciidoctor/core_ext/1.8.7/string/chr.rb +0 -6
- data/lib/asciidoctor/core_ext/1.8.7/string/limit_bytesize.rb +0 -29
- data/lib/asciidoctor/core_ext/1.8.7/symbol/empty.rb +0 -6
- data/lib/asciidoctor/core_ext/1.8.7/symbol/length.rb +0 -6
- data/lib/asciidoctor/core_ext/string/limit_bytesize.rb +0 -10
- data/test/api_test.rb +0 -1240
- data/test/attribute_list_test.rb +0 -242
- data/test/attributes_test.rb +0 -1623
- data/test/blocks_test.rb +0 -3870
- data/test/converter_test.rb +0 -470
- data/test/document_test.rb +0 -1853
- data/test/extensions_test.rb +0 -1560
- data/test/fixtures/asciidoc_index.txt +0 -521
- data/test/fixtures/basic-docinfo-footer.html +0 -6
- data/test/fixtures/basic-docinfo-footer.xml +0 -8
- data/test/fixtures/basic-docinfo.html +0 -1
- data/test/fixtures/basic-docinfo.xml +0 -4
- data/test/fixtures/basic.asciidoc +0 -5
- data/test/fixtures/chapter-a.adoc +0 -3
- data/test/fixtures/child-include.adoc +0 -5
- data/test/fixtures/circle.svg +0 -9
- data/test/fixtures/custom-backends/erb/html5/block_paragraph.html.erb +0 -6
- data/test/fixtures/custom-backends/haml/docbook45/block_paragraph.xml.haml +0 -6
- data/test/fixtures/custom-backends/haml/html5/block_paragraph.html.haml +0 -3
- data/test/fixtures/custom-backends/haml/html5/block_sidebar.html.haml +0 -5
- data/test/fixtures/custom-backends/haml/html5-tweaks/block_paragraph.html.haml +0 -1
- data/test/fixtures/custom-backends/slim/docbook45/block_paragraph.xml.slim +0 -6
- data/test/fixtures/custom-backends/slim/html5/block_paragraph.html.slim +0 -3
- data/test/fixtures/custom-backends/slim/html5/block_sidebar.html.slim +0 -5
- data/test/fixtures/custom-docinfodir/basic-docinfo.html +0 -1
- data/test/fixtures/custom-docinfodir/docinfo.html +0 -1
- data/test/fixtures/docinfo-footer.html +0 -1
- data/test/fixtures/docinfo-footer.xml +0 -9
- data/test/fixtures/docinfo.html +0 -1
- data/test/fixtures/docinfo.xml +0 -3
- data/test/fixtures/doctime-localtime.adoc +0 -2
- data/test/fixtures/dot.gif +0 -0
- data/test/fixtures/encoding.asciidoc +0 -13
- data/test/fixtures/file-with-missing-include.adoc +0 -1
- data/test/fixtures/grandchild-include.adoc +0 -3
- data/test/fixtures/hello-asciidoctor.pdf +0 -69
- data/test/fixtures/include-file.asciidoc +0 -24
- data/test/fixtures/include-file.jsx +0 -8
- data/test/fixtures/include-file.ml +0 -3
- data/test/fixtures/include-file.xml +0 -5
- data/test/fixtures/lists.adoc +0 -96
- data/test/fixtures/master.adoc +0 -5
- data/test/fixtures/mismatched-end-tag.adoc +0 -7
- data/test/fixtures/other-chapters.adoc +0 -11
- data/test/fixtures/outer-include.adoc +0 -5
- data/test/fixtures/parent-include-restricted.adoc +0 -5
- data/test/fixtures/parent-include.adoc +0 -5
- data/test/fixtures/sample.asciidoc +0 -30
- data/test/fixtures/section-a.adoc +0 -4
- data/test/fixtures/stylesheets/custom.css +0 -3
- data/test/fixtures/subdir/index.adoc +0 -3
- data/test/fixtures/subdir/inner-include.adoc +0 -3
- data/test/fixtures/subdir/middle-include.adoc +0 -5
- data/test/fixtures/subs-docinfo.html +0 -2
- data/test/fixtures/subs.adoc +0 -6
- data/test/fixtures/tagged-class-enclosed.rb +0 -25
- data/test/fixtures/tagged-class.rb +0 -23
- data/test/fixtures/tip.gif +0 -0
- data/test/fixtures/unclosed-tag.adoc +0 -3
- data/test/fixtures/unexpected-end-tag.adoc +0 -4
- data/test/invoker_test.rb +0 -745
- data/test/links_test.rb +0 -855
- data/test/lists_test.rb +0 -5151
- data/test/logger_test.rb +0 -211
- data/test/manpage_test.rb +0 -660
- data/test/options_test.rb +0 -262
- data/test/paragraphs_test.rb +0 -562
- data/test/parser_test.rb +0 -742
- data/test/paths_test.rb +0 -395
- data/test/preamble_test.rb +0 -173
- data/test/reader_test.rb +0 -2161
- data/test/sections_test.rb +0 -3575
- data/test/substitutions_test.rb +0 -2066
- data/test/tables_test.rb +0 -2036
- data/test/test_helper.rb +0 -447
- data/test/text_test.rb +0 -309
data/README-zh_CN.adoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Asciidoctor
|
2
|
-
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]
|
3
|
-
|
2
|
+
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
|
3
|
+
v2.0.17, 2022-01-05
|
4
4
|
// settings:
|
5
5
|
:page-layout: base
|
6
6
|
:idprefix:
|
@@ -10,7 +10,6 @@ v1.5.8, 2018-10-28
|
|
10
10
|
ifndef::env-github[:icons: font]
|
11
11
|
ifdef::env-github[]
|
12
12
|
:status:
|
13
|
-
:outfilesuffix: .adoc
|
14
13
|
:caution-caption: :fire:
|
15
14
|
:important-caption: :exclamation:
|
16
15
|
:note-caption: :paperclip:
|
@@ -18,13 +17,13 @@ ifdef::env-github[]
|
|
18
17
|
:warning-caption: :warning:
|
19
18
|
endif::[]
|
20
19
|
// Variables:
|
21
|
-
:release-version:
|
20
|
+
:release-version: 2.0.17
|
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
|
27
|
-
:uri-project:
|
26
|
+
:uri-project: https://asciidoctor.org
|
28
27
|
ifdef::env-site[:uri-project: link:]
|
29
28
|
:uri-docs: {uri-project}/docs
|
30
29
|
:uri-news: {uri-project}/news
|
@@ -34,15 +33,15 @@ ifdef::env-site[:uri-project: link:]
|
|
34
33
|
:uri-rel-file-base: link:
|
35
34
|
:uri-rel-tree-base: link:
|
36
35
|
ifdef::env-site[]
|
37
|
-
:uri-rel-file-base: {uri-repo}/blob/
|
38
|
-
:uri-rel-tree-base: {uri-repo}/tree/
|
36
|
+
:uri-rel-file-base: {uri-repo}/blob/HEAD/
|
37
|
+
:uri-rel-tree-base: {uri-repo}/tree/HEAD/
|
39
38
|
endif::[]
|
40
39
|
:uri-changelog: {uri-rel-file-base}CHANGELOG.adoc
|
41
40
|
:uri-contribute: {uri-rel-file-base}CONTRIBUTING.adoc
|
42
41
|
:uri-license: {uri-rel-file-base}LICENSE
|
43
42
|
:uri-tests: {uri-rel-tree-base}test
|
44
|
-
:uri-discuss:
|
45
|
-
:uri-
|
43
|
+
:uri-discuss: https://discuss.asciidoctor.org
|
44
|
+
:uri-chat: https://asciidoctor.zulipchat.com
|
46
45
|
:uri-rubygem: https://rubygems.org/gems/asciidoctor
|
47
46
|
:uri-what-is-asciidoc: {uri-docs}/what-is-asciidoc
|
48
47
|
:uri-user-manual: {uri-docs}/user-manual
|
@@ -52,18 +51,17 @@ endif::[]
|
|
52
51
|
:uri-render-doc: {uri-docs}/render-documents
|
53
52
|
:uri-themes-doc: {uri-docs}/produce-custom-themes-using-asciidoctor-stylesheet-factory
|
54
53
|
:uri-gitscm-repo: https://github.com/git/git-scm.com
|
55
|
-
:uri-prototype: {uri-gitscm-repo}/commits/master/lib/asciidoc.rb
|
56
54
|
:uri-freesoftware: https://www.gnu.org/philosophy/free-sw.html
|
57
|
-
:uri-foundation:
|
55
|
+
:uri-foundation: https://foundation.zurb.com
|
58
56
|
:uri-tilt: https://github.com/rtomayko/tilt
|
59
57
|
:uri-ruby: https://ruby-lang.org
|
60
58
|
// images:
|
61
|
-
:image-uri-screenshot: https://
|
59
|
+
:image-uri-screenshot: https://cdn.jsdelivr.net/gh/asciidoctor/asciidoctor/screenshot.png
|
62
60
|
|
63
|
-
{uri-project}/[Asciidoctor] 是一个 _快速_ 文本处理器和发布工具链,它可以将 {uri-what-is-asciidoc}[AsciiDoc] 文档转化成
|
61
|
+
{uri-project}/[Asciidoctor] 是一个 _快速_ 文本处理器和发布工具链,它可以将 {uri-what-is-asciidoc}[AsciiDoc] 文档转化成 HTML 5、 DocBook 5 以及其他格式。
|
64
62
|
Asciidoctor 由 Ruby 编写,打包成 RubyGem,然后发布到 {uri-rubygem}[RubyGems.org] 上。
|
65
|
-
这个 gem
|
66
|
-
Asciidoctor 是开源的,{uri-repo}[
|
63
|
+
这个 gem 还被包含到几个 Linux 发行版中,其中包括 Fedora、Debian 和 Ubuntu。
|
64
|
+
Asciidoctor 是开源的,link:{uri-repo}[代码托管在 GitHub],遵从 {uri-license}[MIT] 协议。
|
67
65
|
|
68
66
|
该文档有如下语言的翻译版:
|
69
67
|
|
@@ -78,6 +76,13 @@ Asciidoctor 是开源的,{uri-repo}[代码]托管在 GitHub,遵从 {uri-lice
|
|
78
76
|
* {uri-docs}/asciidoc-syntax-quick-reference[AsciiDoc 语法快速参考]
|
79
77
|
* {uri-docs}/user-manual[Asciidoctor 用户手册]
|
80
78
|
|
79
|
+
ifdef::status[]
|
80
|
+
image:https://img.shields.io/gem/v/asciidoctor.svg[Latest Release, link={uri-gem}]
|
81
|
+
image:https://img.shields.io/badge/rubydoc.info-{release-version}-blue.svg[library (API) docs,link=https://www.rubydoc.info/gems/asciidoctor/{release-version}]
|
82
|
+
image:https://github.com/asciidoctor/asciidoctor/workflows/CI/badge.svg[Build Status (GitHub Actions),link={uri-repo}/actions]
|
83
|
+
image:https://img.shields.io/badge/zulip-join_chat-brightgreen.svg[Project Chat,link={uri-chat}]
|
84
|
+
endif::[]
|
85
|
+
|
81
86
|
.Ruby 所至, Asciidoctor 相随
|
82
87
|
****
|
83
88
|
使用 JRuby 让 Asciidoctor 运行在 Java 虚拟机上。
|
@@ -85,47 +90,38 @@ Asciidoctor 是开源的,{uri-repo}[代码]托管在 GitHub,遵从 {uri-lice
|
|
85
90
|
基于 AsciidoctorJ 有好多插件可用,这些插件可以将 Asciidoctor 整合到 Apache Maven,Gradle 或 Javadoc 构建中。
|
86
91
|
|
87
92
|
Asciidoctor 也可以运行在 JavaScript 上。
|
88
|
-
我们可以使用
|
93
|
+
我们可以使用 https://opalrb.com[Opal] 将 Ruby 源码编译成 JavaScript 生成 {uri-asciidoctorjs}[Asciidoctor.js] 文件,这是一个全功能版的 Asciidoctor,可以运行在任意的 JavaScript 环境中,比如 Web 浏览器 或 Node.js。
|
89
94
|
Asciidoctor.js 被用于预览 AsciiDoc,支持 Chrome 扩展,Atom,Brackets 或其他基于 Web 的工具。
|
90
95
|
****
|
91
96
|
|
92
|
-
ifdef::status[]
|
93
|
-
.*Project health*
|
94
|
-
image:https://img.shields.io/travis/asciidoctor/asciidoctor/master.svg[Build Status (Travis CI), link=https://travis-ci.org/asciidoctor/asciidoctor]
|
95
|
-
image:https://ci.appveyor.com/api/projects/status/ifplu67oxvgn6ceq/branch/master?svg=true&passingText=green%20bar&failingText=%23fail&pendingText=building%2E%2E%2E[Build Status (AppVeyor), link=https://ci.appveyor.com/project/asciidoctor/asciidoctor]
|
96
|
-
//image:https://img.shields.io/coveralls/asciidoctor/asciidoctor/master.svg[Coverage Status, link=https://coveralls.io/r/asciidoctor/asciidoctor]
|
97
|
-
//image:https://codeclimate.com/github/asciidoctor/asciidoctor/badges/gpa.svg[Code Climate, link="https://codeclimate.com/github/asciidoctor/asciidoctor"]
|
98
|
-
image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs, link="https://inch-ci.org/github/asciidoctor/asciidoctor"]
|
99
|
-
endif::[]
|
100
|
-
|
101
97
|
[#the-big-picture]
|
102
98
|
== 整体概况
|
103
99
|
|
104
|
-
Asciidoctor 以纯文本格式读取内容,见下图左边的面板,并将它转换成
|
105
|
-
Asciidoctor 将默认的样式表应用到
|
100
|
+
Asciidoctor 以纯文本格式读取内容,见下图左边的面板,并将它转换成 HTML 5 呈现在右侧面板中。
|
101
|
+
Asciidoctor 将默认的样式表应用到 HTML 5 文档上,提供一个愉快的开箱即用的体验。
|
106
102
|
|
107
103
|
image::{image-uri-screenshot}[AsciiDoc 源文预览和相应的 HTML 渲染]
|
108
104
|
|
109
105
|
[#asciidoc-processing]
|
110
106
|
== AsciiDoc Processing
|
111
107
|
|
112
|
-
Asciidoctor 会读取并处理用 AsciiDoc 语法写的文件,然后将解析出来的解析树参数交给内置的转化器去生成
|
108
|
+
Asciidoctor 会读取并处理用 AsciiDoc 语法写的文件,然后将解析出来的解析树参数交给内置的转化器去生成 HTML 5,DocBook 5 或帮助手册页面输出。
|
113
109
|
你可以选择使用你自己的转化器或者加载 {uri-tilt}[Tilt] - 支持通过模板来自定义输出或产生附加的格式。
|
114
110
|
|
115
111
|
NOTE: Asciidoctor是为了直接替换原 AsciiDoc Python 处理器(`asciidoc.py`)。
|
116
112
|
Asciidoctor 测试套件含有 {uri-tests}[> 1,600 测试示例] 来确保和 AsciiDoc 语法的兼容性。
|
117
113
|
|
118
114
|
除了传统的 AsciiDoc 语法,Asciidoctor 还添加额外的标记和格式设置选项,例如 font-based 图标(例如: `+icon:fire[]+`)和 UI 元素(例如: `+button:[Save]+`)。
|
119
|
-
Asciidoctor 还提供了一个基于 {uri-foundation}[Foundation] 的现代化的、响应式主题来美化
|
115
|
+
Asciidoctor 还提供了一个基于 {uri-foundation}[Foundation] 的现代化的、响应式主题来美化 HTML 5 输出。
|
120
116
|
|
121
117
|
[#requirements]
|
122
118
|
== 要求
|
123
119
|
|
124
120
|
Asciidoctor 可以运行在 Linux,OSX (Mac) 和 Windows 系统,但需要安装下面任意一个 {uri-ruby}[Ruby] 环境去实现:
|
125
121
|
|
126
|
-
*
|
127
|
-
* JRuby
|
128
|
-
*
|
122
|
+
* CRuby (aka MRI) 2.3 - 2.6
|
123
|
+
* JRuby 9.1 - 9.2
|
124
|
+
* TruffleRuby (GraalVM)
|
129
125
|
* Opal (JavaScript)
|
130
126
|
|
131
127
|
我们欢迎你来帮助在这些以及其他平台测试 Asciidoctor。
|
@@ -232,7 +228,7 @@ TIP: 如果你的 Debian 或 Ubuntu 系统配置的是自动升级包,在这
|
|
232
228
|
请查看发行版的包库,来确定每个发行版是打包的哪个版本。
|
233
229
|
|
234
230
|
* https://packages.debian.org/search?keywords=asciidoctor&searchon=names&exact=1&suite=all§ion=all[Debian 发行版中的 asciidoctor]
|
235
|
-
*
|
231
|
+
* https://packages.ubuntu.com/search?keywords=asciidoctor&searchon=names&exact=1&suite=all§ion=all[Ubuntu 发行版中的 asciidoctor]
|
236
232
|
* https://community.linuxmint.com/software/view/asciidoctor[Mint 发行版中的 asciidoctor]
|
237
233
|
|
238
234
|
[CAUTION]
|
@@ -241,7 +237,7 @@ TIP: 如果你的 Debian 或 Ubuntu 系统配置的是自动升级包,在这
|
|
241
237
|
这样做会使系统进入不一致的状态,包管理工具将不再跟踪相关文件(通常安装在 /usr/local 下。)
|
242
238
|
简单地说,系统的 gem 只能由包管理器进行管理。
|
243
239
|
|
244
|
-
如果你想使用一个比包管理器安装的更新版本的 Asciidoctor,你应该使用
|
240
|
+
如果你想使用一个比包管理器安装的更新版本的 Asciidoctor,你应该使用 https://rvm.io[RVM] 在你的用户家目录(比如:用户空间)下安装 Ruby。
|
245
241
|
然后,你就可以放心地使用 `gem` 命令来安装或者更新 Asciidoctor gem。
|
246
242
|
当使用 RVM 时,gem 将被安装到与系统隔离的位置。
|
247
243
|
====
|
@@ -277,12 +273,12 @@ TIP: 如果你的 Alpine Linux 系统配置的是自动升级包,在这种情
|
|
277
273
|
|
278
274
|
[.output,subs=attributes+]
|
279
275
|
....
|
280
|
-
Asciidoctor {release-version} [
|
276
|
+
Asciidoctor {release-version} [https://asciidoctor.org]
|
281
277
|
Runtime Environment (ruby 2.4.1p111 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)
|
282
278
|
....
|
283
279
|
|
284
280
|
Asciidoctor 还提供了一套 API。
|
285
|
-
这套 API 是为了整合其他的 Ruby 软件,例如 Rails、Sinatra、
|
281
|
+
这套 API 是为了整合其他的 Ruby 软件,例如 Rails、Sinatra、GitHub,甚至其他语言,比如 Java (通过 {uri-asciidoctorj}[AsciidoctorJ]) 和 JavaScript (通过 {uri-asciidoctorjs}[Asciidoctor.js])。
|
286
282
|
|
287
283
|
[#command-line-interface-cli]
|
288
284
|
=== 命令行(CLI)
|
@@ -326,11 +322,11 @@ WARNING: 当你通过 API 使用 Asciidoctor 时,默认的安全模式是 `:se
|
|
326
322
|
在 secure 模式下,很多核心特性将不可用,包括 `include` 特性。
|
327
323
|
如果你想启用这些特性,你需要明确设置安全模式为 `:server` (推荐)或 `:safe`。
|
328
324
|
|
329
|
-
你也可以将 AsciiDoc
|
325
|
+
你也可以将 AsciiDoc 字符串转化为可内嵌的 HTML (为了插入到一个 HTML 页面),用法如下:
|
330
326
|
|
331
327
|
[source]
|
332
328
|
----
|
333
|
-
content = '_Zen_ in the art of writing
|
329
|
+
content = '_Zen_ in the art of writing https://asciidoctor.org[AsciiDoc].'
|
334
330
|
Asciidoctor.convert content, safe: :safe
|
335
331
|
----
|
336
332
|
|
@@ -338,7 +334,7 @@ Asciidoctor.convert content, safe: :safe
|
|
338
334
|
|
339
335
|
[source]
|
340
336
|
----
|
341
|
-
content = '_Zen_ in the art of writing
|
337
|
+
content = '_Zen_ in the art of writing https://asciidoctor.org[AsciiDoc].'
|
342
338
|
html = Asciidoctor.convert content, header_footer: true, safe: :safe
|
343
339
|
----
|
344
340
|
|
@@ -346,7 +342,7 @@ html = Asciidoctor.convert content, header_footer: true, safe: :safe
|
|
346
342
|
|
347
343
|
[source]
|
348
344
|
----
|
349
|
-
content = '_Zen_ in the art of writing
|
345
|
+
content = '_Zen_ in the art of writing https://asciidoctor.org[AsciiDoc].'
|
350
346
|
document = Asciidoctor.load content, header_footer: true, safe: :safe
|
351
347
|
puts document.doctitle
|
352
348
|
html = document.convert
|
@@ -393,9 +389,9 @@ Asciidoctor 支持自定义转化器,它可以操作从待处理文件到生
|
|
393
389
|
但是,如果没有反馈,我们将寸步难行。
|
394
390
|
我们鼓励你在讨论组、Twitter或聊天室里,提问为题,讨论项目的方方面面,
|
395
391
|
|
392
|
+
聊天 (Zulip):: {uri-chat}
|
396
393
|
讨论组 (Nabble):: {uri-discuss}
|
397
394
|
Twitter:: https://twitter.com/search?f=tweets&q=%23asciidoctor[#asciidoctor] 来加入话题 或 https://twitter.com/asciidoctor[@asciidoctor] at并提醒我们
|
398
|
-
聊天 (Gitter):: image:https://badges.gitter.im/Join%20In.svg[Gitter, link=https://gitter.im/asciidoctor/asciidoctor]
|
399
395
|
|
400
396
|
ifdef::env-github[]
|
401
397
|
Further information and documentation about Asciidoctor can be found on the project's website.
|
@@ -403,7 +399,7 @@ Further information and documentation about Asciidoctor can be found on the proj
|
|
403
399
|
{uri-project}/[Home] | {uri-news}[News] | {uri-docs}[Docs]
|
404
400
|
endif::[]
|
405
401
|
|
406
|
-
Asciidoctor 组织在
|
402
|
+
Asciidoctor 组织在 GitHub 托管代码、议案跟踪和相关子项目。
|
407
403
|
|
408
404
|
代码库 (git):: {uri-repo}
|
409
405
|
议案跟踪:: {uri-issues}
|
@@ -412,7 +408,7 @@ Asciidoctor 组织在 Github 托管代码、议案跟踪和相关子项目。
|
|
412
408
|
[#copyright-and-licensing]
|
413
409
|
== 版权和协议
|
414
410
|
|
415
|
-
Copyright (C) 2012-
|
411
|
+
Copyright (C) 2012-present Dan Allen, Sarah White, Ryan Waldron, and the individual contributors to Asciidoctor.
|
416
412
|
这个软件的免费使用是在MIT许可条款授予的。
|
417
413
|
|
418
414
|
请看 {uri-license}[版权声明] 文件来获取更多详细信息。
|
@@ -421,7 +417,7 @@ Copyright (C) 2012-2018 Dan Allen, Ryan Waldron and the Asciidoctor Project.
|
|
421
417
|
== 作者
|
422
418
|
|
423
419
|
*Asciidoctor* 由 https://github.com/mojavelinux[Dan Allen] 和 https://github.com/graphitefriction[Sarah White] 领导,并从 Asciidoctor 社区的 {uri-contributors}[很多其他独立开发者] 上收到了很多贡献。
|
424
|
-
项目最初由 https://github.com/erebor[Ryan Waldron] 于 2012年基于 https://github.com/nickh[Nick Hengeveld]
|
420
|
+
项目最初由 https://github.com/erebor[Ryan Waldron] 于 2012年基于 https://github.com/nickh[Nick Hengeveld] 的原型创建。
|
425
421
|
|
426
422
|
*AsciiDoc* 由 Stuart Rackham 启动,并从 AsciiDoc 社区的其他独立开发者上收到很多贡献。
|
427
423
|
|