asciidoctor-epub3 1.5.0.alpha.6 → 1.5.0.alpha.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +134 -0
- data/Gemfile +10 -0
- data/README.adoc +248 -172
- data/asciidoctor-epub3.gemspec +42 -0
- data/bin/adb-push-ebook +19 -10
- data/data/styles/epub3-css3-only.css +28 -11
- data/data/styles/epub3.css +40 -39
- data/lib/asciidoctor-epub3/converter.rb +188 -121
- data/lib/asciidoctor-epub3/core_ext/string.rb +1 -1
- data/lib/asciidoctor-epub3/font_icon_map.rb +1 -1
- data/lib/asciidoctor-epub3/packager.rb +240 -104
- data/lib/asciidoctor-epub3/spine_item_processor.rb +22 -11
- data/lib/asciidoctor-epub3/version.rb +1 -1
- metadata +24 -35
- data/data/samples/asciidoctor-epub3-readme.adoc +0 -849
- data/data/samples/asciidoctor-js-browser-extension.adoc +0 -46
- data/data/samples/asciidoctor-js-introduction.adoc +0 -91
- data/data/samples/i18n.adoc +0 -161
- data/data/samples/images/asciidoctor-js-chrome-extension.png +0 -0
- data/data/samples/images/avatars/graphitefriction.jpg +0 -0
- data/data/samples/images/avatars/mogztter.jpg +0 -0
- data/data/samples/images/avatars/mojavelinux.jpg +0 -0
- data/data/samples/images/correct-text-justification.png +0 -0
- data/data/samples/images/incorrect-text-justification.png +0 -0
- data/data/samples/images/screenshots/chapter-title-day.png +0 -0
- data/data/samples/images/screenshots/chapter-title.png +0 -0
- data/data/samples/images/screenshots/figure-admonition.png +0 -0
- data/data/samples/images/screenshots/section-title-paragraph.png +0 -0
- data/data/samples/images/screenshots/sidebar.png +0 -0
- data/data/samples/images/screenshots/table.png +0 -0
- data/data/samples/images/screenshots/text.png +0 -0
- data/data/samples/sample-book.adoc +0 -21
- data/data/samples/sample-content.adoc +0 -168
- data/scripts/generate-font-subsets.pe +0 -235
@@ -1,46 +0,0 @@
|
|
1
|
-
[[asciidoctor-js-browser-extension]]
|
2
|
-
= Asciidoctor.js browser extension: _Preview_ AsciiDoc in your browser
|
3
|
-
Guillaume Grossetie <https://github.com/mogztter>
|
4
|
-
2013-09-18
|
5
|
-
:username: mogztter
|
6
|
-
:gh-chrome-repo: https://github.com/asciidoctor/asciidoctor-chrome-extension
|
7
|
-
:gh-ff-repo: https://github.com/asciidoctor/asciidoctor-firefox-addon
|
8
|
-
:gh-adjs-repo: https://github.com/asciidoctor/asciidoctor.js
|
9
|
-
:gh-ad-repo: https://github.com/asciidoctor/asciidoctor
|
10
|
-
:download-chrome-extension: https://chrome.google.com/webstore/detail/asciidoctorjs-live-previe/iaalpfgpbocpdfblpnhhgllgbdbchmia
|
11
|
-
:download-ff-addon: https://addons.mozilla.org/fr/firefox/addon/asciidoctorjs-live-preview/
|
12
|
-
:markitup-site: http://markitup.jaysalvat.com/
|
13
|
-
:experimental:
|
14
|
-
|
15
|
-
I'd like to introduce you to the easiest way to render any AsciiDoc file, local or remote, as HTML directly in your browser!
|
16
|
-
All you need to do is install the {download-chrome-extension}[Chrome extension] or the {download-ff-addon}[Firefox add-on].
|
17
|
-
Then you can preview any AsciiDoc file as HTML just by visiting it!
|
18
|
-
|
19
|
-
== How it works
|
20
|
-
|
21
|
-
The Chrome extension and the Firefox add-on use {gh-adjs-repo}[Asciidoctor.js] to render AsciiDoc as HTML inside your browser.
|
22
|
-
Both provide a toggle button to switch between HTML output and AsciiDoc source.
|
23
|
-
|
24
|
-
Here you can see a local AsciiDoc file rendered inside of Chrome.
|
25
|
-
|
26
|
-
.Asciidoctor.js Chrome extension in action
|
27
|
-
image::asciidoctor-js-chrome-extension.png[]
|
28
|
-
|
29
|
-
TIP: You can view any AsciiDoc file on GitHub through the lens of Asciidoctor.js with this extension!
|
30
|
-
Simply navigate to the file in the GitHub web interface (try https://github.com/asciidoctor/asciidoctor.org/blob/master/news/introducing-asciidoctor-js-live-preview.adoc[this blog post]) and click the btn:[Raw] button that appears above the file preview.
|
31
|
-
Looks much better, doesn't it?
|
32
|
-
|
33
|
-
== Future
|
34
|
-
|
35
|
-
Currently, we are using {gh-adjs-repo}[Asciidoctor.js] based on {gh-ad-repo}[Asciidoctor] 0.1.2.
|
36
|
-
We planned to cross-compile the newly-released {gh-ad-repo}[Asciidoctor] 0.1.4 to Javascript, to support the latest and greatest features!
|
37
|
-
|
38
|
-
We are also working on adding some cool new features :
|
39
|
-
|
40
|
-
* browser-based editor using {markitup-site}[MarkItUp!]
|
41
|
-
* live reload to automatically refresh on local file changes
|
42
|
-
* and many more...
|
43
|
-
|
44
|
-
== Contributing
|
45
|
-
|
46
|
-
We're always open for patches, better documentation, feature requests, evangelizing or any help you're able to provide.
|
@@ -1,91 +0,0 @@
|
|
1
|
-
[[asciidoctor-js]]
|
2
|
-
= Asciidoctor.js: AsciiDoc in your _browser_
|
3
|
-
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>
|
4
|
-
v1.0, 2013-05-21
|
5
|
-
:username: mojavelinux
|
6
|
-
|
7
|
-
We've combined http://asciidoctor.org[Asciidoctor] and http://opalrb.org[Opal] to bring AsciiDoc rendering to the browser!
|
8
|
-
|
9
|
-
== Introduction
|
10
|
-
|
11
|
-
https://github.com/asciidoctor/asciidoctor.js[Asciidoctor.js] uses the http://opalrb.org[Opal] Ruby-to-JavaScript cross compiler to generate a direct JavaScript port of http://asciidoctor.org[Asciidoctor], an implementation of AsciiDoc.
|
12
|
-
The result is AsciiDoc rendering in the browser!
|
13
|
-
|
14
|
-
The project consists primarily of a Rake build script that executes the Opal compiler on the Asciidoctor source code to produce the Asciidoctor.js script.
|
15
|
-
|
16
|
-
Opal parses the Ruby code and any required libraries, then rewrites the code into JavaScript under the Opal namespace.
|
17
|
-
The resulting JavaScript can be executed in any JavaScript runtime environment, such as a browser or node.js application.
|
18
|
-
|
19
|
-
== Proving the concept
|
20
|
-
|
21
|
-
When I first discovered Opal, I thought to myself, "`Sure, this could work.`"
|
22
|
-
Little did I know that achieving this proof of concept was more than a small task.
|
23
|
-
|
24
|
-
The effort involved filling gaps in Opal to support all the features of the Ruby standard library that Asciidoctor uses, as well as changes in Asciidoctor to make it compatible with constraints imposed by JavaScript (such as immutable strings).
|
25
|
-
|
26
|
-
While there are still some shortcomings, I'm proud to say that Asciidoctor.js can successfully render the complete AsciiDoc User Guide (a document that has served as a compliance benchmark throughout the development of Asciidoctor).
|
27
|
-
|
28
|
-
== The scripts
|
29
|
-
|
30
|
-
There are two scripts generated by the Rake build that are needed to run Asciidoctor in the browser:
|
31
|
-
|
32
|
-
[itemized%brief]
|
33
|
-
opal.js:: The Ruby runtime in JavaScript
|
34
|
-
asciidoctor.js:: The JavaScript port of Asciidoctor
|
35
|
-
|
36
|
-
[WARNING]
|
37
|
-
====
|
38
|
-
Don't fret over the large size of these files.
|
39
|
-
We haven't even started to optimize, having only just achieved the proof of concept.
|
40
|
-
|
41
|
-
With that said, both files gzip rather nicely, bringing Asciidoctor.js down from over 500K to under 100K.
|
42
|
-
As we learn to optimize Opal, the size of the generated files should become quite acceptable.
|
43
|
-
====
|
44
|
-
|
45
|
-
You need to load both files into your JavaScript environment to use Asciidoctor.
|
46
|
-
For instance, in an HTML page, add these two `<script>` tags (ideally at the bottom of the page):
|
47
|
-
|
48
|
-
[source,html]
|
49
|
-
----
|
50
|
-
<script src="opal.js"></script>
|
51
|
-
<script src="asciidoctor.js"></script>
|
52
|
-
----
|
53
|
-
|
54
|
-
You can see these scripts in action by running the examples, described in the https://github.com/asciidoctor/asciidoctor.js#readme[README].
|
55
|
-
|
56
|
-
== Usage
|
57
|
-
|
58
|
-
To interact with the generated code, you either:
|
59
|
-
|
60
|
-
[loweralpha]
|
61
|
-
. Write code in Ruby that hooks into the native JavaScript environment, which Opal compiles into JavaScript
|
62
|
-
. Invoke the JavaScript APIs that Opal generates directly from JavaScript
|
63
|
-
|
64
|
-
Here's an example that shows how Ruby can interact with the native JavaScript environment to render a string of AsciiDoc in the browser:
|
65
|
-
|
66
|
-
[source,ruby]
|
67
|
-
----
|
68
|
-
content = %(= Asciidoctor.js: AsciiDoc in your browser!
|
69
|
-
Dan Allen
|
70
|
-
2013-05-21
|
71
|
-
|
72
|
-
We've combined http://asciidoctor.org[Asciidoctor] and
|
73
|
-
http://opalrb.org[Opal] to bring AsciiDoc rendering to the browser!)
|
74
|
-
|
75
|
-
$window.addEventListener 'DOMContentLoaded', proc {
|
76
|
-
html_doc = Asciidoctor.render(content, :safe => :safe,
|
77
|
-
:attributes => %w(notitle! anchors imagesdir=./images))
|
78
|
-
$document.getElementById('content').innerHTML = html_doc
|
79
|
-
}, false
|
80
|
-
----
|
81
|
-
|
82
|
-
== Changes to Asciidoctor
|
83
|
-
|
84
|
-
Some changes were necessary in Asciidoctor to get it to compile with Opal.
|
85
|
-
These changes have been merged into the upstream and will be part of the Asciidoctor 1.5.0 release.
|
86
|
-
|
87
|
-
== Go play!
|
88
|
-
|
89
|
-
Now it's time to go play with Asciidoctor.js.
|
90
|
-
Explore what you can do with it and how it can be improved.
|
91
|
-
Then, get involved in either Asciidoctor or Opal to help make AsciiDoc in the browser the best it can be!
|
data/data/samples/i18n.adoc
DELETED
@@ -1,161 +0,0 @@
|
|
1
|
-
[[i18n]]
|
2
|
-
= Asciidoctor Playground: _i18n_ Noto Šerif
|
3
|
-
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>
|
4
|
-
:username: mojavelinux
|
5
|
-
:source: http://www.impallari.com/testing
|
6
|
-
|
7
|
-
[abstract]
|
8
|
-
Grumpy wizards make toxic brew for the evil Queen and Jack.
|
9
|
-
But they feared not, for they had the many tongues of Noto Serif on their side.
|
10
|
-
|
11
|
-
== Diacritics
|
12
|
-
|
13
|
-
À Á Â Ã Ä Å Ā Ă Ą Ǻ Ȁ Ȃ Æ Ǽ Ć Ç Ĉ Ċ Č Ď Đ Ð Ḍ DZ Dz DŽ Dž È É Ê Ë Ē Ĕ Ė Ę Ẽ Ě Ẹ Ȅ Ȇ Ə Ǵ Ĝ Ğ Ġ Ģ Ĥ Ħ Ḥ Ĭ Ì Í Î Ï İ Ĩ Ī Į Ị Ȉ Ȋ IJ Ĵ Ķ Ĺ Ļ Ľ Ŀ Ł LJ Lj Ñ Ń Ņ Ň Ṅ Ŋ NJ Nj Ò Ó Ô Õ Ö Ō Ŏ Ő Ø Ǿ Ǫ Ọ Ȍ Ȏ Œ Þ Ŕ Ŗ Ř Ṛ Ȑ Ȓ Ś Ŝ Š Ș Ş Ṣ Ŧ Ť Ț Ţ Ṭ Ù Ú Û Ü Ũ Ū Ŭ Ů Ű Ų Ụ Ȕ Ȗ Ẁ Ẃ Ẅ Ŵ Ý Ŷ Ÿ Ỳ Ỹ Ź Ż Ž Ẓ
|
14
|
-
à á â ã ä å ā ă ą ǻ ȁ ȃ æ ǽ ć ç ĉ ċ č ď đ ð ḍ dz dž è é ê ë ē ĕ ė ę ě ẽ ẹ ȅ ȇ ə ǵ ĝ ğ ġ ģ ĥ ħ ḥ ì í î ï ĩ ī į ĭ ị ȉ ȋ ij ĵ ķ ĸ ĺ ļ ľ ŀ ł lj ń ʼn ņ ň ñ ṅ ŋ nj ò ó ô õ ö ø ō ŏ ő ǿ ǫ ọ ȍ ȏ œ þ ŕ ŗ ř ṛ ȑ ȓ ś ŝ š ș ş ṣ ß ŧ ť ț ţ ṭ ù ú û ü ũ ū ŭ ů ű ų ụ ȕ ȗ µ μ ẁ ẃ ẅ ŵ ý ÿ ŷ ỳ ỹ ź ż ž ẓ
|
15
|
-
|
16
|
-
[lowergreek]
|
17
|
-
. one
|
18
|
-
. two
|
19
|
-
. three
|
20
|
-
|
21
|
-
=== Azeri
|
22
|
-
|
23
|
-
Zəfər, jaketini də papağını da götür, bu axşam hava çox soyuq olacaq.
|
24
|
-
|
25
|
-
=== Catalan
|
26
|
-
|
27
|
-
Jove xef, porti whisky amb quinze glaçons d'hidrogen, coi!
|
28
|
-
|
29
|
-
=== Croatian
|
30
|
-
|
31
|
-
Gojazni đačić s biciklom drži hmelj i finu vatu u džepu nošnje.
|
32
|
-
|
33
|
-
=== Czech
|
34
|
-
|
35
|
-
Nechť již hříšné saxofony ďáblů rozzvučí síň úděsnými tóny waltzu, tanga a quickstepu
|
36
|
-
|
37
|
-
=== Danish
|
38
|
-
|
39
|
-
Høj bly gom vandt fræk sexquiz på wc
|
40
|
-
|
41
|
-
=== Dutch
|
42
|
-
|
43
|
-
Lynx c.q. vos prikt bh: dag zwemjuf!
|
44
|
-
|
45
|
-
=== Esperanto
|
46
|
-
|
47
|
-
Eble ĉiu kvazaŭ-deca fuŝĥoraĵo ĝojigos homtipon
|
48
|
-
|
49
|
-
=== Estonian
|
50
|
-
|
51
|
-
Põdur Zagrebi tšellomängija-följetonist Ciqo külmetas kehvas garaažis
|
52
|
-
|
53
|
-
=== Filipino
|
54
|
-
|
55
|
-
Ang buko ay para sa tao dahil wala nang pwedeng mainom na gatas.
|
56
|
-
|
57
|
-
=== Finnish
|
58
|
-
|
59
|
-
Törkylempijävongahdus Albert osti fagotin ja töräytti puhkuvan melodian
|
60
|
-
|
61
|
-
=== French
|
62
|
-
|
63
|
-
Buvez de ce whisky que le patron juge fameux
|
64
|
-
|
65
|
-
=== West Frisian
|
66
|
-
|
67
|
-
Alve bazige froulju wachtsje op dyn komst
|
68
|
-
|
69
|
-
=== German
|
70
|
-
|
71
|
-
Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich
|
72
|
-
|
73
|
-
=== Hungarian
|
74
|
-
|
75
|
-
Jó foxim és don Quijote húszwattos lámpánál ülve egy pár bűvös cipőt készít
|
76
|
-
|
77
|
-
=== Icelandic
|
78
|
-
|
79
|
-
Kæmi ný öxi hér, ykist þjófum nú bæði víl og ádrepa.
|
80
|
-
|
81
|
-
=== Irish
|
82
|
-
|
83
|
-
D'fhuascail Íosa Úrmhac na hÓighe Beannaithe pór Éava agus Ádhaimh
|
84
|
-
|
85
|
-
=== Italian
|
86
|
-
|
87
|
-
In quel campo si trovan funghi in abbondanza.
|
88
|
-
|
89
|
-
=== Latvian
|
90
|
-
|
91
|
-
Muļķa hipiji turpat brīvi mēģina nogaršot celofāna žņaudzējčūsku.
|
92
|
-
|
93
|
-
=== Lithuanian
|
94
|
-
|
95
|
-
Įlinkdama fechtuotojo špaga sublykčiojusi pragręžė apvalų arbūzą
|
96
|
-
|
97
|
-
=== Norwegian
|
98
|
-
|
99
|
-
Vår sære Zulu fra badeøya spilte jo whist og quickstep i min taxi.
|
100
|
-
|
101
|
-
=== Polish
|
102
|
-
|
103
|
-
Jeżu klątw, spłódź Finom część gry hańb!
|
104
|
-
|
105
|
-
=== Portuguese
|
106
|
-
|
107
|
-
Luís argüia à Júlia que «brações, fé, chá, óxido, pôr, zângão» eram palavras do português.
|
108
|
-
|
109
|
-
=== Romanian
|
110
|
-
|
111
|
-
Muzicologă în bej vând whisky și tequila, preț fix.
|
112
|
-
|
113
|
-
=== Serbian (also applies to Croatian and Bosnian)
|
114
|
-
|
115
|
-
Gojazni đačić s biciklom drži hmelj i finu vatu u džepu nošnje.
|
116
|
-
|
117
|
-
=== Slovak
|
118
|
-
|
119
|
-
Kŕdeľ ďatľov učí koňa žrať kôru.
|
120
|
-
|
121
|
-
=== Slovenian
|
122
|
-
|
123
|
-
Šerif bo za vajo spet kuhal domače žgance. Piškur molče grabi fižol z dna cezijeve hoste.
|
124
|
-
|
125
|
-
=== Spanish
|
126
|
-
|
127
|
-
El veloz murciélago hindú comía feliz cardillo y kiwi. ¡qué figurota exhibe! La cigüeña tocaba el saxofón ¿Detrás del palenque de paja?
|
128
|
-
|
129
|
-
=== Swedish
|
130
|
-
|
131
|
-
Yxskaftbud, ge vår WC-zonmö IQ-hjälp.
|
132
|
-
|
133
|
-
=== Turkish
|
134
|
-
|
135
|
-
Fahiş bluz güvencesi yağdırma projesi çöktü.
|
136
|
-
|
137
|
-
== More
|
138
|
-
|
139
|
-
=== Bulgarian
|
140
|
-
|
141
|
-
Ах чудна българска земьо, полюшквай цъфтящи жита.
|
142
|
-
|
143
|
-
=== Greek
|
144
|
-
|
145
|
-
Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός
|
146
|
-
|
147
|
-
=== Japanese
|
148
|
-
|
149
|
-
いろはにほへと ちりぬるを わかよたれそ つねならむ うゐのおくやま けふこえて あさきゆめみし ゑひもせす 色は匂へど 散りぬるを 我が世誰ぞ 常ならむ 有為の奥山 今日越えて 浅き夢見じ 酔ひもせず(ん)
|
150
|
-
|
151
|
-
=== Korean
|
152
|
-
|
153
|
-
키스의 고유조건은 입술끼리 만나야 하고 특별한 기술은 필요치 않다.
|
154
|
-
|
155
|
-
=== Russian
|
156
|
-
|
157
|
-
Съешь же ещё этих мягких французских булок, да выпей чаю.
|
158
|
-
|
159
|
-
=== Ukrainian
|
160
|
-
|
161
|
-
Жебракують філософи при ґанку церкви в Гадячі, ще й шатро їхнє п'яне знаємо.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,21 +0,0 @@
|
|
1
|
-
= Asciidoctor EPUB3: Sample Book
|
2
|
-
Author Name
|
3
|
-
v1.0, 2014-04-15
|
4
|
-
:doctype: book
|
5
|
-
:producer: Asciidoctor
|
6
|
-
:keywords: Asciidoctor, samples, e-book, EPUB3, KF8, MOBI, Asciidoctor.js
|
7
|
-
:copyright: CC-BY-SA 3.0
|
8
|
-
:imagesdir: images
|
9
|
-
//:front-cover-image: image:front-cover.jpg[Front Cover,1050,1600]
|
10
|
-
|
11
|
-
ifeval::["{scripts}" == "multilingual"]
|
12
|
-
include::i18n.adoc[]
|
13
|
-
endif::[]
|
14
|
-
|
15
|
-
include::asciidoctor-epub3-readme.adoc[]
|
16
|
-
|
17
|
-
include::sample-content.adoc[]
|
18
|
-
|
19
|
-
include::asciidoctor-js-introduction.adoc[]
|
20
|
-
|
21
|
-
include::asciidoctor-js-browser-extension.adoc[]
|
@@ -1,168 +0,0 @@
|
|
1
|
-
[[sample-content]]
|
2
|
-
= Asciidoctor Playground: Sample Content
|
3
|
-
Sarah White <https://github.com/graphitefriction[@graphitefriction]>
|
4
|
-
:username: graphitefriction
|
5
|
-
:description: This guide describes the Asciidoctor attributes, values, and layout options available for producing a customized and polished document.
|
6
|
-
:keywords: AsciiDoc, Asciidoctor, syntax, reference
|
7
|
-
:language: asciidoc
|
8
|
-
|
9
|
-
[abstract]
|
10
|
-
This sample guide describes several Asciidoctor attributes, values, and layout options available for producing a customized and polished document.
|
11
|
-
|
12
|
-
== Block titles
|
13
|
-
|
14
|
-
You can assign a title to any paragraph, list, delimited block, or block macro.
|
15
|
-
In most cases, the title is displayed immediately above the content.
|
16
|
-
If the content is a figure or image, the title is displayed below the content.
|
17
|
-
|
18
|
-
A block title is defined on a line above the element.
|
19
|
-
The line must begin with a dot (`.`) and be followed immediately by the title text with no spaces inbetween.
|
20
|
-
|
21
|
-
Here's an example of a list with a title:
|
22
|
-
|
23
|
-
.A titled list
|
24
|
-
====
|
25
|
-
.TODO list
|
26
|
-
- Learn the AsciiDoc syntax
|
27
|
-
- Install Asciidoctor
|
28
|
-
- Write my novel
|
29
|
-
====
|
30
|
-
|
31
|
-
== Metadata
|
32
|
-
|
33
|
-
In addition to a title, lists and blocks can be assigned metadata, including:
|
34
|
-
|
35
|
-
* Id (i.e., anchor)
|
36
|
-
* Style (first unnamed block attribute)
|
37
|
-
* Named block attributes
|
38
|
-
* Options
|
39
|
-
|
40
|
-
Here's an example of a quote block with metadata:
|
41
|
-
|
42
|
-
[source]
|
43
|
-
----
|
44
|
-
.Gettysburg Address <1>
|
45
|
-
[[gettysburg]] <2>
|
46
|
-
[quote, Abraham Lincoln, Soldiers' National Cemetery Dedication] <3> <4> <5>
|
47
|
-
____
|
48
|
-
Four score and seven years ago our fathers brought forth
|
49
|
-
on this continent a new nation...
|
50
|
-
|
51
|
-
Now we are engaged in a great civil war, testing whether
|
52
|
-
that nation, or any nation so conceived and so dedicated,
|
53
|
-
can long endure. ...
|
54
|
-
____
|
55
|
-
----
|
56
|
-
<1> Title: Gettysburg Address
|
57
|
-
<2> Id: gettysburg
|
58
|
-
<3> Style: quote
|
59
|
-
<4> attribution: Abraham Lincoln (Named block attribute)
|
60
|
-
<5> citetitle: Dedication of the Soldiers' National Cemetery (Named block attribute)
|
61
|
-
|
62
|
-
TIP: A block can have multiple block attribute lines.
|
63
|
-
The attributes will be aggregated.
|
64
|
-
If there is a name conflict, the last attribute defined wins.
|
65
|
-
|
66
|
-
Some metadata is used as supplementary content, such as the title, whereas other metadata controls how the block is rendered, such as the style.
|
67
|
-
|
68
|
-
== Delimited blocks
|
69
|
-
|
70
|
-
The AsciiDoc syntax provides a set of components for including non-paragraph text--such as block quotes, source code listings, sidebars and tables--in your document.
|
71
|
-
These components are referred to as _delimited blocks_ because they are surrounded by delimiter lines.
|
72
|
-
|
73
|
-
Within the boundaries of a delimited block, you can enter any content or blank lines.
|
74
|
-
The block doesn't end until the ending delimiter is found.
|
75
|
-
The delimiters around the block determine the type of block, how the content is processed and rendered, and what elements are used to wrap the content in the output.
|
76
|
-
|
77
|
-
=== Optional delimiters
|
78
|
-
|
79
|
-
If the content is contiguous (not interrupted by blank lines), you can forgo the use of the block delimiters and instead use the block style above a paragraph to repurpose it as one of the delimited block types.
|
80
|
-
|
81
|
-
NOTE: This format is often used for single-line listings or quotes.
|
82
|
-
|
83
|
-
.Single line listing block
|
84
|
-
[source]
|
85
|
-
----
|
86
|
-
[listing]
|
87
|
-
sudo yum install asciidoc
|
88
|
-
----
|
89
|
-
|
90
|
-
.Single line quote block
|
91
|
-
[source]
|
92
|
-
----
|
93
|
-
[quote]
|
94
|
-
Never do today what you can put off 'til tomorrow.
|
95
|
-
----
|
96
|
-
|
97
|
-
== Admonitions
|
98
|
-
|
99
|
-
There are certain statements that you may want to draw attention to by taking them out of the content's flow and labeling them with a priority.
|
100
|
-
These are called admonitions.
|
101
|
-
Asciidoctor provides five built-in admonition style labels:
|
102
|
-
|
103
|
-
Tip:: Used for giving the reader helpful advice.
|
104
|
-
Note:: Used to communicate related or follow-up information.
|
105
|
-
Important:: Used to remind the reader to do a critical step or task.
|
106
|
-
Warning:: Used to inform the reader of potential risks.
|
107
|
-
Caution:: Also used to inform the reader of potential risks, take your pick.
|
108
|
-
|
109
|
-
When you want to call attention to a single paragraph, start the first line of the paragraph with the label you want to use.
|
110
|
-
The label must be uppercase and followed by a colon (`:`).
|
111
|
-
|
112
|
-
WARNING: Wolpertingers are known to nest in server racks.
|
113
|
-
Enter at your own risk.
|
114
|
-
|
115
|
-
When you want to apply an admonition label to complex content, set the label as a style attribute on a delimited block.
|
116
|
-
Admonition labels are commonly set on example blocks.
|
117
|
-
This behavior is referred to as _masquerading_.
|
118
|
-
The label must be uppercase when set as an attribute on a block.
|
119
|
-
|
120
|
-
[IMPORTANT]
|
121
|
-
.Feeding the Werewolves
|
122
|
-
====
|
123
|
-
While werewolves are hardy community members, keep in mind the following dietary concerns:
|
124
|
-
|
125
|
-
. They are allergic to cinnamon.
|
126
|
-
. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.
|
127
|
-
. Celery makes them sad.
|
128
|
-
====
|
129
|
-
|
130
|
-
== Quotes, Prose Excerpts, and Verses
|
131
|
-
|
132
|
-
Quotes, prose excerpts and verses share the same syntax structure, including:
|
133
|
-
|
134
|
-
* style attribute, either `quote` or `verse`
|
135
|
-
* name of who the content is attributed to
|
136
|
-
* bibliographical information of the book, speech, play, etc., where the content was drawn from
|
137
|
-
* excerpt text
|
138
|
-
|
139
|
-
.Anatomy of a basic quote
|
140
|
-
----
|
141
|
-
[quote, attribution, citation title and information]
|
142
|
-
Quote or excerpt text
|
143
|
-
----
|
144
|
-
|
145
|
-
For content that doesn't require the preservation of line breaks, set the +quote+ attribute in the first position of the attribute list.
|
146
|
-
Next, set the attribution and relevant citation information.
|
147
|
-
However, these positional attributes are optional.
|
148
|
-
|
149
|
-
If the quote is a single line or paragraph, you can place the attribute list directly on top of the text.
|
150
|
-
|
151
|
-
.after landing the cloaked Klingon bird of prey in Golden Gate park
|
152
|
-
[quote, James Kirk, Star Trek IV: The Voyage Home]
|
153
|
-
Everybody remember where we parked.
|
154
|
-
|
155
|
-
For those of you who want a little bit of culture in this document, here's an excerpt of a poem by Carl Sandburg.
|
156
|
-
|
157
|
-
[verse, Carl Sandburg, Fog]
|
158
|
-
____
|
159
|
-
The fog comes
|
160
|
-
on little cat feet.
|
161
|
-
|
162
|
-
It sits looking
|
163
|
-
over harbor and city
|
164
|
-
on silent haunches
|
165
|
-
and then moves on.
|
166
|
-
____
|
167
|
-
|
168
|
-
That's all folks!
|