Class: Asciidoctor::Html5s::Converter
- Inherits:
-
Converter::Base
- Object
- Converter::Base
- Asciidoctor::Html5s::Converter
- Defined in:
- lib/asciidoctor/html5s/converter.rb
Defined Under Namespace
Modules: Helpers
Instance Method Summary collapse
- #admonition(node, opts = {}) ⇒ Object
- #audio(node, opts = {}) ⇒ Object
- #colist(node, opts = {}) ⇒ Object
- #convert(node, transform = nil, opts = {}) ⇒ Object
- #dlist(node, opts = {}) ⇒ Object
- #document(node, opts = {}) ⇒ Object
- #embedded(node, opts = {}) ⇒ Object
- #empty(node, opts = {}) ⇒ Object
- #example(node, opts = {}) ⇒ Object
- #floating_title(node, opts = {}) ⇒ Object
- #handles?(transform) ⇒ Boolean
- #image(node, opts = {}) ⇒ Object
-
#initialize(backend, opts = {}) ⇒ Converter
constructor
A new instance of Converter.
- #inline_anchor(node, opts = {}) ⇒ Object
- #inline_break(node, opts = {}) ⇒ Object
- #inline_button(node, opts = {}) ⇒ Object
- #inline_callout(node, opts = {}) ⇒ Object
- #inline_footnote(node, opts = {}) ⇒ Object
- #inline_image(node, opts = {}) ⇒ Object
- #inline_indexterm(node, opts = {}) ⇒ Object
- #inline_kbd(node, opts = {}) ⇒ Object
- #inline_menu(node, opts = {}) ⇒ Object
- #inline_quoted(node, opts = {}) ⇒ Object
- #listing(node, opts = {}) ⇒ Object
- #literal(node, opts = {}) ⇒ Object
- #olist(node, opts = {}) ⇒ Object
- #open(node, opts = {}) ⇒ Object
- #outline(node, opts = {}) ⇒ Object
- #page_break(node, opts = {}) ⇒ Object
- #paragraph(node, opts = {}) ⇒ Object
- #pass(node, opts = {}) ⇒ Object
- #preamble(node, opts = {}) ⇒ Object
- #quote(node, opts = {}) ⇒ Object
- #section(node, opts = {}) ⇒ Object
- #sidebar(node, opts = {}) ⇒ Object
- #stem(node, opts = {}) ⇒ Object
- #table(node, opts = {}) ⇒ Object
- #thematic_break(node, opts = {}) ⇒ Object
- #toc(node, opts = {}) ⇒ Object
- #ulist(node, opts = {}) ⇒ Object
- #verse(node, opts = {}) ⇒ Object
- #video(node, opts = {}) ⇒ Object
Constructor Details
#initialize(backend, opts = {}) ⇒ Converter
755 756 757 758 759 760 761 |
# File 'lib/asciidoctor/html5s/converter.rb', line 755 def initialize(backend, opts = {}) super basebackend "html" if respond_to? :basebackend outfilesuffix ".html" if respond_to? :outfilesuffix filetype "html" if respond_to? :filetype supports_templates if respond_to? :supports_templates end |
Instance Method Details
#admonition(node, opts = {}) ⇒ Object
829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 |
# File 'lib/asciidoctor/html5s/converter.rb', line 829 def admonition(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; capture do; ; _buf << ("<h6"); _temple_html_attributeremover1 = []; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "block-title"; _temple_html_attributemerger1[1] = []; _slim_codeattributes1 = ('label-only' unless title?); if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributemerger1[1] << (_slim_codeattributes1.join(" ")); else; _temple_html_attributemerger1[1] << (_slim_codeattributes1); 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?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << ("><span class=\"title-label\">"); ; _buf << ("#{local_attr :textlabel}: "); ; _buf << ("</span>"); _buf << (title); ; _buf << ("</h6>"); _slim_controls1 = html_tag_if !blocks?, :p do; _slim_controls2 = []; ; _slim_controls2 << (content); ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); end; if admonition_aside?; ; _buf << ("<aside"); _temple_html_attributeremover2 = []; _temple_html_attributemerger2 = []; _temple_html_attributemerger2[0] = "admonition-block"; _temple_html_attributemerger2[1] = []; _slim_codeattributes2 = [(attr :name), role]; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributemerger2[1] << (_slim_codeattributes2.join(" ")); else; _temple_html_attributemerger2[1] << (_slim_codeattributes2); end; _temple_html_attributemerger2[1] = _temple_html_attributemerger2[1].join(""); _temple_html_attributeremover2 << (_temple_html_attributemerger2.reject(&:empty?).join(" ")); _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover2); _buf << ("\""); end; _slim_codeattributes3 = id; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _slim_codeattributes4 = admonition_aria; if _slim_codeattributes4; if _slim_codeattributes4 == true; _buf << (" role"); else; _buf << (" role=\""); _buf << (_slim_codeattributes4); _buf << ("\""); end; end; _buf << (">"); ; yield_capture; ; _buf << ("</aside>"); else; ; _buf << ("<section"); _temple_html_attributeremover3 = []; _temple_html_attributemerger3 = []; _temple_html_attributemerger3[0] = "admonition-block"; _temple_html_attributemerger3[1] = []; _slim_codeattributes5 = [(attr :name), role]; if Array === _slim_codeattributes5; _slim_codeattributes5 = _slim_codeattributes5.flatten; _slim_codeattributes5.map!(&:to_s); _slim_codeattributes5.reject!(&:empty?); _temple_html_attributemerger3[1] << (_slim_codeattributes5.join(" ")); else; _temple_html_attributemerger3[1] << (_slim_codeattributes5); end; _temple_html_attributemerger3[1] = _temple_html_attributemerger3[1].join(""); _temple_html_attributeremover3 << (_temple_html_attributemerger3.reject(&:empty?).join(" ")); _temple_html_attributeremover3 = _temple_html_attributeremover3.join(""); if !_temple_html_attributeremover3.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover3); _buf << ("\""); end; _slim_codeattributes6 = id; if _slim_codeattributes6; if _slim_codeattributes6 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes6); _buf << ("\""); end; end; _slim_codeattributes7 = admonition_aria; if _slim_codeattributes7; if _slim_codeattributes7 == true; _buf << (" role"); else; _buf << (" role=\""); _buf << (_slim_codeattributes7); _buf << ("\""); end; end; _buf << (">"); ; yield_capture; ; _buf << ("</section>"); end; _buf = _buf.join("") end end |
#audio(node, opts = {}) ⇒ Object
1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1366 def audio(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_caption :bottom, :class=>'audio-block' do; _slim_controls2 = []; ; ; ; ; ; _slim_controls2 << ("<audio"); _slim_codeattributes1 = media_uri(attr :target); if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" src"); else; _slim_controls2 << (" src=\""); _slim_controls2 << (_slim_codeattributes1); _slim_controls2 << ("\""); end; end; _slim_codeattributes2 = (option? 'autoplay'); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" autoplay"); else; _slim_controls2 << (" autoplay=\""); _slim_controls2 << (_slim_codeattributes2); _slim_controls2 << ("\""); end; end; _slim_codeattributes3 = !(option? 'nocontrols'); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" controls"); else; _slim_controls2 << (" controls=\""); _slim_controls2 << (_slim_codeattributes3); _slim_controls2 << ("\""); end; end; _slim_codeattributes4 = (option? 'loop'); if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" loop"); else; _slim_controls2 << (" loop=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">Your browser does not support the audio tag.</audio>"); ; ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#colist(node, opts = {}) ⇒ Object
1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1462 def colist(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; ; _buf << ("<ol"); _temple_html_attributeremover1 = []; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "callout-list"; _temple_html_attributemerger1[1] = []; _slim_codeattributes1 = [style, role]; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributemerger1[1] << (_slim_codeattributes1.join(" ")); else; _temple_html_attributemerger1[1] << (_slim_codeattributes1); 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?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _slim_codeattributes2 = id; if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes2); _buf << ("\""); end; end; _buf << (">"); ; items.each do |item|; ; _buf << ("<li>"); _buf << (item.text); ; _buf << ("</li>"); end; _buf << ("</ol>"); _buf = _buf.join("") end end |
#convert(node, transform = nil, opts = {}) ⇒ Object
763 764 765 766 767 768 769 770 771 772 773 |
# File 'lib/asciidoctor/html5s/converter.rb', line 763 def convert(node, transform = nil, opts = {}) transform ||= node.node_name opts ||= {} converter = self if opts.empty? converter.send(transform, node) else converter.send(transform, node, opts) end end |
#dlist(node, opts = {}) ⇒ Object
928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 |
# File 'lib/asciidoctor/html5s/converter.rb', line 928 def dlist(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; case style; ; when 'qanda'; ; _slim_controls1 = block_with_title :class=>'qlist qanda', :role=>'doc-qna' do; _slim_controls2 = []; ; _slim_controls2 << ("<dl class=\"qanda\">"); ; items.each do |questions, answer|; ; [*questions].each do |question|; ; _slim_controls2 << ("<dt class=\"qanda-question\">"); _slim_controls2 << (question.text); ; _slim_controls2 << ("</dt>"); end; unless answer.nil?; ; _slim_controls2 << ("<dd class=\"qanda-answer\">"); ; if answer.text?; ; _slim_controls3 = html_tag_if answer.blocks?, :p do; _slim_controls4 = []; ; _slim_controls4 << (answer.text); ; _slim_controls4 = _slim_controls4.join(""); end; _slim_controls2 << (_slim_controls3); end; if answer.blocks?; ; _slim_controls2 << (answer.content); ; end; _slim_controls2 << ("</dd>"); end; end; _slim_controls2 << ("</dl>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); ; when 'horizontal'; ; _slim_controls5 = block_with_title :class=>'hdlist' do; _slim_controls6 = []; ; _slim_controls6 << ("<table>"); ; if (attr? :labelwidth) || (attr? :itemwidth); ; _slim_controls6 << ("<colgroup><col"); ; _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"); ; _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>"); ; end; items.each do |terms, dd|; ; _slim_controls6 << ("<tr><th"); ; _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 << (">"); ; terms = [*terms]; ; terms.each_with_index do |dt, idx|; ; _slim_controls6 << (dt.text); ; unless idx >= terms.count - 1; ; _slim_controls6 << ("<br>"); ; end; end; _slim_controls6 << ("</th><td class=\"hdlist2\">"); ; unless dd.nil?; ; if dd.text?; ; _slim_controls6 << ("<p>"); _slim_controls6 << (dd.text); ; _slim_controls6 << ("</p>"); end; if dd.blocks?; ; _slim_controls6 << (dd.content); ; end; end; _slim_controls6 << ("</td></tr>"); end; _slim_controls6 << ("</table>"); _slim_controls6 = _slim_controls6.join(""); end; _buf << (_slim_controls5); ; else; ; _slim_controls7 = block_with_title :class=>['dlist', style] do; _slim_controls8 = []; ; _slim_controls8 << ("<dl>"); ; items.each do |terms, dd|; ; [*terms].each do |dt|; ; _slim_controls8 << ("<dt>"); _slim_controls8 << (dt.text); ; _slim_controls8 << ("</dt>"); end; unless dd.nil?; ; _slim_controls8 << ("<dd>"); _slim_controls8 << ((print_item_content dd)); ; _slim_controls8 << ("</dd>"); end; end; _slim_controls8 << ("</dl>"); _slim_controls8 = _slim_controls8.join(""); end; _buf << (_slim_controls7); end; _buf = _buf.join("") end end |
#document(node, opts = {}) ⇒ Object
1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1228 def document(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << ("<!DOCTYPE html><html"); ; _slim_codeattributes1 = (attr :lang, 'en' unless attr? :nolang); if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" lang"); else; _buf << (" lang=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << ("><head><meta"); ; ; _slim_codeattributes2 = (attr :encoding, 'UTF-8'); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" charset"); else; _buf << (" charset=\""); _buf << (_slim_codeattributes2); _buf << ("\""); end; end; _buf << ("><!--[if IE]><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><![endif]--><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta name=\"generator\" content=\"Asciidoctor "); ; ; ; ; _buf << (attr 'asciidoctor-version'); _buf << ("\">"); ; _buf << ( 'application-name', (attr 'app-name')); ; _buf << ( 'author', (attr :authors)); ; _buf << ( 'copyright', (attr :copyright)); ; _buf << ( 'description', (attr :description)); ; _buf << ( 'keywords', (attr :keywords)); ; _buf << ("<title>"); _buf << (((doctitle sanitize: true) || (attr 'untitled-label'))); ; _buf << ("</title>"); _buf << (styles_and_scripts); ; unless (docinfo_content = docinfo).empty?; ; _buf << (docinfo_content); ; end; _buf << ("</head><body"); ; ; ; _slim_codeattributes3 = id; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes4 = [(attr :doctype), ("#{attr 'toc-class'} toc-#{attr 'toc-position', 'left'}" if (attr? 'toc-class') && (attr? :toc) && (attr? 'toc-placement', 'auto'))]; if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes4.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes4); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _slim_codeattributes5 = style_value(max_width: (attr 'max-width')); if _slim_codeattributes5; if _slim_codeattributes5 == true; _buf << (" style"); else; _buf << (" style=\""); _buf << (_slim_codeattributes5); _buf << ("\""); end; end; _buf << (">"); ; unless noheader; ; _buf << ("<header>"); ; if has_header?; ; unless notitle; ; _buf << ("<h1>"); _buf << (header.title); ; _buf << ("</h1>"); end; if [:author, :revnumber, :revdate, :revremark].any? {|a| attr? a }; ; _buf << ("<div class=\"details\">"); ; if attr? :author; ; _buf << ("<span class=\"author\" id=\"author\">"); _buf << ((attr :author)); ; _buf << ("</span><br>"); ; if attr? :email; ; _buf << ("<span class=\"email\" id=\"email\">"); _buf << (sub_macros(attr :email)); ; _buf << ("</span><br>"); ; end; if ( = (attr :authorcount).to_i) > 1; ; (2..).each do |idx|; ; _buf << ("<span class=\"author\" id=\"author"); _buf << (idx); _buf << ("\">"); _buf << ((attr "author_#{idx}")); ; _buf << ("</span><br>"); ; if attr? "email_#{idx}"; ; _buf << ("<span class=\"email\" id=\"email"); _buf << (idx); _buf << ("\">"); _buf << (sub_macros(attr "email_#{idx}")); ; _buf << ("</span>"); end; end; end; end; if attr? :revnumber; ; _buf << ("<span id=\"revnumber\">"); _buf << (((attr 'version-label') || '').downcase); _buf << (" "); _buf << (attr :revnumber); _buf << (',' if attr? :revdate); _buf << ("</span> "); ; ; end; if attr? :revdate; ; _buf << ("<time id=\"revdate\""); _slim_codeattributes6 = revdate_iso; if _slim_codeattributes6; if _slim_codeattributes6 == true; _buf << (" datetime"); else; _buf << (" datetime=\""); _buf << (_slim_codeattributes6); _buf << ("\""); end; end; _buf << (">"); _buf << ((attr :revdate)); ; _buf << ("</time>"); end; if attr? :revremark; ; _buf << ("<br><span id=\"revremark\">"); ; _buf << ((attr :revremark)); ; _buf << ("</span>"); end; _buf << ("</div>"); end; end; if (attr? :toc) && (attr? 'toc-placement', 'auto'); ; _buf << ("<nav id=\"toc\""); _temple_html_attributeremover2 = []; _slim_codeattributes7 = (document.attr 'toc-class', 'toc'); if Array === _slim_codeattributes7; _slim_codeattributes7 = _slim_codeattributes7.flatten; _slim_codeattributes7.map!(&:to_s); _slim_codeattributes7.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes7.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes7); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover2); _buf << ("\""); end; _buf << (" role=\"doc-toc\"><h2 id=\"toc-title\">"); ; _buf << ((document.attr 'toc-title')); ; _buf << ("</h2>"); ; _buf << (converter.convert document, 'outline'); ; _buf << ("</nav>"); ; end; ; _buf << ("</header>"); end; _buf << ("<div id=\"content\">"); _buf << (content); ; _buf << ("</div>"); unless !footnotes? || (attr? :nofootnotes); ; _buf << ("<section class=\"footnotes\" aria-label=\"Footnotes\" role=\"doc-endnotes\"><hr><ol class=\"footnotes\">"); ; ; ; footnotes.each do |fn|; ; _buf << ("<li class=\"footnote\""); _slim_codeattributes8 = (footnote_id fn.index); if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes8); _buf << ("\""); end; end; _buf << (" role=\"doc-endnote\">"); ; _buf << ("#{fn.text} "); ; ; ; ; _buf << ("<a class=\"footnote-backref\" href=\"#"); _buf << (footnoteref_id fn.index); _buf << ("\" role=\"doc-backlink\" title=\"Jump to the first occurrence in the text\">↩</a></li>"); ; ; end; _buf << ("</ol></section>"); ; end; unless ; ; _buf << ("<footer><div id=\"footer-text\">"); ; ; if attr? :revnumber; ; _buf << (attr 'version-label'); _buf << (" "); _buf << (attr :revnumber); ; end; if attr? 'last-update-label'; ; _buf << ("<br>"); ; _buf << (attr 'last-update-label'); _buf << (" "); _buf << (attr :docdatetime); ; end; _buf << ("</div>"); unless (docinfo_content = (docinfo :footer)).empty?; ; _buf << (docinfo_content); ; end; ; _buf << ("</footer>"); end; _buf << ("</body></html>"); _buf = _buf.join("") end end |
#embedded(node, opts = {}) ⇒ Object
1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1199 def (node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; if !notitle && has_header?; ; _buf << ("<h1"); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << (">"); _buf << (header.title); ; _buf << ("</h1>"); end; if node.sections? && (attr? :toc) && (attr 'toc-placement', 'auto') == 'auto'; ; _buf << ("<nav id=\"toc\""); _temple_html_attributeremover1 = []; _slim_codeattributes2 = (document.attr 'toc-class', 'toc'); if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (" role=\"doc-toc\"><h2 id=\"toc-title\">"); ; _buf << ((document.attr 'toc-title')); ; _buf << ("</h2>"); ; _buf << (converter.convert document, 'outline'); ; _buf << ("</nav>"); ; end; _buf << (content); ; if footnotes? && !(attr? :nofootnotes); ; _buf << ("<section class=\"footnotes\" aria-label=\"Footnotes\" role=\"doc-endnotes\"><hr><ol class=\"footnotes\">"); ; ; ; footnotes.each do |fn|; ; _buf << ("<li class=\"footnote\""); _slim_codeattributes3 = (footnote_id fn.index); if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _buf << (" role=\"doc-endnote\">"); ; _buf << ("#{fn.text} "); ; ; ; ; _buf << ("<a class=\"footnote-backref\" href=\"#"); _buf << (footnoteref_id fn.index); _buf << ("\" role=\"doc-backlink\" title=\"Jump to the first occurrence in the text\">↩</a></li>"); ; ; end; _buf << ("</ol></section>"); ; end; _buf = _buf.join("") end end |
#empty(node, opts = {}) ⇒ Object
1040 1041 1042 1043 1044 1045 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1040 def empty(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; ; _buf = _buf.join("") end end |
#example(node, opts = {}) ⇒ Object
1452 1453 1454 1455 1456 1457 1458 1459 1460 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1452 def example(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_caption :top, :class=>'example-block' do; _slim_controls2 = []; ; _slim_controls2 << ("<div class=\"example\">"); ; _slim_controls2 << (content); ; _slim_controls2 << ("</div>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#floating_title(node, opts = {}) ⇒ Object
1492 1493 1494 1495 1496 1497 1498 1499 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1492 def floating_title(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_htag_filter1 = ((level + 1)).to_s; _buf << ("<h"); _buf << (_slim_htag_filter1); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes2 = [style, role]; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (">"); ; _buf << (title); ; _buf << ("</h"); _buf << (_slim_htag_filter1); _buf << (">"); _buf = _buf.join("") end end |
#handles?(transform) ⇒ Boolean
775 776 777 |
# File 'lib/asciidoctor/html5s/converter.rb', line 775 def handles?(transform) respond_to?("convert_#{transform}") || respond_to?(transform) end |
#image(node, opts = {}) ⇒ Object
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 |
# File 'lib/asciidoctor/html5s/converter.rb', line 782 def image(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_caption(:bottom, :class=>'image-block', :style=>style_value(text_align: (attr :align), float: (attr :float))) do; _slim_controls2 = []; ; target_url = image_uri(attr :target); ; _slim_controls3 = html_tag_if(image_link, :a, :class=>['image', ('bare' if image_link == target_url)], :href=>image_link, :title=>image_link_label, 'aria-label'=>image_link_label, :target=>(attr :window), :rel=>link_rel) do; _slim_controls4 = []; ; _slim_controls4 << ("<img"); _slim_codeattributes1 = target_url; if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls4 << (" src"); else; _slim_controls4 << (" src=\""); _slim_controls4 << (_slim_codeattributes1); _slim_controls4 << ("\""); end; end; _slim_codeattributes2 = (attr :alt); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls4 << (" alt"); else; _slim_controls4 << (" alt=\""); _slim_controls4 << (_slim_codeattributes2); _slim_controls4 << ("\""); end; end; _slim_codeattributes3 = (attr :width); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls4 << (" width"); else; _slim_controls4 << (" width=\""); _slim_controls4 << (_slim_codeattributes3); _slim_controls4 << ("\""); end; end; _slim_codeattributes4 = (attr :height); if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls4 << (" height"); else; _slim_controls4 << (" height=\""); _slim_controls4 << (_slim_codeattributes4); _slim_controls4 << ("\""); end; end; _slim_codeattributes5 = (attr :loading); if _slim_codeattributes5; if _slim_codeattributes5 == true; _slim_controls4 << (" loading"); else; _slim_controls4 << (" loading=\""); _slim_controls4 << (_slim_codeattributes5); _slim_controls4 << ("\""); end; end; _slim_controls4 << (">"); ; _slim_controls4 = _slim_controls4.join(""); end; _slim_controls2 << (_slim_controls3); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#inline_anchor(node, opts = {}) ⇒ Object
1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1055 def inline_anchor(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; case type; ; when :xref; ; _buf << ("<a"); _slim_codeattributes1 = target; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" href"); else; _buf << (" href=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << (">"); _buf << (xref_text); ; _buf << ("</a>"); when :ref; ; ; _buf << ("<a"); _slim_codeattributes2 = (id || target); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes2); _buf << ("\""); end; end; _buf << (" aria-hidden=\"true\"></a>"); ; when :bibref; ; ; _buf << ("<a"); _slim_codeattributes3 = (id || target); if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _buf << (" aria-hidden=\"true\"></a>"); ; _buf << (bibref_text); ; else; ; _buf << ("<a"); _slim_codeattributes4 = id; if _slim_codeattributes4; if _slim_codeattributes4 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes4); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes5 = role; if Array === _slim_codeattributes5; _slim_codeattributes5 = _slim_codeattributes5.flatten; _slim_codeattributes5.map!(&:to_s); _slim_codeattributes5.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes5.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes5); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _slim_codeattributes6 = target; if _slim_codeattributes6; if _slim_codeattributes6 == true; _buf << (" href"); else; _buf << (" href=\""); _buf << (_slim_codeattributes6); _buf << ("\""); end; end; _slim_codeattributes7 = (attr :window); if _slim_codeattributes7; if _slim_codeattributes7 == true; _buf << (" target"); else; _buf << (" target=\""); _buf << (_slim_codeattributes7); _buf << ("\""); end; end; _slim_codeattributes8 = link_rel; if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" rel"); else; _buf << (" rel=\""); _buf << (_slim_codeattributes8); _buf << ("\""); end; end; _slim_codeattributes9 = (attr :title); if _slim_codeattributes9; if _slim_codeattributes9 == true; _buf << (" title"); else; _buf << (" title=\""); _buf << (_slim_codeattributes9); _buf << ("\""); end; end; _buf << (">"); _buf << (text); ; _buf << ("</a>"); end; _buf = _buf.join("") end end |
#inline_break(node, opts = {}) ⇒ Object
899 900 901 902 903 904 905 906 |
# File 'lib/asciidoctor/html5s/converter.rb', line 899 def inline_break(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << (text); ; _buf << ("<br>"); ; _buf = _buf.join("") end end |
#inline_button(node, opts = {}) ⇒ Object
1358 1359 1360 1361 1362 1363 1364 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1358 def (node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << ("<b class=\"button\">"); _buf << (text); ; _buf << ("</b>"); _buf = _buf.join("") end end |
#inline_callout(node, opts = {}) ⇒ Object
813 814 815 816 817 818 819 |
# File 'lib/asciidoctor/html5s/converter.rb', line 813 def inline_callout(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << ("<b class=\"conum\">"); _buf << (text); ; _buf << ("</b>"); _buf = _buf.join("") end end |
#inline_footnote(node, opts = {}) ⇒ Object
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 |
# File 'lib/asciidoctor/html5s/converter.rb', line 883 def inline_footnote(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; if (index = local_attr :index); ; ; ; ; ; _buf << ("<a class=\"footnote-ref\""); _slim_codeattributes1 = (footnoteref_id unless type == :xref); if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << (" href=\"#"); _buf << (footnote_id); _buf << ("\" title=\"View footnote "); _buf << (index); _buf << ("\" role=\"doc-noteref\">["); ; _buf << (index); _buf << ("]</a>"); ; else; ; _buf << ("<a class=\"footnote-ref broken\" title=\"Unresolved footnote reference.\">["); _buf << (text); _buf << ("]</a>"); ; end; _buf = _buf.join("") end end |
#inline_image(node, opts = {}) ⇒ Object
1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1418 def inline_image(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = html_tag_if((attr? :link), :a, :class=>'image', :href=>(attr :link), :target=>(attr :window), :rel=>link_rel) do; _slim_controls2 = []; ; if type == 'icon' && (document.attr? :icons, 'font'); ; _slim_controls2 << ("<i"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = [*icon_fa_classes, role]; 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_codeattributes2 = (attr :title); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" title"); else; _slim_controls2 << (" title=\""); _slim_controls2 << (_slim_codeattributes2); _slim_controls2 << ("\""); end; end; _slim_controls2 << ("></i>"); ; elsif type == 'icon' && !(document.attr? :icons); ; _slim_controls2 << ("<b"); _temple_html_attributeremover2 = []; _slim_codeattributes3 = ['icon', role]; if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes3.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes3); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover2); _slim_controls2 << ("\""); end; _slim_codeattributes4 = (attr :title); if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" title"); else; _slim_controls2 << (" title=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">["); ; _slim_controls2 << (attr :alt); _slim_controls2 << ("]</b>"); ; else; ; ; ; _slim_controls2 << ("<img"); _slim_codeattributes5 = (type == 'icon' ? (icon_uri target) : (image_uri target)); if _slim_codeattributes5; if _slim_codeattributes5 == true; _slim_controls2 << (" src"); else; _slim_controls2 << (" src=\""); _slim_controls2 << (_slim_codeattributes5); _slim_controls2 << ("\""); end; end; _slim_codeattributes6 = (attr :alt); if _slim_codeattributes6; if _slim_codeattributes6 == true; _slim_controls2 << (" alt"); else; _slim_controls2 << (" alt=\""); _slim_controls2 << (_slim_codeattributes6); _slim_controls2 << ("\""); end; end; _slim_codeattributes7 = (attr :width); if _slim_codeattributes7; if _slim_codeattributes7 == true; _slim_controls2 << (" width"); else; _slim_controls2 << (" width=\""); _slim_controls2 << (_slim_codeattributes7); _slim_controls2 << ("\""); end; end; _slim_codeattributes8 = (attr :height); if _slim_codeattributes8; if _slim_codeattributes8 == true; _slim_controls2 << (" height"); else; _slim_controls2 << (" height=\""); _slim_controls2 << (_slim_codeattributes8); _slim_controls2 << ("\""); end; end; _slim_codeattributes9 = (attr :title); if _slim_codeattributes9; if _slim_codeattributes9 == true; _slim_controls2 << (" title"); else; _slim_controls2 << (" title=\""); _slim_controls2 << (_slim_codeattributes9); _slim_controls2 << ("\""); end; end; _slim_codeattributes10 = (attr :loading); if _slim_codeattributes10; if _slim_codeattributes10 == true; _slim_controls2 << (" loading"); else; _slim_controls2 << (" loading=\""); _slim_controls2 << (_slim_codeattributes10); _slim_controls2 << ("\""); end; end; _temple_html_attributeremover3 = []; _slim_codeattributes11 = [(type if type != 'image'), role]; if Array === _slim_codeattributes11; _slim_codeattributes11 = _slim_codeattributes11.flatten; _slim_codeattributes11.map!(&:to_s); _slim_codeattributes11.reject!(&:empty?); _temple_html_attributeremover3 << (_slim_codeattributes11.join(" ")); else; _temple_html_attributeremover3 << (_slim_codeattributes11); end; _temple_html_attributeremover3 = _temple_html_attributeremover3.join(""); if !_temple_html_attributeremover3.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover3); _slim_controls2 << ("\""); end; _slim_codeattributes12 = style_value(float: (attr :float)); if _slim_codeattributes12; if _slim_codeattributes12 == true; _slim_controls2 << (" style"); else; _slim_controls2 << (" style=\""); _slim_controls2 << (_slim_codeattributes12); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); ; end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#inline_indexterm(node, opts = {}) ⇒ Object
1160 1161 1162 1163 1164 1165 1166 1167 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1160 def inline_indexterm(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; if type == :visible; ; _buf << (text); ; end; _buf = _buf.join("") end end |
#inline_kbd(node, opts = {}) ⇒ Object
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1026 def inline_kbd(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; if (keys = attr 'keys').size == 1; ; _buf << ("<kbd>"); _buf << (keys.first); ; _buf << ("</kbd>"); else; ; _buf << ("<kbd class=\"keyseq\">"); ; keys.each_with_index do |key, idx|; ; _buf << ("+" unless idx.zero?); ; _buf << ("<kbd>"); _buf << (key); ; _buf << ("</kbd>"); end; _buf << ("</kbd>"); end; _buf = _buf.join("") end end |
#inline_menu(node, opts = {}) ⇒ Object
1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1177 def (node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; if local_attr :menuitem; ; capture do; ; _buf << (" <b class=\"caret\">›</b>"); ; ; end; _buf << ("<span class=\"menuseq\"><b class=\"menu\">"); ; ; _buf << ((attr :menu)); ; yield_capture; ; _buf << ("</b>"); (attr 'submenus').each do ||; ; _buf << ("<b class=\"submenu\">"); ; _buf << (); ; yield_capture; ; _buf << ("</b>"); end; _buf << ("<b class=\"menuitem\">"); _buf << ((local_attr :menuitem)); ; _buf << ("</b></span>"); else; ; _buf << ("<b class=\"menuref\">"); _buf << ((attr :menu)); ; _buf << ("</b>"); end; _buf = _buf.join("") end end |
#inline_quoted(node, opts = {}) ⇒ Object
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1106 def inline_quoted(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; unless id.nil?; ; _buf << ("<a"); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << (" aria-hidden=\"true\"></a>"); ; end; case type; ; when :emphasis; ; _buf << ("<em"); _temple_html_attributeremover1 = []; _slim_codeattributes2 = role; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (">"); _buf << (text); ; _buf << ("</em>"); when :strong; ; _buf << ("<strong"); _temple_html_attributeremover2 = []; _slim_codeattributes3 = role; if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes3.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes3); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover2); _buf << ("\""); end; _buf << (">"); _buf << (text); ; _buf << ("</strong>"); when :monospaced; ; _buf << ("<code"); _temple_html_attributeremover3 = []; _slim_codeattributes4 = role; if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover3 << (_slim_codeattributes4.join(" ")); else; _temple_html_attributeremover3 << (_slim_codeattributes4); end; _temple_html_attributeremover3 = _temple_html_attributeremover3.join(""); if !_temple_html_attributeremover3.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover3); _buf << ("\""); end; _buf << (">"); _buf << (text); ; _buf << ("</code>"); when :superscript; ; _buf << ("<sup"); _temple_html_attributeremover4 = []; _slim_codeattributes5 = role; if Array === _slim_codeattributes5; _slim_codeattributes5 = _slim_codeattributes5.flatten; _slim_codeattributes5.map!(&:to_s); _slim_codeattributes5.reject!(&:empty?); _temple_html_attributeremover4 << (_slim_codeattributes5.join(" ")); else; _temple_html_attributeremover4 << (_slim_codeattributes5); end; _temple_html_attributeremover4 = _temple_html_attributeremover4.join(""); if !_temple_html_attributeremover4.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover4); _buf << ("\""); end; _buf << (">"); _buf << (text); ; _buf << ("</sup>"); when :subscript; ; _buf << ("<sub"); _temple_html_attributeremover5 = []; _slim_codeattributes6 = role; if Array === _slim_codeattributes6; _slim_codeattributes6 = _slim_codeattributes6.flatten; _slim_codeattributes6.map!(&:to_s); _slim_codeattributes6.reject!(&:empty?); _temple_html_attributeremover5 << (_slim_codeattributes6.join(" ")); else; _temple_html_attributeremover5 << (_slim_codeattributes6); end; _temple_html_attributeremover5 = _temple_html_attributeremover5.join(""); if !_temple_html_attributeremover5.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover5); _buf << ("\""); end; _buf << (">"); _buf << (text); ; _buf << ("</sub>"); when :mark; ; _buf << ("<mark"); _temple_html_attributeremover6 = []; _slim_codeattributes7 = role; if Array === _slim_codeattributes7; _slim_codeattributes7 = _slim_codeattributes7.flatten; _slim_codeattributes7.map!(&:to_s); _slim_codeattributes7.reject!(&:empty?); _temple_html_attributeremover6 << (_slim_codeattributes7.join(" ")); else; _temple_html_attributeremover6 << (_slim_codeattributes7); end; _temple_html_attributeremover6 = _temple_html_attributeremover6.join(""); if !_temple_html_attributeremover6.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover6); _buf << ("\""); end; _buf << (">"); _buf << (text); ; _buf << ("</mark>"); when :double; ; _slim_controls1 = html_tag_if role?, :span, :class=>role do; _slim_controls2 = []; ; _slim_controls2 << ((double_quoted text)); ; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); when :single; ; _slim_controls3 = html_tag_if role?, :span, :class=>role do; _slim_controls4 = []; ; _slim_controls4 << ((single_quoted text)); ; _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); when :asciimath, :latexmath; ; _buf << ("<span class=\"math\""); _slim_codeattributes8 = stem_lang; if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" data-lang"); else; _buf << (" data-lang=\""); _buf << (_slim_codeattributes8); _buf << ("\""); end; end; _buf << (">"); _buf << ((delimit_stem text, type)); ; _buf << ("</span>"); else; ; if role == 'line-through' || role == 'del'; ; _buf << ("<del>"); _buf << (text); ; _buf << ("</del>"); else; ; _slim_controls5 = html_tag_if role?, :span, :class=>role do; _slim_controls6 = []; ; _slim_controls6 << (text); ; _slim_controls6 = _slim_controls6.join(""); end; _buf << (_slim_controls5); end; end; _buf = _buf.join("") end end |
#listing(node, opts = {}) ⇒ Object
848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
# File 'lib/asciidoctor/html5s/converter.rb', line 848 def listing(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_caption :top, :class=>'listing-block' do; _slim_controls2 = []; ; if style == 'source'; ; if highlighter == 'html-pipeline'; ; _slim_controls2 << ("<pre><code"); _slim_codeattributes1 = source_lang; if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" data-lang"); else; _slim_controls2 << (" data-lang=\""); _slim_controls2 << (_slim_codeattributes1); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); _slim_controls2 << (content); ; _slim_controls2 << ("</code></pre>"); else; ; unless highlighter == 'CodeRay'; ; code_class = "language-#{source_lang}" if source_lang; ; end; _slim_controls2 << ("<pre"); _temple_html_attributeremover1 = []; _slim_codeattributes2 = [highlighter, 'highlight', ('linenums' if attr? :linenums), nowrap?]; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); 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 << ("><code"); ; _temple_html_attributeremover2 = []; _slim_codeattributes3 = code_class; if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes3.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes3); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover2); _slim_controls2 << ("\""); end; _slim_codeattributes4 = source_lang; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" data-lang"); else; _slim_controls2 << (" data-lang=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); _slim_controls2 << (content); ; _slim_controls2 << ("</code></pre>"); end; else; ; _slim_controls2 << ("<pre"); _temple_html_attributeremover3 = []; _slim_codeattributes5 = nowrap?; if Array === _slim_codeattributes5; _slim_codeattributes5 = _slim_codeattributes5.flatten; _slim_codeattributes5.map!(&:to_s); _slim_codeattributes5.reject!(&:empty?); _temple_html_attributeremover3 << (_slim_codeattributes5.join(" ")); else; _temple_html_attributeremover3 << (_slim_codeattributes5); end; _temple_html_attributeremover3 = _temple_html_attributeremover3.join(""); if !_temple_html_attributeremover3.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover3); _slim_controls2 << ("\""); end; _slim_controls2 << (">"); _slim_controls2 << (content); ; _slim_controls2 << ("</pre>"); ; ; end; if callout_list; ; _slim_controls2 << (converter.convert callout_list, 'colist'); ; end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#literal(node, opts = {}) ⇒ Object
1409 1410 1411 1412 1413 1414 1415 1416 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1409 def literal(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_title :class=>'literal-block' do; _slim_controls2 = []; ; _slim_controls2 << ("<pre"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = nowrap?; 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 << (">"); _slim_controls2 << (content); ; _slim_controls2 << ("</pre>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#olist(node, opts = {}) ⇒ Object
917 918 919 920 921 922 923 924 925 926 |
# File 'lib/asciidoctor/html5s/converter.rb', line 917 def olist(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_title :class=>['olist', style] do; _slim_controls2 = []; ; _slim_controls2 << ("<ol"); _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_codeattributes2 = (attr :start); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" start"); else; _slim_controls2 << (" start=\""); _slim_controls2 << (_slim_codeattributes2); _slim_controls2 << ("\""); end; end; _slim_codeattributes3 = list_marker_keyword; if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" type"); else; _slim_controls2 << (" type=\""); _slim_controls2 << (_slim_codeattributes3); _slim_controls2 << ("\""); end; end; _slim_codeattributes4 = (option? 'reversed'); if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" reversed"); else; _slim_controls2 << (" reversed=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); ; items.each do |item|; ; _slim_controls2 << ("<li>"); _slim_controls2 << ((print_item_content item)); ; _slim_controls2 << ("</li>"); end; _slim_controls2 << ("</ol>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#open(node, opts = {}) ⇒ Object
799 800 801 802 803 804 805 806 807 808 809 810 811 |
# File 'lib/asciidoctor/html5s/converter.rb', line 799 def open(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; if style == 'abstract'; ; if abstract_allowed?; ; _slim_controls1 = block_with_title :class=>'quote-block abstract' do; _slim_controls2 = []; ; _slim_controls2 << ("<blockquote>"); _slim_controls2 << (content); ; _slim_controls2 << ("</blockquote>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); end; elsif style != 'partintro' || partintro_allowed?; ; _slim_controls3 = block_with_title :class=>['open-block', (style if style != 'open')] do; _slim_controls4 = []; ; _slim_controls4 << ("<div class=\"content\">"); _slim_controls4 << (content); ; _slim_controls4 << ("</div>"); _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); end; _buf = _buf.join("") end end |
#outline(node, opts = {}) ⇒ Object
1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1435 def outline(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; unless sections.empty?; ; ; toclevels ||= opts[:toclevels] || (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i; ; slevel = section_level sections.first; ; _buf << ("<ol class=\"toc-list level-"); _buf << (slevel); _buf << ("\">"); ; sections.each do |sec|; ; _buf << ("<li><a href=\"#"); ; _buf << (sec.id); _buf << ("\">"); _buf << (section_title sec); ; _buf << ("</a>"); if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline'); ; _buf << (child_toc); ; end; _buf << ("</li>"); end; _buf << ("</ol>"); end; _buf = _buf.join("") end end |
#page_break(node, opts = {}) ⇒ Object
821 822 823 824 825 826 827 |
# File 'lib/asciidoctor/html5s/converter.rb', line 821 def page_break(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << ("<div role=\"doc-pagebreak\" style=\"page-break-after: always;\"></div>"); ; _buf = _buf.join("") end end |
#paragraph(node, opts = {}) ⇒ Object
870 871 872 873 874 875 876 877 878 879 880 881 |
# File 'lib/asciidoctor/html5s/converter.rb', line 870 def paragraph(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; if title?; ; _buf << ("<section class=\"paragraph\""); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << ("><h6 class=\"block-title\">"); ; _buf << (title); ; _buf << ("</h6><p"); _temple_html_attributeremover1 = []; _slim_codeattributes2 = role; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (">"); _buf << (content); ; _buf << ("</p></section>"); else; ; _buf << ("<p"); _slim_codeattributes3 = id; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _temple_html_attributeremover2 = []; _slim_codeattributes4 = role; 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?; _buf << (" class=\""); _buf << (_temple_html_attributeremover2); _buf << ("\""); end; _buf << (">"); _buf << (content); ; _buf << ("</p>"); end; _buf = _buf.join("") end end |
#pass(node, opts = {}) ⇒ Object
1047 1048 1049 1050 1051 1052 1053 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1047 def pass(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << (content); ; _buf = _buf.join("") end end |
#preamble(node, opts = {}) ⇒ Object
1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1074 def preamble(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << ("<section id=\"preamble\" aria-label=\"Preamble\">"); ; _buf << (content); ; _buf << ("</section>"); if (document.attr? :toc) && (document.attr? 'toc-placement', 'preamble'); ; _buf << ("<nav id=\"toc\""); _temple_html_attributeremover1 = []; _slim_codeattributes1 = (document.attr 'toc-class', 'toc'); 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?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (" role=\"doc-toc\"><h2 id=\"toc-title\">"); ; _buf << ((document.attr 'toc-title')); ; _buf << ("</h2>"); ; _buf << (converter.convert document, 'outline'); ; _buf << ("</nav>"); ; end; _buf = _buf.join("") end end |
#quote(node, opts = {}) ⇒ Object
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1089 def quote(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_title :class=>'quote-block' do; _slim_controls2 = []; ; _slim_controls2 << ("<blockquote>"); ; _slim_controls3 = html_tag_if !blocks?, :p do; _slim_controls4 = []; ; _slim_controls4 << (content); ; _slim_controls4 = _slim_controls4.join(""); end; _slim_controls2 << (_slim_controls3); if attr?(:attribution) || attr?(:citetitle); ; _slim_controls2 << ("<footer>— <cite>"); ; ; ; _slim_controls2 << ([(attr :attribution), (attr :citetitle)].compact.join(', ')); ; _slim_controls2 << ("</cite></footer>"); ; end; _slim_controls2 << ("</blockquote>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#section(node, opts = {}) ⇒ Object
1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1473 def section(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << ("<section"); _temple_html_attributeremover1 = []; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "doc-section"; _temple_html_attributemerger1[1] = []; _slim_codeattributes1 = ["level-#{section_level}", role]; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributemerger1[1] << (_slim_codeattributes1.join(" ")); else; _temple_html_attributemerger1[1] << (_slim_codeattributes1); 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?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (">"); ; _slim_htag_filter1 = ((section_level + 1)).to_s; _buf << ("<h"); _buf << (_slim_htag_filter1); _slim_codeattributes2 = id; if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes2); _buf << ("\""); end; end; _buf << (">"); ; if id; ; if document.attr? :sectanchors; ; _buf << ("<a class=\"anchor\" href=\"#"); _buf << (id); _buf << ("\" aria-hidden=\"true\"></a>"); ; end; if document.attr? :sectlinks; ; _buf << ("<a class=\"link\" href=\"#"); _buf << (id); _buf << ("\">"); _buf << (section_title); ; _buf << ("</a>"); else; ; _buf << (section_title); ; end; else; ; _buf << (section_title); ; end; _buf << ("</h"); _buf << (_slim_htag_filter1); _buf << (">"); _buf << (content); ; _buf << ("</section>"); _buf = _buf.join("") end end |
#sidebar(node, opts = {}) ⇒ Object
1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1398 def (node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << ("<aside"); _temple_html_attributeremover1 = []; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "sidebar"; _temple_html_attributemerger1[1] = []; _slim_codeattributes1 = role; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributemerger1[1] << (_slim_codeattributes1.join(" ")); else; _temple_html_attributemerger1[1] << (_slim_codeattributes1); 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?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _slim_codeattributes2 = id; if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes2); _buf << ("\""); end; end; _buf << (">"); ; if title?; ; _buf << ("<h6 class=\"block-title\">"); _buf << (title); ; _buf << ("</h6>"); end; _buf << (content); ; _buf << ("</aside>"); _buf = _buf.join("") end end |
#stem(node, opts = {}) ⇒ Object
908 909 910 911 912 913 914 915 |
# File 'lib/asciidoctor/html5s/converter.rb', line 908 def stem(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_caption :top, :class=>'stem-block' do; _slim_controls2 = []; ; _slim_controls2 << ("<div class=\"math\""); _slim_codeattributes1 = stem_lang; if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" data-lang"); else; _slim_controls2 << (" data-lang=\""); _slim_controls2 << (_slim_codeattributes1); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); _slim_controls2 << ((delimit_stem content, style)); ; _slim_controls2 << ("</div>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#table(node, opts = {}) ⇒ Object
980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 |
# File 'lib/asciidoctor/html5s/converter.rb', line 980 def table(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_caption :top, :class=>'table-block' do; _slim_controls2 = []; ; ; ; _slim_controls2 << ("<table"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = ["frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", spread?]; 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_codeattributes2 = style_value(width: ("#{attr :tablepcwidth}%" if !autowidth? && !spread? || (local_attr :width)), float: (attr :float)); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" style"); else; _slim_controls2 << (" style=\""); _slim_controls2 << (_slim_codeattributes2); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); ; unless (attr :rowcount).zero?; ; _slim_controls2 << ("<colgroup>"); ; if autowidth?; ; columns.each do; ; _slim_controls2 << ("<col>"); ; end; else; ; columns.each do |col|; ; _slim_controls2 << ("<col style=\"width: "); _slim_controls2 << (col.attr :colpcwidth); _slim_controls2 << ("%;\">"); ; end; end; _slim_controls2 << ("</colgroup>"); [:head, :foot, :body].reject { |tblsec| rows[tblsec].empty? }.each do |tblsec|; ; _slim_controls2 << ("<t"); _slim_controls2 << (tblsec); _slim_controls2 << (">"); ; rows[tblsec].each do |row|; ; _slim_controls2 << ("<tr>"); ; row.each do |cell|; ; _slim_controls3 = html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td', :class=>["halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"], :colspan=>cell.colspan, :rowspan=>cell.rowspan, :style=>style_value(background_color: (document.attr :cellbgcolor))) do; _slim_controls4 = []; ; if tblsec == :head; ; _slim_controls4 << (cell.text); ; else; ; case cell.style; ; when :asciidoc; ; _slim_controls4 << (cell.content); ; when :verse; ; _slim_controls4 << ("<div class=\"verse\"><pre>"); _slim_controls4 << (cell.text); ; _slim_controls4 << ("</pre></div>"); when :literal; ; _slim_controls4 << ("<div class=\"literal\"><pre>"); _slim_controls4 << (cell.text); ; _slim_controls4 << ("</pre></div>"); else; ; if cell.content.one?; ; _slim_controls4 << (cell.content.first); ; else; ; cell.content.each do |text|; ; _slim_controls4 << ("<p>"); _slim_controls4 << (text); ; _slim_controls4 << ("</p>"); end; end; end; end; _slim_controls4 = _slim_controls4.join(""); end; _slim_controls2 << (_slim_controls3); end; _slim_controls2 << ("</tr>"); end; end; end; _slim_controls2 << ("</table>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#thematic_break(node, opts = {}) ⇒ Object
1169 1170 1171 1172 1173 1174 1175 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1169 def thematic_break(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _buf << ("<hr>"); ; _buf = _buf.join("") end end |
#toc(node, opts = {}) ⇒ Object
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1142 def toc(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; ; ; if document.attr?(:toc) && document.sections?; ; toc_id = id || ('toc' if document. || !document.attr?('toc-placement')); ; _buf << ("<nav"); _slim_codeattributes1 = toc_id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes2 = (attr :role, (document.attr 'toc-class', 'toc')); if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (" role=\"doc-toc\">"); ; _slim_htag_filter1 = ((level + 2)).to_s; _buf << ("<h"); _buf << (_slim_htag_filter1); _slim_codeattributes3 = ("#{toc_id}-title" if toc_id); if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _buf << (">"); ; _buf << ((title || (document.attr 'toc-title'))); ; _buf << ("</h"); _buf << (_slim_htag_filter1); _buf << (">"); ; _buf << (converter.convert document, 'outline', :toclevels=>((attr :levels).to_i if attr? :levels)); ; _buf << ("</nav>"); else; ; _buf << ("<!--toc disabled-->"); ; end; _buf = _buf.join("") end end |
#ulist(node, opts = {}) ⇒ Object
1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1340 def ulist(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; checklist = 'task-list' if option? 'checklist'; ; _slim_controls1 = block_with_title :class=>['ulist', style] do; _slim_controls2 = []; ; _slim_controls2 << ("<ul"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = (checklist || 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 << (">"); ; items.each do |item|; ; if checklist && (item.attr? :checkbox); ; _slim_controls2 << ("<li class=\"task-list-item\"><input class=\"task-list-item-checkbox\" type=\"checkbox\" disabled"); ; _slim_codeattributes2 = (item.attr? :checked); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" checked"); else; _slim_controls2 << (" checked=\""); _slim_controls2 << (_slim_codeattributes2); _slim_controls2 << ("\""); end; end; _slim_controls2 << ("> "); ; _slim_controls2 << (item.text); ; _slim_controls2 << ("</li>"); else; ; _slim_controls2 << ("<li>"); ; _slim_controls2 << ((print_item_content item)); ; _slim_controls2 << ("</li>"); end; end; _slim_controls2 << ("</ul>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#verse(node, opts = {}) ⇒ Object
1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1380 def verse(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_title :class=>'verse-block' do; _slim_controls2 = []; ; if attr?(:attribution) || attr?(:citetitle); ; _slim_controls2 << ("<blockquote class=\"verse\"><pre class=\"verse\">"); ; _slim_controls2 << (content); ; _slim_controls2 << ("</pre><footer>— <cite>"); ; ; ; _slim_controls2 << ([(attr :attribution), (attr :citetitle)].compact.join(', ')); ; _slim_controls2 << ("</cite></footer></blockquote>"); ; else; ; _slim_controls2 << ("<pre class=\"verse\">"); _slim_controls2 << (content); ; _slim_controls2 << ("</pre>"); end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |
#video(node, opts = {}) ⇒ Object
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 |
# File 'lib/asciidoctor/html5s/converter.rb', line 1315 def video(node, opts = {}) node.extend(Helpers) node.instance_eval do _buf = []; _slim_controls1 = block_with_caption :bottom, :class=>'video-block' do; _slim_controls2 = []; ; if video_iframe?; ; ; ; ; ; ; _slim_controls2 << ("<iframe"); _slim_codeattributes1 = video_uri; if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" src"); else; _slim_controls2 << (" src=\""); _slim_controls2 << (_slim_codeattributes1); _slim_controls2 << ("\""); end; end; _slim_codeattributes2 = (attr :width); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" width"); else; _slim_controls2 << (" width=\""); _slim_controls2 << (_slim_codeattributes2); _slim_controls2 << ("\""); end; end; _slim_codeattributes3 = (attr :height); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" height"); else; _slim_controls2 << (" height=\""); _slim_controls2 << (_slim_codeattributes3); _slim_controls2 << ("\""); end; end; _slim_codeattributes4 = 0; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" frameborder"); else; _slim_controls2 << (" frameborder=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_codeattributes5 = !(option? 'nofullscreen'); if _slim_codeattributes5; if _slim_codeattributes5 == true; _slim_controls2 << (" allowfullscreen"); else; _slim_controls2 << (" allowfullscreen=\""); _slim_controls2 << (_slim_codeattributes5); _slim_controls2 << ("\""); end; end; _slim_controls2 << ("></iframe>"); ; else; ; ; ; ; ; ; ; ; _slim_controls2 << ("<video"); _slim_codeattributes6 = video_uri; if _slim_codeattributes6; if _slim_codeattributes6 == true; _slim_controls2 << (" src"); else; _slim_controls2 << (" src=\""); _slim_controls2 << (_slim_codeattributes6); _slim_controls2 << ("\""); end; end; _slim_codeattributes7 = (attr :width); if _slim_codeattributes7; if _slim_codeattributes7 == true; _slim_controls2 << (" width"); else; _slim_controls2 << (" width=\""); _slim_controls2 << (_slim_codeattributes7); _slim_controls2 << ("\""); end; end; _slim_codeattributes8 = (attr :height); if _slim_codeattributes8; if _slim_codeattributes8 == true; _slim_controls2 << (" height"); else; _slim_controls2 << (" height=\""); _slim_controls2 << (_slim_codeattributes8); _slim_controls2 << ("\""); end; end; _slim_codeattributes9 = (media_uri(attr :poster) if attr? :poster); if _slim_codeattributes9; if _slim_codeattributes9 == true; _slim_controls2 << (" poster"); else; _slim_controls2 << (" poster=\""); _slim_controls2 << (_slim_codeattributes9); _slim_controls2 << ("\""); end; end; _slim_codeattributes10 = (option? 'autoplay'); if _slim_codeattributes10; if _slim_codeattributes10 == true; _slim_controls2 << (" autoplay"); else; _slim_controls2 << (" autoplay=\""); _slim_controls2 << (_slim_codeattributes10); _slim_controls2 << ("\""); end; end; _slim_codeattributes11 = !(option? 'nocontrols'); if _slim_codeattributes11; if _slim_codeattributes11 == true; _slim_controls2 << (" controls"); else; _slim_controls2 << (" controls=\""); _slim_controls2 << (_slim_codeattributes11); _slim_controls2 << ("\""); end; end; _slim_codeattributes12 = (option? 'loop'); if _slim_codeattributes12; if _slim_codeattributes12 == true; _slim_controls2 << (" loop"); else; _slim_controls2 << (" loop=\""); _slim_controls2 << (_slim_codeattributes12); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">Your browser does not support the video tag.</video>"); ; ; end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("") end end |