asciidoctor 0.1.3 → 0.1.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +387 -0
- data/README.adoc +358 -348
- data/asciidoctor.gemspec +30 -9
- data/bin/asciidoctor +3 -0
- data/bin/asciidoctor-safe +3 -0
- data/compat/asciidoc.conf +76 -4
- data/lib/asciidoctor.rb +174 -79
- data/lib/asciidoctor/abstract_block.rb +131 -101
- data/lib/asciidoctor/abstract_node.rb +108 -26
- data/lib/asciidoctor/attribute_list.rb +1 -1
- data/lib/asciidoctor/backends/_stylesheets.rb +204 -62
- data/lib/asciidoctor/backends/base_template.rb +11 -22
- data/lib/asciidoctor/backends/docbook45.rb +158 -163
- data/lib/asciidoctor/backends/docbook5.rb +103 -0
- data/lib/asciidoctor/backends/html5.rb +662 -445
- data/lib/asciidoctor/block.rb +54 -44
- data/lib/asciidoctor/cli/invoker.rb +41 -20
- data/lib/asciidoctor/cli/options.rb +66 -20
- data/lib/asciidoctor/debug.rb +1 -1
- data/lib/asciidoctor/document.rb +265 -100
- data/lib/asciidoctor/extensions.rb +443 -0
- data/lib/asciidoctor/helpers.rb +38 -6
- data/lib/asciidoctor/inline.rb +5 -5
- data/lib/asciidoctor/lexer.rb +532 -250
- data/lib/asciidoctor/{list_item.rb → list.rb} +33 -13
- data/lib/asciidoctor/path_resolver.rb +28 -2
- data/lib/asciidoctor/reader.rb +814 -455
- data/lib/asciidoctor/renderer.rb +128 -42
- data/lib/asciidoctor/section.rb +55 -41
- data/lib/asciidoctor/substituters.rb +380 -107
- data/lib/asciidoctor/table.rb +40 -30
- data/lib/asciidoctor/version.rb +1 -1
- data/man/asciidoctor.1 +32 -96
- data/man/{asciidoctor.ad → asciidoctor.adoc} +57 -48
- data/test/attributes_test.rb +200 -27
- data/test/blocks_test.rb +361 -22
- data/test/document_test.rb +496 -81
- data/test/extensions_test.rb +448 -0
- data/test/fixtures/basic-docinfo-footer.html +6 -0
- data/test/fixtures/basic-docinfo-footer.xml +8 -0
- data/test/fixtures/basic-docinfo.xml +3 -3
- data/test/fixtures/basic.asciidoc +1 -0
- data/test/fixtures/child-include.adoc +5 -0
- data/test/fixtures/custom-backends/haml/docbook45/block_paragraph.xml.haml +6 -0
- data/test/fixtures/custom-backends/haml/html5-tweaks/block_paragraph.html.haml +1 -0
- data/test/fixtures/custom-backends/haml/html5/block_paragraph.html.haml +3 -0
- data/test/fixtures/custom-backends/haml/html5/block_sidebar.html.haml +5 -0
- data/test/fixtures/custom-backends/slim/docbook45/block_paragraph.xml.slim +6 -0
- data/test/fixtures/custom-backends/slim/html5/block_paragraph.html.slim +3 -0
- data/test/fixtures/custom-backends/slim/html5/block_sidebar.html.slim +5 -0
- data/test/fixtures/docinfo-footer.html +1 -0
- data/test/fixtures/docinfo-footer.xml +9 -0
- data/test/fixtures/docinfo.xml +1 -0
- data/test/fixtures/grandchild-include.adoc +3 -0
- data/test/fixtures/parent-include-restricted.adoc +5 -0
- data/test/fixtures/parent-include.adoc +5 -0
- data/test/invoker_test.rb +82 -8
- data/test/lexer_test.rb +21 -3
- data/test/links_test.rb +34 -2
- data/test/lists_test.rb +304 -7
- data/test/options_test.rb +19 -3
- data/test/paragraphs_test.rb +13 -0
- data/test/paths_test.rb +22 -0
- data/test/preamble_test.rb +20 -0
- data/test/reader_test.rb +1096 -644
- data/test/renderer_test.rb +152 -12
- data/test/sections_test.rb +417 -76
- data/test/substitutions_test.rb +339 -138
- data/test/tables_test.rb +109 -4
- data/test/test_helper.rb +79 -13
- data/test/text_test.rb +111 -11
- metadata +54 -18
@@ -168,7 +168,7 @@ class AttributeList
|
|
168
168
|
if name == 'options' || name == 'opts'
|
169
169
|
name = 'options'
|
170
170
|
resolved_value.split(',').each do |o|
|
171
|
-
@attributes[o.strip
|
171
|
+
@attributes["#{o.strip}-option"] = ''
|
172
172
|
end
|
173
173
|
elsif single_quoted_value && !@block.nil?
|
174
174
|
resolved_value = @block.apply_normal_subs(value)
|
@@ -4,8 +4,104 @@ module HTML5
|
|
4
4
|
#
|
5
5
|
# returns the default CodeRay stylesheet as a String
|
6
6
|
def self.default_coderay_stylesheet
|
7
|
-
|
8
|
-
|
7
|
+
#::Asciidoctor::Helpers.require_library 'coderay', true
|
8
|
+
#::CodeRay::Encoders[:html]::CSS.new(:default).stylesheet
|
9
|
+
<<'DEFAULT_CODERAY_STYLESHEET'
|
10
|
+
/* Foundation stylesheet for CodeRay (to match GitHub theme) | MIT License | http://foundation.zurb.com */
|
11
|
+
table.CodeRay { border-collapse: collapse; padding: 2px; margin-bottom: 0; border: 0; background: transparent; }
|
12
|
+
table.CodeRay td { padding: 0 .5em; vertical-align: top; }
|
13
|
+
table.CodeRay td.line-numbers { text-align: right; color: #999; border-right: 1px solid #e5e5e5; padding-left: 0; }
|
14
|
+
span.line-numbers { border-right: 1px solid #E5E5E5; color: #999; display: inline-block; margin-right: 0.5em; padding-right: 0.5em; }
|
15
|
+
.CodeRay td.line-numbers strong, .CodeRay span.line-numbers strong { font-weight: normal; }
|
16
|
+
.CodeRay .debug { color: white !important; background: blue !important; }
|
17
|
+
.CodeRay .annotation { color: #007; }
|
18
|
+
.CodeRay .attribute-name { color: #f08; }
|
19
|
+
.CodeRay .attribute-value { color: #700; }
|
20
|
+
.CodeRay .binary { color: #509; }
|
21
|
+
.CodeRay .comment { color: #999; font-style: italic; }
|
22
|
+
.CodeRay .char { color: #04D; }
|
23
|
+
.CodeRay .char .content { color: #04D; }
|
24
|
+
.CodeRay .char .delimiter { color: #039; }
|
25
|
+
.CodeRay .class { color: #458; }
|
26
|
+
.CodeRay .complex { color: #A08; }
|
27
|
+
.CodeRay .constant { color: teal; }
|
28
|
+
.CodeRay .color { color: #0A0; }
|
29
|
+
.CodeRay .class-variable { color: #369; }
|
30
|
+
.CodeRay .decorator { color: #B0B; }
|
31
|
+
.CodeRay .definition { color: #099; }
|
32
|
+
.CodeRay .directive { color: #088; }
|
33
|
+
.CodeRay .delimiter { color: black; }
|
34
|
+
.CodeRay .doc { color: #970; }
|
35
|
+
.CodeRay .doctype { color: #34b; }
|
36
|
+
.CodeRay .doc-string { color: #D42; }
|
37
|
+
.CodeRay .escape { color: #666; }
|
38
|
+
.CodeRay .entity { color: #800; }
|
39
|
+
.CodeRay .error { color: #808; }
|
40
|
+
.CodeRay .exception { color: #C00; }
|
41
|
+
.CodeRay .filename { color: #099; }
|
42
|
+
.CodeRay .function { color: #900; }
|
43
|
+
.CodeRay .global-variable { color: teal; }
|
44
|
+
.CodeRay .hex { color: #058; }
|
45
|
+
.CodeRay .integer { color: #099; }
|
46
|
+
.CodeRay .include { color: #B44; }
|
47
|
+
.CodeRay .inline { color: black; }
|
48
|
+
.CodeRay .inline .inline { background: #ccc; }
|
49
|
+
.CodeRay .inline .inline .inline { background: #bbb; }
|
50
|
+
.CodeRay .inline .inline-delimiter { color: #D14; }
|
51
|
+
.CodeRay .inline-delimiter { color: #D14; }
|
52
|
+
.CodeRay .important { color: #f00; }
|
53
|
+
.CodeRay .interpreted { color: #B2B; }
|
54
|
+
.CodeRay .instance-variable { color: teal; }
|
55
|
+
.CodeRay .label { color: #970; }
|
56
|
+
.CodeRay .local-variable { color: #963; }
|
57
|
+
.CodeRay .octal { color: #40E; }
|
58
|
+
.CodeRay .predefined { color: #369; }
|
59
|
+
.CodeRay .preprocessor { color: #579; }
|
60
|
+
.CodeRay .pseudo-class { color: #00C; }
|
61
|
+
.CodeRay .predefined-type { color: #074; }
|
62
|
+
.CodeRay .reserved, .keyword { color: #000; }
|
63
|
+
.CodeRay .key { color: #808; }
|
64
|
+
.CodeRay .key .delimiter { color: #606; }
|
65
|
+
.CodeRay .key .char { color: #80f; }
|
66
|
+
.CodeRay .value { color: #088; }
|
67
|
+
.CodeRay .regexp { background-color: #fff0ff; }
|
68
|
+
.CodeRay .regexp .content { color: #808; }
|
69
|
+
.CodeRay .regexp .delimiter { color: #404; }
|
70
|
+
.CodeRay .regexp .modifier { color: #C2C; }
|
71
|
+
.CodeRay .regexp .function { color: #404; font-weight: bold; }
|
72
|
+
.CodeRay .string { color: #D20; }
|
73
|
+
.CodeRay .string .string { }
|
74
|
+
.CodeRay .string .string .string { background-color: #ffd0d0; }
|
75
|
+
.CodeRay .string .content { color: #D14; }
|
76
|
+
.CodeRay .string .char { color: #D14; }
|
77
|
+
.CodeRay .string .delimiter { color: #D14; }
|
78
|
+
.CodeRay .shell { color: #D14; }
|
79
|
+
.CodeRay .shell .content { }
|
80
|
+
.CodeRay .shell .delimiter { color: #D14; }
|
81
|
+
.CodeRay .symbol { color: #990073; }
|
82
|
+
.CodeRay .symbol .content { color: #A60; }
|
83
|
+
.CodeRay .symbol .delimiter { color: #630; }
|
84
|
+
.CodeRay .tag, .CodeRay .attribute-name { color: #070; }
|
85
|
+
.CodeRay .tag-special { color: #D70; }
|
86
|
+
.CodeRay .type { color: #339; }
|
87
|
+
.CodeRay .variable { color: #036; }
|
88
|
+
.CodeRay .insert { background: #afa; }
|
89
|
+
.CodeRay .delete { background: #faa; }
|
90
|
+
.CodeRay .change { color: #aaf; background: #007; }
|
91
|
+
.CodeRay .head { color: #f8f; background: #505; }
|
92
|
+
.CodeRay .insert .insert { color: #080; }
|
93
|
+
.CodeRay .delete .delete { color: #800; }
|
94
|
+
.CodeRay .change .change { color: #66f; }
|
95
|
+
.CodeRay .head .head { color: #f4f; }
|
96
|
+
DEFAULT_CODERAY_STYLESHEET
|
97
|
+
end
|
98
|
+
|
99
|
+
# Internal: Generate the default stylesheet for Pygments
|
100
|
+
#
|
101
|
+
# returns the default Pygments stylesheet as a String
|
102
|
+
def self.pygments_stylesheet(style = nil)
|
103
|
+
::Asciidoctor::Helpers.require_library 'pygments', 'pygments.rb'
|
104
|
+
::Pygments.css '.highlight', :classprefix => 'tok-', :style => (style || 'pastie')
|
9
105
|
end
|
10
106
|
|
11
107
|
# Internal: Generate the default stylesheet for Asciidoctor
|
@@ -18,7 +114,7 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, nav,
|
|
18
114
|
audio, canvas, video { display: inline-block; }
|
19
115
|
audio:not([controls]) { display: none; height: 0; }
|
20
116
|
[hidden] { display: none; }
|
21
|
-
html { font-family: sans-serif; -
|
117
|
+
html { background: #fff; color: #000; font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
|
22
118
|
body { margin: 0; }
|
23
119
|
a:focus { outline: thin dotted; }
|
24
120
|
a:active, a:hover { outline: 0; }
|
@@ -28,7 +124,7 @@ b, strong { font-weight: bold; }
|
|
28
124
|
dfn { font-style: italic; }
|
29
125
|
hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; }
|
30
126
|
mark { background: #ff0; color: #000; }
|
31
|
-
code,
|
127
|
+
code, kbd, pre, samp { font-family: monospace, serif; font-size: 1em; }
|
32
128
|
pre { white-space: pre-wrap; }
|
33
129
|
q { quotes: "\201C" "\201D" "\2018" "\2019"; }
|
34
130
|
small { font-size: 80%; }
|
@@ -53,7 +149,8 @@ textarea { overflow: auto; vertical-align: top; }
|
|
53
149
|
table { border-collapse: collapse; border-spacing: 0; }
|
54
150
|
*, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
55
151
|
html, body { font-size: 100%; }
|
56
|
-
body { background: white; color: #222222; padding: 0; margin: 0; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-weight: normal; font-style: normal; line-height: 1; position: relative; }
|
152
|
+
body { background: white; color: #222222; padding: 0; margin: 0; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-weight: normal; font-style: normal; line-height: 1; position: relative; cursor: auto; }
|
153
|
+
a:hover { cursor: pointer; }
|
57
154
|
a:focus { outline: none; }
|
58
155
|
img, object, embed { max-width: 100%; height: auto; }
|
59
156
|
object, embed { height: 100%; }
|
@@ -67,11 +164,11 @@ img { -ms-interpolation-mode: bicubic; }
|
|
67
164
|
.text-justify { text-align: justify !important; }
|
68
165
|
.hide { display: none; }
|
69
166
|
.antialiased, body { -webkit-font-smoothing: antialiased; }
|
70
|
-
img { display: inline-block; }
|
167
|
+
img { display: inline-block; vertical-align: middle; }
|
71
168
|
textarea { height: auto; min-height: 50px; }
|
72
169
|
select { width: 100%; }
|
73
170
|
p.lead, .paragraph.lead > p, #preamble > .sectionbody > .paragraph:first-of-type p { font-size: 1.21875em; line-height: 1.6; }
|
74
|
-
.subheader, .admonitionblock td.content > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, .sidebarblock > .title, .tableblock > .title, .verseblock > .title, .
|
171
|
+
.subheader, #content #toctitle, .admonitionblock td.content > .title, .exampleblock > .title, .imageblock > .title, .videoblock > .title, .listingblock > .title, .literalblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, .sidebarblock > .title, .tableblock > .title, .verseblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title, .tableblock > caption { line-height: 1.4; color: #7a2518; font-weight: 300; margin-top: 0.2em; margin-bottom: 0.5em; }
|
75
172
|
div, dl, dt, dd, ul, ol, li, h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6, pre, form, p, blockquote, th, td { margin: 0; padding: 0; direction: ltr; }
|
76
173
|
a { color: #005498; text-decoration: underline; line-height: inherit; }
|
77
174
|
a:hover, a:focus { color: #00467f; }
|
@@ -90,15 +187,16 @@ hr { border: solid #dddddd; border-width: 1px 0 0; clear: both; margin: 1.25em 0
|
|
90
187
|
em, i { font-style: italic; line-height: inherit; }
|
91
188
|
strong, b { font-weight: bold; line-height: inherit; }
|
92
189
|
small { font-size: 60%; line-height: inherit; }
|
93
|
-
code
|
190
|
+
code { font-family: Consolas, "Liberation Mono", Courier, monospace; font-weight: normal; color: #6d180b; }
|
94
191
|
ul, ol, dl { font-size: 1em; line-height: 1.6; margin-bottom: 1.25em; list-style-position: outside; font-family: inherit; }
|
95
|
-
ul
|
192
|
+
ul, ol { margin-left: 1.5em; }
|
193
|
+
ul li ul, ul li ol { margin-left: 1.25em; margin-bottom: 0; font-size: 1em; }
|
96
194
|
ul.square li ul, ul.circle li ul, ul.disc li ul { list-style: inherit; }
|
97
195
|
ul.square { list-style-type: square; }
|
98
196
|
ul.circle { list-style-type: circle; }
|
99
197
|
ul.disc { list-style-type: disc; }
|
100
198
|
ul.no-bullet { list-style: none; }
|
101
|
-
ol li ul, ol li ol { margin-left: 1.
|
199
|
+
ol li ul, ol li ol { margin-left: 1.25em; margin-bottom: 0; }
|
102
200
|
dl dt { margin-bottom: 0.3125em; font-weight: bold; }
|
103
201
|
dl dd { margin-bottom: 1.25em; }
|
104
202
|
abbr, acronym { text-transform: uppercase; font-size: 90%; color: #222222; border-bottom: 1px dotted #dddddd; cursor: help; }
|
@@ -112,8 +210,8 @@ blockquote, blockquote p { line-height: 1.6; color: #6f6f6f; }
|
|
112
210
|
.vcard li { margin: 0; display: block; }
|
113
211
|
.vcard .fn { font-weight: bold; font-size: 0.9375em; }
|
114
212
|
.vevent .summary { font-weight: bold; }
|
115
|
-
.vevent abbr { cursor:
|
116
|
-
@media only screen and (min-width:
|
213
|
+
.vevent abbr { cursor: auto; text-decoration: none; font-weight: bold; border: none; padding: 0 0.0625em; }
|
214
|
+
@media only screen and (min-width: 768px) { h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { line-height: 1.4; }
|
117
215
|
h1 { font-size: 2.75em; }
|
118
216
|
h2 { font-size: 2.3125em; }
|
119
217
|
h3, #toctitle, .sidebarblock > .content > .title { font-size: 1.6875em; }
|
@@ -141,15 +239,16 @@ table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td { pad
|
|
141
239
|
table tr th, table tr td { padding: 0.5625em 0.625em; font-size: inherit; color: #222222; }
|
142
240
|
table tr.even, table tr.alt, table tr:nth-of-type(even) { background: #f9f9f9; }
|
143
241
|
table thead tr th, table tfoot tr th, table tbody tr td, table tr td, table tfoot tr td { display: table-cell; line-height: 1.6; }
|
144
|
-
|
145
|
-
|
242
|
+
.clearfix:before, .clearfix:after, .float-group:before, .float-group:after { content: " "; display: table; }
|
243
|
+
.clearfix:after, .float-group:after { clear: both; }
|
244
|
+
*:not(pre) > code { font-size: 0.9375em; padding: 1px 3px 0; white-space: nowrap; background-color: #f2f2f2; border: 1px solid #cccccc; -webkit-border-radius: 4px; border-radius: 4px; text-shadow: none; }
|
245
|
+
pre, pre > code { line-height: 1.4; color: inherit; font-family: Consolas, "Liberation Mono", Courier, monospace; font-weight: normal; }
|
146
246
|
kbd.keyseq { color: #555555; }
|
147
247
|
kbd:not(.keyseq) { display: inline-block; color: #222222; font-size: 0.75em; line-height: 1.4; background-color: #F7F7F7; border: 1px solid #ccc; -webkit-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset; margin: -0.15em 0.15em 0 0.15em; padding: 0.2em 0.6em 0.2em 0.5em; vertical-align: middle; white-space: nowrap; }
|
148
248
|
kbd kbd:first-child { margin-left: 0; }
|
149
249
|
kbd kbd:last-child { margin-right: 0; }
|
150
250
|
.menuseq, .menu { color: #090909; }
|
151
|
-
p a >
|
152
|
-
p a > tt:hover { color: #561309; }
|
251
|
+
p a > code:hover { color: #561309; }
|
153
252
|
#header, #content, #footnotes, #footer { width: 100%; margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: 0; max-width: 62.5em; *zoom: 1; position: relative; padding-left: 0.9375em; padding-right: 0.9375em; }
|
154
253
|
#header:before, #header:after, #content:before, #content:after, #footnotes:before, #footnotes:after, #footer:before, #footer:after { content: " "; display: table; }
|
155
254
|
#header:after, #content:after, #footnotes:after, #footer:after { clear: both; }
|
@@ -160,28 +259,38 @@ p a > tt:hover { color: #561309; }
|
|
160
259
|
#header br { display: none; }
|
161
260
|
#header br + span { padding-left: 3px; }
|
162
261
|
#header br + span:before { content: "\2013 \0020"; }
|
262
|
+
#header br + span.author { padding-left: 0; }
|
263
|
+
#header br + span.author:before { content: ", "; }
|
163
264
|
#toc { border-bottom: 3px double #ebebeb; padding-bottom: 1.25em; }
|
164
|
-
#toc >
|
165
|
-
#toc
|
166
|
-
#toc
|
167
|
-
#toc
|
265
|
+
#toc > ul { margin-left: 0.25em; }
|
266
|
+
#toc ul.sectlevel0 > li > a { font-style: italic; }
|
267
|
+
#toc ul.sectlevel0 ul.sectlevel1 { margin-left: 0; margin-top: 0.5em; margin-bottom: 0.5em; }
|
268
|
+
#toc ul { list-style-type: none; }
|
168
269
|
#toctitle { color: #7a2518; }
|
169
|
-
@media only screen and (min-width:
|
270
|
+
@media only screen and (min-width: 1280px) { body.toc2 { padding-left: 20em; }
|
170
271
|
#toc.toc2 { position: fixed; width: 20em; left: 0; top: 0; border-right: 1px solid #ebebeb; border-bottom: 0; z-index: 1000; padding: 1em; height: 100%; overflow: auto; }
|
171
272
|
#toc.toc2 #toctitle { margin-top: 0; }
|
172
|
-
#toc.toc2 >
|
173
|
-
#toc.toc2
|
174
|
-
#toc.toc2
|
273
|
+
#toc.toc2 > ul { font-size: .95em; }
|
274
|
+
#toc.toc2 ul ul { margin-left: 0; padding-left: 1.25em; }
|
275
|
+
#toc.toc2 ul.sectlevel0 ul.sectlevel1 { padding-left: 0; margin-top: 0.5em; margin-bottom: 0.5em; }
|
276
|
+
body.toc2.toc-right { padding-left: 0; padding-right: 20em; }
|
277
|
+
body.toc2.toc-right #toc.toc2 { border-right: 0; border-left: 1px solid #ebebeb; left: auto; right: 0; } }
|
278
|
+
#content #toc { border-style: solid; border-width: 1px; border-color: #d9d9d9; margin-bottom: 1.25em; padding: 1.25em; background: #f2f2f2; border-width: 0; -webkit-border-radius: 4px; border-radius: 4px; }
|
279
|
+
#content #toc > :first-child { margin-top: 0; }
|
280
|
+
#content #toc > :last-child { margin-bottom: 0; }
|
281
|
+
#content #toc a { text-decoration: none; }
|
282
|
+
#content #toctitle { font-weight: bold; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 1em; padding-left: 0.125em; }
|
175
283
|
#footer { max-width: 100%; background-color: #222222; padding: 1.25em; }
|
176
284
|
#footer-text { color: #dddddd; line-height: 1.44; }
|
177
|
-
.sect1 {
|
178
|
-
.sect1
|
285
|
+
.sect1 { padding-bottom: 1.25em; }
|
286
|
+
.sect1 + .sect1 { border-top: 3px double #ebebeb; }
|
179
287
|
#content h1 > a.anchor, h2 > a.anchor, h3 > a.anchor, #toctitle > a.anchor, .sidebarblock > .content > .title > a.anchor, h4 > a.anchor, h5 > a.anchor, h6 > a.anchor { position: absolute; width: 1em; margin-left: -1em; display: block; text-decoration: none; visibility: hidden; text-align: center; font-weight: normal; }
|
180
288
|
#content h1 > a.anchor:before, h2 > a.anchor:before, h3 > a.anchor:before, #toctitle > a.anchor:before, .sidebarblock > .content > .title > a.anchor:before, h4 > a.anchor:before, h5 > a.anchor:before, h6 > a.anchor:before { content: '\00A7'; font-size: .85em; vertical-align: text-top; display: block; margin-top: 0.05em; }
|
181
289
|
#content h1:hover > a.anchor, #content h1 > a.anchor:hover, h2:hover > a.anchor, h2 > a.anchor:hover, h3:hover > a.anchor, #toctitle:hover > a.anchor, .sidebarblock > .content > .title:hover > a.anchor, h3 > a.anchor:hover, #toctitle > a.anchor:hover, .sidebarblock > .content > .title > a.anchor:hover, h4:hover > a.anchor, h4 > a.anchor:hover, h5:hover > a.anchor, h5 > a.anchor:hover, h6:hover > a.anchor, h6 > a.anchor:hover { visibility: visible; }
|
182
290
|
#content h1 > a.link, h2 > a.link, h3 > a.link, #toctitle > a.link, .sidebarblock > .content > .title > a.link, h4 > a.link, h5 > a.link, h6 > a.link { color: #ba3925; text-decoration: none; }
|
183
291
|
#content h1 > a.link:hover, h2 > a.link:hover, h3 > a.link:hover, #toctitle > a.link:hover, .sidebarblock > .content > .title > a.link:hover, h4 > a.link:hover, h5 > a.link:hover, h6 > a.link:hover { color: #a53221; }
|
184
|
-
.
|
292
|
+
.imageblock, .literalblock, .listingblock, .verseblock, .videoblock { margin-bottom: 1.25em; }
|
293
|
+
.admonitionblock td.content > .title, .exampleblock > .title, .imageblock > .title, .videoblock > .title, .listingblock > .title, .literalblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, .sidebarblock > .title, .tableblock > .title, .verseblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { text-align: left; font-weight: bold; }
|
185
294
|
.tableblock > caption { text-align: left; font-weight: bold; white-space: nowrap; overflow: visible; max-width: 0; }
|
186
295
|
table.tableblock #preamble > .sectionbody > .paragraph:first-of-type p { font-size: inherit; }
|
187
296
|
.admonitionblock > table { border: 0; background: none; width: 100%; }
|
@@ -189,40 +298,50 @@ table.tableblock #preamble > .sectionbody > .paragraph:first-of-type p { font-si
|
|
189
298
|
.admonitionblock > table td.icon img { max-width: none; }
|
190
299
|
.admonitionblock > table td.icon .title { font-weight: bold; text-transform: uppercase; }
|
191
300
|
.admonitionblock > table td.content { padding-left: 1.125em; padding-right: 1.25em; border-left: 1px solid #dddddd; color: #6f6f6f; }
|
192
|
-
.admonitionblock > table td.content >
|
301
|
+
.admonitionblock > table td.content > :last-child > :last-child { margin-bottom: 0; }
|
193
302
|
.exampleblock > .content { border-style: solid; border-width: 1px; border-color: #e6e6e6; margin-bottom: 1.25em; padding: 1.25em; background: white; -webkit-border-radius: 4px; border-radius: 4px; }
|
194
|
-
.exampleblock > .content h1, .exampleblock > .content h2, .exampleblock > .content h3, .exampleblock > .content #toctitle, .sidebarblock.exampleblock > .content > .title, .exampleblock > .content h4, .exampleblock > .content h5, .exampleblock > .content h6, .exampleblock > .content p { color: #333333; }
|
195
303
|
.exampleblock > .content > :first-child { margin-top: 0; }
|
196
304
|
.exampleblock > .content > :last-child { margin-bottom: 0; }
|
305
|
+
.exampleblock > .content h1, .exampleblock > .content h2, .exampleblock > .content h3, .exampleblock > .content #toctitle, .sidebarblock.exampleblock > .content > .title, .exampleblock > .content h4, .exampleblock > .content h5, .exampleblock > .content h6, .exampleblock > .content p { color: #333333; }
|
197
306
|
.exampleblock > .content h1, .exampleblock > .content h2, .exampleblock > .content h3, .exampleblock > .content #toctitle, .sidebarblock.exampleblock > .content > .title, .exampleblock > .content h4, .exampleblock > .content h5, .exampleblock > .content h6 { line-height: 1; margin-bottom: 0.625em; }
|
198
307
|
.exampleblock > .content h1.subheader, .exampleblock > .content h2.subheader, .exampleblock > .content h3.subheader, .exampleblock > .content .subheader#toctitle, .sidebarblock.exampleblock > .content > .subheader.title, .exampleblock > .content h4.subheader, .exampleblock > .content h5.subheader, .exampleblock > .content h6.subheader { line-height: 1.4; }
|
199
|
-
.exampleblock > .content > :last-child > :last-child, .exampleblock > .content .olist > ol > li:last-child > :last-child, .exampleblock > .content .ulist > ul > li:last-child > :last-child, .exampleblock > .content .qlist > ol > li:last-child > :last-child { margin-bottom: 0; }
|
200
308
|
.exampleblock.result > .content { -webkit-box-shadow: 0 1px 8px #d9d9d9; box-shadow: 0 1px 8px #d9d9d9; }
|
201
|
-
.imageblock { margin-bottom: 1.25em; }
|
202
309
|
.sidebarblock { border-style: solid; border-width: 1px; border-color: #d9d9d9; margin-bottom: 1.25em; padding: 1.25em; background: #f2f2f2; -webkit-border-radius: 4px; border-radius: 4px; }
|
203
|
-
.sidebarblock h1, .sidebarblock h2, .sidebarblock h3, .sidebarblock #toctitle, .sidebarblock > .content > .title, .sidebarblock h4, .sidebarblock h5, .sidebarblock h6, .sidebarblock p { color: #333333; }
|
204
310
|
.sidebarblock > :first-child { margin-top: 0; }
|
205
311
|
.sidebarblock > :last-child { margin-bottom: 0; }
|
312
|
+
.sidebarblock h1, .sidebarblock h2, .sidebarblock h3, .sidebarblock #toctitle, .sidebarblock > .content > .title, .sidebarblock h4, .sidebarblock h5, .sidebarblock h6, .sidebarblock p { color: #333333; }
|
206
313
|
.sidebarblock h1, .sidebarblock h2, .sidebarblock h3, .sidebarblock #toctitle, .sidebarblock > .content > .title, .sidebarblock h4, .sidebarblock h5, .sidebarblock h6 { line-height: 1; margin-bottom: 0.625em; }
|
207
314
|
.sidebarblock h1.subheader, .sidebarblock h2.subheader, .sidebarblock h3.subheader, .sidebarblock .subheader#toctitle, .sidebarblock > .content > .subheader.title, .sidebarblock h4.subheader, .sidebarblock h5.subheader, .sidebarblock h6.subheader { line-height: 1.4; }
|
208
315
|
.sidebarblock > .content > .title { color: #7a2518; margin-top: 0; line-height: 1.6; }
|
209
|
-
.sidebarblock > .content > .
|
210
|
-
pre {
|
211
|
-
.
|
212
|
-
.literalblock, .listingblock {
|
213
|
-
.literalblock > .content
|
214
|
-
|
215
|
-
@media only screen { .literalblock > .content
|
216
|
-
|
217
|
-
|
218
|
-
.listingblock:hover .
|
219
|
-
.listingblock:hover .
|
220
|
-
.listingblock:hover .
|
221
|
-
.listingblock:hover .
|
222
|
-
.listingblock:hover .
|
223
|
-
.listingblock:hover .
|
224
|
-
.listingblock:hover .
|
225
|
-
.listingblock:hover .
|
316
|
+
.exampleblock > .content > :last-child > :last-child, .exampleblock > .content .olist > ol > li:last-child > :last-child, .exampleblock > .content .ulist > ul > li:last-child > :last-child, .exampleblock > .content .qlist > ol > li:last-child > :last-child, .sidebarblock > .content > :last-child > :last-child, .sidebarblock > .content .olist > ol > li:last-child > :last-child, .sidebarblock > .content .ulist > ul > li:last-child > :last-child, .sidebarblock > .content .qlist > ol > li:last-child > :last-child { margin-bottom: 0; }
|
317
|
+
.literalblock > .content pre, .listingblock > .content pre { background: none; border-width: 1px 0; border-style: dotted; border-color: #bfbfbf; -webkit-border-radius: 4px; border-radius: 4px; padding: 0.75em 0.75em 0.5em 0.75em; word-wrap: break-word; }
|
318
|
+
.literalblock > .content pre.nowrap, .listingblock > .content pre.nowrap { overflow-x: auto; white-space: pre; word-wrap: normal; }
|
319
|
+
.literalblock > .content pre > code, .listingblock > .content pre > code { display: block; }
|
320
|
+
@media only screen { .literalblock > .content pre, .listingblock > .content pre { font-size: 0.8em; } }
|
321
|
+
@media only screen and (min-width: 768px) { .literalblock > .content pre, .listingblock > .content pre { font-size: 0.9em; } }
|
322
|
+
@media only screen and (min-width: 1280px) { .literalblock > .content pre, .listingblock > .content pre { font-size: 1em; } }
|
323
|
+
.listingblock > .content { position: relative; }
|
324
|
+
.listingblock:hover code[class*=" language-"]:before { text-transform: uppercase; font-size: 0.9em; color: #999; position: absolute; top: 0.375em; right: 0.375em; }
|
325
|
+
.listingblock:hover code.asciidoc:before { content: "asciidoc"; }
|
326
|
+
.listingblock:hover code.clojure:before { content: "clojure"; }
|
327
|
+
.listingblock:hover code.css:before { content: "css"; }
|
328
|
+
.listingblock:hover code.groovy:before { content: "groovy"; }
|
329
|
+
.listingblock:hover code.html:before { content: "html"; }
|
330
|
+
.listingblock:hover code.java:before { content: "java"; }
|
331
|
+
.listingblock:hover code.javascript:before { content: "javascript"; }
|
332
|
+
.listingblock:hover code.python:before { content: "python"; }
|
333
|
+
.listingblock:hover code.ruby:before { content: "ruby"; }
|
334
|
+
.listingblock:hover code.scss:before { content: "scss"; }
|
335
|
+
.listingblock:hover code.xml:before { content: "xml"; }
|
336
|
+
.listingblock:hover code.yaml:before { content: "yaml"; }
|
337
|
+
.listingblock.terminal pre .command:before { content: attr(data-prompt); padding-right: 0.5em; color: #999; }
|
338
|
+
.listingblock.terminal pre .command:not([data-prompt]):before { content: '$'; }
|
339
|
+
table.pyhltable { border: 0; margin-bottom: 0; }
|
340
|
+
table.pyhltable td { vertical-align: top; padding-top: 0; padding-bottom: 0; }
|
341
|
+
table.pyhltable td.code { padding-left: .75em; padding-right: 0; }
|
342
|
+
.highlight.pygments .lineno, table.pyhltable td:not(.code) { color: #999; padding-left: 0; padding-right: .5em; border-right: 1px solid #dddddd; }
|
343
|
+
.highlight.pygments .lineno { display: inline-block; margin-right: .25em; }
|
344
|
+
table.pyhltable .linenodiv { background-color: transparent !important; padding-right: 0 !important; }
|
226
345
|
.quoteblock { margin: 0 0 1.25em; padding: 0.5625em 1.25em 0 1.1875em; border-left: 1px solid #dddddd; }
|
227
346
|
.quoteblock blockquote { margin: 0 0 1.25em 0; padding: 0 0 0.5625em 0; border: 0; }
|
228
347
|
.quoteblock blockquote > .paragraph:last-child p { margin-bottom: 0; }
|
@@ -237,36 +356,57 @@ table.tableblock td .paragraph:last-child p, table.tableblock td > p:last-child
|
|
237
356
|
th.tableblock.halign-left, td.tableblock.halign-left { text-align: left; }
|
238
357
|
th.tableblock.halign-right, td.tableblock.halign-right { text-align: right; }
|
239
358
|
th.tableblock.halign-center, td.tableblock.halign-center { text-align: center; }
|
240
|
-
th.tableblock.
|
241
|
-
th.tableblock.
|
242
|
-
th.tableblock.
|
359
|
+
th.tableblock.valign-top, td.tableblock.valign-top { vertical-align: top; }
|
360
|
+
th.tableblock.valign-bottom, td.tableblock.valign-bottom { vertical-align: bottom; }
|
361
|
+
th.tableblock.valign-middle, td.tableblock.valign-middle { vertical-align: middle; }
|
243
362
|
p.tableblock.header { color: #222222; font-weight: bold; }
|
244
363
|
td > div.verse { white-space: pre; }
|
245
|
-
|
246
|
-
ol { margin-left: 1.
|
364
|
+
ol { margin-left: 1.75em; }
|
365
|
+
ul li ol { margin-left: 1.5em; }
|
247
366
|
dl dd { margin-left: 1.125em; }
|
248
367
|
dl dd:last-child, dl dd:last-child > :last-child { margin-bottom: 0; }
|
368
|
+
ol > li p, ul > li p, ul dd, ol dd, .olist .olist, .ulist .ulist, .ulist .olist, .olist .ulist { margin-bottom: 0.625em; }
|
369
|
+
ul.unstyled, ol.unnumbered, ul.checklist, ul.none { list-style-type: none; }
|
370
|
+
ul.unstyled, ol.unnumbered, ul.checklist { margin-left: 0.625em; }
|
371
|
+
ul.checklist li > p:first-child > i[class^="icon-check"]:first-child, ul.checklist li > p:first-child > input[type="checkbox"]:first-child { margin-right: 0.25em; }
|
372
|
+
ul.checklist li > p:first-child > input[type="checkbox"]:first-child { position: relative; top: 1px; }
|
373
|
+
ul.inline { margin: 0 auto 0.625em auto; margin-left: -1.375em; margin-right: 0; padding: 0; list-style: none; overflow: hidden; }
|
374
|
+
ul.inline > li { list-style: none; float: left; margin-left: 1.375em; display: block; }
|
375
|
+
ul.inline > li > * { display: block; }
|
249
376
|
.unstyled dl dt { font-weight: normal; font-style: normal; }
|
250
|
-
ol > li p, ul > li p, ul dd, ol dd { margin-bottom: 0.625em; }
|
251
377
|
ol.arabic { list-style-type: decimal; }
|
378
|
+
ol.decimal { list-style-type: decimal-leading-zero; }
|
252
379
|
ol.loweralpha { list-style-type: lower-alpha; }
|
253
380
|
ol.upperalpha { list-style-type: upper-alpha; }
|
254
381
|
ol.lowerroman { list-style-type: lower-roman; }
|
255
382
|
ol.upperroman { list-style-type: upper-roman; }
|
383
|
+
ol.lowergreek { list-style-type: lower-greek; }
|
256
384
|
.hdlist > table, .colist > table { border: 0; background: none; }
|
257
385
|
.hdlist > table > tbody > tr, .colist > table > tbody > tr { background: none; }
|
386
|
+
td.hdlist1 { padding-right: .8em; font-weight: bold; }
|
387
|
+
td.hdlist1, td.hdlist2 { vertical-align: top; }
|
258
388
|
.literalblock + .colist, .listingblock + .colist { margin-top: -0.5em; }
|
259
389
|
.colist > table tr > td:first-of-type { padding: 0 .8em; line-height: 1; }
|
260
390
|
.colist > table tr > td:last-of-type { padding: 0.25em 0; }
|
261
|
-
|
262
|
-
.
|
391
|
+
.qanda > ol > li > p > em:only-child { color: #00467f; }
|
392
|
+
.thumb, .th { line-height: 0; display: inline-block; border: solid 4px white; -webkit-box-shadow: 0 0 0 1px #dddddd; box-shadow: 0 0 0 1px #dddddd; }
|
393
|
+
.imageblock.left, .imageblock[style*="float: left"] { margin: 0.25em 0.625em 1.25em 0; }
|
394
|
+
.imageblock.right, .imageblock[style*="float: right"] { margin: 0.25em 0 1.25em 0.625em; }
|
395
|
+
.imageblock > .title { margin-bottom: 0; }
|
396
|
+
.imageblock.thumb, .imageblock.th { border-width: 6px; }
|
397
|
+
.imageblock.thumb > .title, .imageblock.th > .title { padding: 0 0.125em; }
|
398
|
+
.image.left, .image.right { margin-top: 0.25em; margin-bottom: 0.25em; display: inline-block; line-height: 0; }
|
399
|
+
.image.left { margin-right: 0.625em; }
|
400
|
+
.image.right { margin-left: 0.625em; }
|
401
|
+
a.image { text-decoration: none; }
|
263
402
|
span.footnote, span.footnoteref { vertical-align: super; font-size: 0.875em; }
|
264
403
|
span.footnote a, span.footnoteref a { text-decoration: none; }
|
265
|
-
#footnotes { padding: 0.75em
|
404
|
+
#footnotes { padding-top: 0.75em; padding-bottom: 0.75em; margin-bottom: 0.625em; }
|
266
405
|
#footnotes hr { width: 20%; min-width: 6.25em; margin: -.25em 0 .75em 0; border-width: 1px 0 0 0; }
|
267
|
-
#footnotes .footnote { line-height: 1.3; font-size: 0.875em; margin-left: 1.2em; text-indent: -1.2em; margin-bottom: .2em; }
|
268
|
-
#footnotes .footnote a { font-weight: bold; text-decoration: none; }
|
406
|
+
#footnotes .footnote { padding: 0 0.375em; line-height: 1.3; font-size: 0.875em; margin-left: 1.2em; text-indent: -1.2em; margin-bottom: .2em; }
|
407
|
+
#footnotes .footnote a:first-of-type { font-weight: bold; text-decoration: none; }
|
269
408
|
#footnotes .footnote:last-of-type { margin-bottom: 0; }
|
409
|
+
#content #footnotes { margin-top: -0.625em; margin-bottom: 0; padding: 0.75em 0; }
|
270
410
|
.gist .file-data > table { border: none; background: #fff; width: 100%; margin-bottom: 0; }
|
271
411
|
.gist .file-data > table td.line-data { width: 99%; }
|
272
412
|
div.unbreakable { page-break-inside: avoid; }
|
@@ -307,6 +447,7 @@ div.unbreakable { page-break-inside: avoid; }
|
|
307
447
|
.white-background { background-color: #fafafa; }
|
308
448
|
.yellow { color: #bfbf00; }
|
309
449
|
.yellow-background { background-color: #fafa00; }
|
450
|
+
span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
|
310
451
|
.admonitionblock td.icon [class^="icon-"]:before { font-size: 2.5em; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); cursor: default; }
|
311
452
|
.admonitionblock td.icon .icon-note:before { content: "\f05a"; color: #005498; color: #003f72; }
|
312
453
|
.admonitionblock td.icon .icon-tip:before { content: "\f0eb"; text-shadow: 1px 1px 2px rgba(155, 155, 0, 0.8); color: #111; }
|
@@ -315,8 +456,9 @@ div.unbreakable { page-break-inside: avoid; }
|
|
315
456
|
.admonitionblock td.icon .icon-important:before { content: "\f06a"; color: #bf0000; }
|
316
457
|
.conum { display: inline-block; color: white !important; background-color: #222222; -webkit-border-radius: 100px; border-radius: 100px; text-align: center; width: 20px; height: 20px; font-size: 12px; font-weight: bold; line-height: 20px; font-family: Arial, sans-serif; font-style: normal; position: relative; top: -2px; letter-spacing: -1px; }
|
317
458
|
.conum * { color: white !important; }
|
318
|
-
.conum
|
319
|
-
|
459
|
+
.conum + b { display: none; }
|
460
|
+
.conum:after { content: attr(data-value); }
|
461
|
+
.conum:not([data-value]):empty { display: none; }
|
320
462
|
.literalblock > .content > pre, .listingblock > .content > pre { -webkit-border-radius: 0; border-radius: 0; }
|
321
463
|
DEFAULT_ASCIIDOCTOR_STYLESHEET
|
322
464
|
end
|
@@ -8,16 +8,22 @@ module Asciidoctor
|
|
8
8
|
class BaseTemplate
|
9
9
|
|
10
10
|
attr_reader :view
|
11
|
+
attr_reader :backend
|
11
12
|
attr_reader :eruby
|
12
13
|
|
13
|
-
def initialize(view, eruby)
|
14
|
+
def initialize(view, backend, eruby)
|
14
15
|
@view = view
|
16
|
+
@backend = backend
|
15
17
|
@eruby = eruby
|
16
18
|
end
|
17
19
|
|
18
20
|
def self.inherited(klass)
|
19
|
-
|
20
|
-
|
21
|
+
if self == BaseTemplate
|
22
|
+
@template_classes ||= []
|
23
|
+
@template_classes << klass
|
24
|
+
else
|
25
|
+
self.superclass.inherited(klass)
|
26
|
+
end
|
21
27
|
end
|
22
28
|
|
23
29
|
def self.template_classes
|
@@ -65,7 +71,7 @@ class BaseTemplate
|
|
65
71
|
# returns the text with blank lines removed and HTML line feed entities
|
66
72
|
# converted to an endline character.
|
67
73
|
def compact(str)
|
68
|
-
str.gsub(BLANK_LINE_PATTERN, '').gsub(LINE_FEED_ENTITY,
|
74
|
+
str.gsub(BLANK_LINE_PATTERN, '').gsub(LINE_FEED_ENTITY, EOL)
|
69
75
|
end
|
70
76
|
|
71
77
|
# Public: Preserve endlines by replacing them with the HTML line feed entity.
|
@@ -76,7 +82,7 @@ class BaseTemplate
|
|
76
82
|
# text - the String to process
|
77
83
|
# node - the concrete instance of Asciidoctor::AbstractNode being rendered
|
78
84
|
def preserve_endlines(str, node)
|
79
|
-
node.renderer.compact ? str.gsub(
|
85
|
+
node.renderer.compact ? str.gsub(EOL, LINE_FEED_ENTITY) : str
|
80
86
|
end
|
81
87
|
|
82
88
|
def template
|
@@ -94,23 +100,6 @@ class BaseTemplate
|
|
94
100
|
%(<% if #{key} %> #{name}="<%= #{key} %>"<% end %>)
|
95
101
|
end
|
96
102
|
end
|
97
|
-
|
98
|
-
# create template matter to insert a style class if the variable has a value
|
99
|
-
def attrvalue(key, sibling = true, inherit = true)
|
100
|
-
delimiter = sibling ? ' ' : ''
|
101
|
-
if inherit
|
102
|
-
# example: <% if attr? 'foo' %><%= attr 'foo' %><% end %>
|
103
|
-
%(<% if attr? '#{key}' %>#{delimiter}<%= attr '#{key}' %><% end %>)
|
104
|
-
else
|
105
|
-
# example: <% if attr? 'foo', nil, false %><%= attr 'foo', nil, false %><% end %>
|
106
|
-
%(<% if attr? '#{key}', nil, false %>#{delimiter}<%= attr '#{key}', nil, false %><% end %>)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
# create template matter to insert an id if one is specified for the block
|
111
|
-
def id
|
112
|
-
attribute('id', '@id')
|
113
|
-
end
|
114
103
|
end
|
115
104
|
|
116
105
|
module EmptyTemplate
|