asciidoctor-html5s 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +13 -0
- data/data/templates/dlist.html.slim +7 -13
- data/data/templates/inline_button.html.slim +2 -1
- data/data/templates/inline_kbd.html.slim +2 -2
- data/data/templates/inline_menu.html.slim +13 -10
- data/data/templates/inline_quoted.html.slim +6 -1
- data/lib/asciidoctor/html5s/converter.rb +32 -61
- data/lib/asciidoctor/html5s/version.rb +1 -1
- metadata +2 -4
- data/data/templates/_hdlist.html.slim +0 -20
- data/data/templates/_qanda.html.slim +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17192d6ef251b997cf21bd27f3f6c5af60031d17d8e44370f582e03b63a309d6
|
4
|
+
data.tar.gz: 0543d25c6cf4492434466268c9c5a18d10c05c50d6ef85cc99ffb5ae0c4adb9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd24b1973f48a795e212273da1e09e67eb9ea92e6ba8b5ec4592ffc440972cbef01f4d592bfa1aa7e2e22a20946f956c5596e4d2b7c41e7469e2116bfb8da1f2
|
7
|
+
data.tar.gz: 64316e3f00ccefec49487b96f0e9024d7814d2644e4f8cc22a93cae473185bb6fc5f1cac95ce7b12e5191e92539fc68538c8334d8b1eaad64ade64ddd4c39c45
|
data/README.adoc
CHANGED
@@ -125,6 +125,19 @@ link=none / link=false::
|
|
125
125
|
Both block image and inline image supports additional attribute `loading` (see https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading#Images[Lazy loading] on MDN for more information).
|
126
126
|
|
127
127
|
|
128
|
+
=== Additional Inline Formatting Roles
|
129
|
+
|
130
|
+
del::
|
131
|
+
`++[del]#deleted text#++` is rendered as `<del>deleted text</del>`.
|
132
|
+
|
133
|
+
ins::
|
134
|
+
`++[ins]#inserted text#++` is rendered as `<ins>inserted text</ins>`.
|
135
|
+
|
136
|
+
strike::
|
137
|
+
`++[strike]#inserted text#++` is rendered as `<s>inserted text</s>`.
|
138
|
+
This is an alias for `line-through`.
|
139
|
+
|
140
|
+
|
128
141
|
== Requirements
|
129
142
|
|
130
143
|
Note: This converter consists of https://github.com/slim-template/slim/[Slim] templates, but they are precompiled into pure Ruby code using https://github.com/jirutka/asciidoctor-templates-compiler/[asciidoctor-templates-compiler], so you don’t need Slim to use it!
|
@@ -1,13 +1,7 @@
|
|
1
|
-
-
|
2
|
-
|
3
|
-
|
4
|
-
-
|
5
|
-
|
6
|
-
-
|
7
|
-
|
8
|
-
dl class=style
|
9
|
-
- items.each do |terms, dd|
|
10
|
-
- [*terms].each do |dt|
|
11
|
-
dt =dt.text
|
12
|
-
- unless dd.nil?
|
13
|
-
dd =(print_item_content dd)
|
1
|
+
= block_with_title :class=>['dlist', style], :role=>('doc-qna' if style == 'qanda')
|
2
|
+
dl class=style
|
3
|
+
- items.each do |terms, dd|
|
4
|
+
- [*terms].each do |dt|
|
5
|
+
dt =dt.text
|
6
|
+
- unless dd.nil?
|
7
|
+
dd =(print_item_content dd)
|
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
kbd.button
|
2
|
+
samp =text
|
@@ -1,15 +1,18 @@
|
|
1
1
|
- if local_attr :menuitem
|
2
2
|
- capture
|
3
3
|
|  
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
span.caret ›
|
5
|
+
|  
|
6
|
+
kbd.menuseq
|
7
|
+
kbd.menu
|
8
|
+
samp =(attr :menu)
|
9
|
+
- yield_capture
|
9
10
|
- (attr 'submenus').each do |submenu|
|
10
|
-
|
11
|
-
=submenu
|
12
|
-
|
13
|
-
|
11
|
+
kbd.menu
|
12
|
+
samp =submenu
|
13
|
+
- yield_capture
|
14
|
+
kbd.menu
|
15
|
+
samp =(local_attr :menuitem)
|
14
16
|
- else
|
15
|
-
|
17
|
+
kbd.menu
|
18
|
+
samp =(attr :menu)
|
@@ -20,8 +20,13 @@
|
|
20
20
|
- when :asciimath, :latexmath
|
21
21
|
span.math id=id data-lang=stem_lang =(delimit_stem text, type)
|
22
22
|
- else
|
23
|
-
-
|
23
|
+
- case role
|
24
|
+
- when 'line-through', 'strike'
|
25
|
+
s id=id =text
|
26
|
+
- when 'del'
|
24
27
|
del id=id =text
|
28
|
+
- when 'ins'
|
29
|
+
ins id=id =text
|
25
30
|
- else
|
26
31
|
= html_tag_if role? || id, :span, :id=>id, :class=>role
|
27
32
|
=text
|
@@ -960,52 +960,14 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
960
960
|
def dlist(node, opts = {})
|
961
961
|
node.extend(Helpers)
|
962
962
|
node.instance_eval do
|
963
|
-
_buf = [];
|
964
|
-
;
|
965
|
-
; _slim_controls1 = block_with_title :class=>'qlist qanda', :role=>'doc-qna' do; _slim_controls2 = [];
|
966
|
-
; _slim_controls2 << ("<dl class=\"qanda\">");
|
967
|
-
; items.each do |questions, answer|;
|
968
|
-
; [*questions].each do |question|;
|
969
|
-
; _slim_controls2 << ("<dt class=\"qanda-question\">"); _slim_controls2 << (question.text);
|
970
|
-
; _slim_controls2 << ("</dt>"); end; unless answer.nil?;
|
971
|
-
; _slim_controls2 << ("<dd class=\"qanda-answer\">");
|
972
|
-
; if answer.text?;
|
973
|
-
; _slim_controls3 = html_tag_if answer.blocks?, :p do; _slim_controls4 = [];
|
974
|
-
; _slim_controls4 << (answer.text);
|
975
|
-
; _slim_controls4 = _slim_controls4.join(""); end; _slim_controls2 << (_slim_controls3); end; if answer.blocks?;
|
976
|
-
; _slim_controls2 << (answer.content);
|
977
|
-
; end; _slim_controls2 << ("</dd>"); end; end; _slim_controls2 << ("</dl>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1);
|
978
|
-
; when 'horizontal';
|
979
|
-
; _slim_controls5 = block_with_title :class=>'hdlist' do; _slim_controls6 = [];
|
980
|
-
; _slim_controls6 << ("<table>");
|
981
|
-
; if (attr? :labelwidth) || (attr? :itemwidth);
|
982
|
-
; _slim_controls6 << ("<colgroup><col");
|
983
|
-
; _slim_codeattributes1 = style_value(width: [(attr :labelwidth), '%']); if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls6 << (" style"); else; _slim_controls6 << (" style=\""); _slim_controls6 << (_slim_codeattributes1); _slim_controls6 << ("\""); end; end; _slim_controls6 << ("><col");
|
984
|
-
; _slim_codeattributes2 = style_value(width: [(attr :itemwidth), '%']); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls6 << (" style"); else; _slim_controls6 << (" style=\""); _slim_controls6 << (_slim_codeattributes2); _slim_controls6 << ("\""); end; end; _slim_controls6 << ("></colgroup>");
|
985
|
-
; end; items.each do |terms, dd|;
|
986
|
-
; _slim_controls6 << ("<tr><th");
|
987
|
-
; _temple_html_attributeremover1 = []; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "hdlist1"; _temple_html_attributemerger1[1] = []; _slim_codeattributes3 = ('strong' if option? 'strong'); if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributemerger1[1] << (_slim_codeattributes3.join(" ")); else; _temple_html_attributemerger1[1] << (_slim_codeattributes3); end; _temple_html_attributemerger1[1] = _temple_html_attributemerger1[1].join(""); _temple_html_attributeremover1 << (_temple_html_attributemerger1.reject(&:empty?).join(" ")); _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _slim_controls6 << (" class=\""); _slim_controls6 << (_temple_html_attributeremover1); _slim_controls6 << ("\""); end; _slim_controls6 << (">");
|
988
|
-
; terms = [*terms];
|
989
|
-
; terms.each_with_index do |dt, idx|;
|
990
|
-
; _slim_controls6 << (dt.text);
|
991
|
-
; unless idx >= terms.count - 1;
|
992
|
-
; _slim_controls6 << ("<br>");
|
993
|
-
; end; end; _slim_controls6 << ("</th><td class=\"hdlist2\">");
|
994
|
-
; unless dd.nil?;
|
995
|
-
; if dd.text?;
|
996
|
-
; _slim_controls6 << ("<p>"); _slim_controls6 << (dd.text);
|
997
|
-
; _slim_controls6 << ("</p>"); end; if dd.blocks?;
|
998
|
-
; _slim_controls6 << (dd.content);
|
999
|
-
; end; end; _slim_controls6 << ("</td></tr>"); end; _slim_controls6 << ("</table>"); _slim_controls6 = _slim_controls6.join(""); end; _buf << (_slim_controls5);
|
1000
|
-
; else;
|
1001
|
-
; _slim_controls7 = block_with_title :class=>['dlist', style] do; _slim_controls8 = [];
|
1002
|
-
; _slim_controls8 << ("<dl"); _temple_html_attributeremover2 = []; _slim_codeattributes4 = style; if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes4.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes4); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _slim_controls8 << (" class=\""); _slim_controls8 << (_temple_html_attributeremover2); _slim_controls8 << ("\""); end; _slim_controls8 << (">");
|
963
|
+
_buf = []; _slim_controls1 = block_with_title :class=>['dlist', style], :role=>('doc-qna' if style == 'qanda') do; _slim_controls2 = [];
|
964
|
+
; _slim_controls2 << ("<dl"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = style; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes1.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes1); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover1); _slim_controls2 << ("\""); end; _slim_controls2 << (">");
|
1003
965
|
; items.each do |terms, dd|;
|
1004
966
|
; [*terms].each do |dt|;
|
1005
|
-
;
|
1006
|
-
;
|
1007
|
-
;
|
1008
|
-
;
|
967
|
+
; _slim_controls2 << ("<dt>"); _slim_controls2 << (dt.text);
|
968
|
+
; _slim_controls2 << ("</dt>"); end; unless dd.nil?;
|
969
|
+
; _slim_controls2 << ("<dd>"); _slim_controls2 << ((print_item_content dd));
|
970
|
+
; _slim_controls2 << ("</dd>"); end; end; _slim_controls2 << ("</dl>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("")
|
1009
971
|
end
|
1010
972
|
end
|
1011
973
|
|
@@ -1057,12 +1019,12 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1057
1019
|
node.extend(Helpers)
|
1058
1020
|
node.instance_eval do
|
1059
1021
|
_buf = []; if (keys = attr 'keys').size == 1;
|
1060
|
-
; _buf << ("<kbd>"); _buf << (keys.first);
|
1022
|
+
; _buf << ("<kbd class=\"key\">"); _buf << (keys.first);
|
1061
1023
|
; _buf << ("</kbd>"); else;
|
1062
1024
|
; _buf << ("<kbd class=\"keyseq\">");
|
1063
1025
|
; keys.each_with_index do |key, idx|;
|
1064
1026
|
; _buf << ("+" unless idx.zero?);
|
1065
|
-
; _buf << ("<kbd>"); _buf << (key);
|
1027
|
+
; _buf << ("<kbd class=\"key\">"); _buf << (key);
|
1066
1028
|
; _buf << ("</kbd>"); end; _buf << ("</kbd>"); end; _buf = _buf.join("")
|
1067
1029
|
end
|
1068
1030
|
end
|
@@ -1156,9 +1118,14 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1156
1118
|
; _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); when :asciimath, :latexmath;
|
1157
1119
|
; _buf << ("<span class=\"math\""); _slim_codeattributes13 = id; if _slim_codeattributes13; if _slim_codeattributes13 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes13); _buf << ("\""); end; end; _slim_codeattributes14 = stem_lang; if _slim_codeattributes14; if _slim_codeattributes14 == true; _buf << (" data-lang"); else; _buf << (" data-lang=\""); _buf << (_slim_codeattributes14); _buf << ("\""); end; end; _buf << (">"); _buf << ((delimit_stem text, type));
|
1158
1120
|
; _buf << ("</span>"); else;
|
1159
|
-
;
|
1160
|
-
;
|
1161
|
-
; _buf << ("
|
1121
|
+
; case role;
|
1122
|
+
; when 'line-through', 'strike';
|
1123
|
+
; _buf << ("<s"); _slim_codeattributes15 = id; if _slim_codeattributes15; if _slim_codeattributes15 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes15); _buf << ("\""); end; end; _buf << (">"); _buf << (text);
|
1124
|
+
; _buf << ("</s>"); when 'del';
|
1125
|
+
; _buf << ("<del"); _slim_codeattributes16 = id; if _slim_codeattributes16; if _slim_codeattributes16 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes16); _buf << ("\""); end; end; _buf << (">"); _buf << (text);
|
1126
|
+
; _buf << ("</del>"); when 'ins';
|
1127
|
+
; _buf << ("<ins"); _slim_codeattributes17 = id; if _slim_codeattributes17; if _slim_codeattributes17 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes17); _buf << ("\""); end; end; _buf << (">"); _buf << (text);
|
1128
|
+
; _buf << ("</ins>"); else;
|
1162
1129
|
; _slim_controls5 = html_tag_if role? || id, :span, :id=>id, :class=>role do; _slim_controls6 = [];
|
1163
1130
|
; _slim_controls6 << (text);
|
1164
1131
|
; _slim_controls6 = _slim_controls6.join(""); end; _buf << (_slim_controls5); end; end; _buf = _buf.join("")
|
@@ -1205,20 +1172,23 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1205
1172
|
node.instance_eval do
|
1206
1173
|
_buf = []; if local_attr :menuitem;
|
1207
1174
|
; capture do;
|
1208
|
-
; _buf << (" <
|
1175
|
+
; _buf << (" <span class=\"caret\">›</span> ");
|
1176
|
+
;
|
1209
1177
|
;
|
1210
|
-
; end; _buf << ("<
|
1178
|
+
; end; _buf << ("<kbd class=\"menuseq\"><kbd class=\"menu\"><samp>");
|
1211
1179
|
;
|
1212
1180
|
; _buf << ((attr :menu));
|
1213
|
-
; yield_capture;
|
1214
|
-
;
|
1215
|
-
; _buf << ("<
|
1181
|
+
; _buf << ("</samp></kbd>"); yield_capture;
|
1182
|
+
; (attr 'submenus').each do |submenu|;
|
1183
|
+
; _buf << ("<kbd class=\"menu\"><samp>");
|
1216
1184
|
; _buf << (submenu);
|
1217
|
-
; yield_capture;
|
1218
|
-
;
|
1219
|
-
; _buf << (
|
1220
|
-
; _buf << ("
|
1221
|
-
; _buf << ("
|
1185
|
+
; _buf << ("</samp></kbd>"); yield_capture;
|
1186
|
+
; end; _buf << ("<kbd class=\"menu\"><samp>");
|
1187
|
+
; _buf << ((local_attr :menuitem));
|
1188
|
+
; _buf << ("</samp></kbd></kbd>"); else;
|
1189
|
+
; _buf << ("<kbd class=\"menu\"><samp>");
|
1190
|
+
; _buf << ((attr :menu));
|
1191
|
+
; _buf << ("</samp></kbd>"); end; _buf = _buf.join("")
|
1222
1192
|
end
|
1223
1193
|
end
|
1224
1194
|
|
@@ -1393,8 +1363,9 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1393
1363
|
def inline_button(node, opts = {})
|
1394
1364
|
node.extend(Helpers)
|
1395
1365
|
node.instance_eval do
|
1396
|
-
_buf = []; _buf << ("<
|
1397
|
-
; _buf << (
|
1366
|
+
_buf = []; _buf << ("<kbd class=\"button\"><samp>");
|
1367
|
+
; _buf << (text);
|
1368
|
+
; _buf << ("</samp></kbd>"); _buf = _buf.join("")
|
1398
1369
|
end
|
1399
1370
|
end
|
1400
1371
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-html5s
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Jirutka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -158,9 +158,7 @@ files:
|
|
158
158
|
- data/templates/_attribution.html.slim
|
159
159
|
- data/templates/_footer.html.slim
|
160
160
|
- data/templates/_footnotes.html.slim
|
161
|
-
- data/templates/_hdlist.html.slim
|
162
161
|
- data/templates/_header.html.slim
|
163
|
-
- data/templates/_qanda.html.slim
|
164
162
|
- data/templates/_toc.html.slim
|
165
163
|
- data/templates/admonition.html.slim
|
166
164
|
- data/templates/audio.html.slim
|
@@ -1,20 +0,0 @@
|
|
1
|
-
= block_with_title :class=>'hdlist'
|
2
|
-
table
|
3
|
-
- if (attr? :labelwidth) || (attr? :itemwidth)
|
4
|
-
colgroup
|
5
|
-
col style=style_value(width: [(attr :labelwidth), '%'])
|
6
|
-
col style=style_value(width: [(attr :itemwidth), '%'])
|
7
|
-
- items.each do |terms, dd|
|
8
|
-
tr
|
9
|
-
th.hdlist1 class=('strong' if option? 'strong')
|
10
|
-
- terms = [*terms]
|
11
|
-
- terms.each_with_index do |dt, idx|
|
12
|
-
=dt.text
|
13
|
-
- unless idx >= terms.count - 1
|
14
|
-
br
|
15
|
-
td.hdlist2
|
16
|
-
- unless dd.nil?
|
17
|
-
- if dd.text?
|
18
|
-
p =dd.text
|
19
|
-
- if dd.blocks?
|
20
|
-
=dd.content
|
@@ -1,12 +0,0 @@
|
|
1
|
-
= block_with_title :class=>'qlist qanda', :role=>'doc-qna'
|
2
|
-
dl.qanda
|
3
|
-
- items.each do |questions, answer|
|
4
|
-
- [*questions].each do |question|
|
5
|
-
dt.qanda-question =question.text
|
6
|
-
- unless answer.nil?
|
7
|
-
dd.qanda-answer
|
8
|
-
- if answer.text?
|
9
|
-
= html_tag_if answer.blocks?, :p
|
10
|
-
=answer.text
|
11
|
-
- if answer.blocks?
|
12
|
-
=answer.content
|