asciidoctor-revealjs 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +40 -9
  3. data/Gemfile +4 -0
  4. data/HACKING.adoc +104 -39
  5. data/LICENSE.adoc +1 -1
  6. data/README.adoc +57 -27
  7. data/Rakefile +114 -0
  8. data/asciidoctor-revealjs.gemspec +13 -4
  9. data/examples/README.adoc +17 -0
  10. data/examples/admonitions-icons.adoc +37 -0
  11. data/examples/admonitions.adoc +38 -0
  12. data/examples/concealed-slide-titles.adoc +20 -0
  13. data/examples/customcss.adoc +9 -0
  14. data/examples/customcss.css +8 -0
  15. data/examples/data-background-newstyle.adoc +63 -0
  16. data/examples/data-background-oldstyle.adoc +44 -0
  17. data/examples/history-regression-tests.adoc +34 -0
  18. data/examples/history.adoc +19 -0
  19. data/examples/images.adoc +19 -0
  20. data/examples/images/70s.jpg +0 -0
  21. data/examples/images/bio.jpg +0 -0
  22. data/examples/images/cover.jpg +0 -0
  23. data/examples/images/meme-2.jpg +0 -0
  24. data/examples/images/meme-7.png +0 -0
  25. data/examples/images/web_surfing_time.gif +0 -0
  26. data/examples/keyboard-shortcuts.adoc +24 -0
  27. data/examples/level-sections.adoc +44 -0
  28. data/examples/multi-destination-content.adoc +66 -0
  29. data/examples/revealjs-stretch.adoc +22 -0
  30. data/examples/slide-state.adoc +18 -0
  31. data/examples/slide-state.css +6 -0
  32. data/examples/source-callouts.adoc +20 -0
  33. data/examples/speaker-notes.adoc +21 -0
  34. data/examples/theme-custom.adoc +33 -0
  35. data/examples/theme-custom.css +33 -0
  36. data/examples/title-preamble.adoc +10 -0
  37. data/examples/title-slide-color.adoc +10 -0
  38. data/examples/title-slide-image.adoc +13 -0
  39. data/examples/title-slide-video.adoc +13 -0
  40. data/examples/title-subtitle-partitioning.adoc +7 -0
  41. data/examples/transitions.adoc +20 -0
  42. data/examples/vertical-slides.adoc +24 -0
  43. data/examples/video.adoc +32 -0
  44. data/lib/asciidoctor-revealjs.rb +1 -1
  45. data/lib/asciidoctor-revealjs/version.rb +1 -1
  46. data/lib/asciidoctor-templates-compiler.rb +11 -0
  47. data/templates/{slim/block_admonition.html.slim → admonition.html.slim} +2 -2
  48. data/templates/{slim/block_audio.html.slim → audio.html.slim} +0 -0
  49. data/templates/{slim/block_colist.html.slim → colist.html.slim} +0 -0
  50. data/templates/{slim/block_dlist.html.slim → dlist.html.slim} +0 -0
  51. data/templates/{slim/document.html.slim → document.html.slim} +25 -5
  52. data/templates/{slim/embedded.html.slim → embedded.html.slim} +0 -0
  53. data/templates/{slim/block_example.html.slim → example.html.slim} +0 -0
  54. data/templates/floating_title.html.slim +2 -0
  55. data/templates/helpers.rb +99 -0
  56. data/templates/{slim/block_image.html.slim → image.html.slim} +1 -1
  57. data/templates/{slim/inline_anchor.html.slim → inline_anchor.html.slim} +0 -0
  58. data/templates/{slim/inline_break.html.slim → inline_break.html.slim} +0 -0
  59. data/templates/{slim/inline_button.html.slim → inline_button.html.slim} +0 -0
  60. data/templates/{slim/inline_callout.html.slim → inline_callout.html.slim} +0 -0
  61. data/templates/{slim/inline_footnote.html.slim → inline_footnote.html.slim} +0 -0
  62. data/templates/{slim/inline_image.html.slim → inline_image.html.slim} +0 -0
  63. data/templates/{slim/inline_indexterm.html.slim → inline_indexterm.html.slim} +0 -0
  64. data/templates/{slim/inline_kbd.html.slim → inline_kbd.html.slim} +0 -0
  65. data/templates/{slim/inline_menu.html.slim → inline_menu.html.slim} +0 -0
  66. data/templates/{slim/inline_quoted.html.slim → inline_quoted.html.slim} +0 -0
  67. data/templates/{slim/block_listing.html.slim → listing.html.slim} +1 -1
  68. data/templates/{slim/block_literal.html.slim → literal.html.slim} +0 -0
  69. data/templates/{slim/block_olist.html.slim → olist.html.slim} +0 -0
  70. data/templates/{slim/block_open.html.slim → open.html.slim} +0 -0
  71. data/templates/outline.html.slim +9 -0
  72. data/templates/{slim/block_page_break.html.slim → page_break.html.slim} +0 -0
  73. data/templates/{slim/block_paragraph.html.slim → paragraph.html.slim} +0 -0
  74. data/templates/{slim/block_pass.html.slim → pass.html.slim} +0 -0
  75. data/templates/{slim/block_preamble.html.slim → preamble.html.slim} +0 -0
  76. data/templates/{slim/block_quote.html.slim → quote.html.slim} +0 -0
  77. data/templates/{jade/ruler.jade → ruler.html.slim} +0 -0
  78. data/templates/{slim/section.html.slim → section.html.slim} +8 -5
  79. data/templates/{slim/block_sidebar.html.slim → sidebar.html.slim} +0 -0
  80. data/templates/{slim/block_stem.html.slim → stem.html.slim} +0 -0
  81. data/templates/{slim/block_table.html.slim → table.html.slim} +5 -3
  82. data/templates/{jade/thematic_break.jade → thematic_break.html.slim} +0 -0
  83. data/templates/toc.html.slim +17 -0
  84. data/templates/{slim/block_ulist.html.slim → ulist.html.slim} +0 -0
  85. data/templates/{slim/block_verse.html.slim → verse.html.slim} +0 -0
  86. data/templates/{slim/block_video.html.slim → video.html.slim} +0 -0
  87. metadata +179 -89
  88. data/lib/asciidoctor-revealjs/converter.rb +0 -38
  89. data/templates/jade/admonition.jade +0 -17
  90. data/templates/jade/audio.jade +0 -6
  91. data/templates/jade/colist.jade +0 -22
  92. data/templates/jade/dlist.jade +0 -60
  93. data/templates/jade/document.jade +0 -103
  94. data/templates/jade/embedded.jade +0 -11
  95. data/templates/jade/example.jade +0 -4
  96. data/templates/jade/floating_title.jade +0 -2
  97. data/templates/jade/image.jade +0 -12
  98. data/templates/jade/inline_anchor.jade +0 -9
  99. data/templates/jade/inline_break.jade +0 -2
  100. data/templates/jade/inline_button.jade +0 -1
  101. data/templates/jade/inline_callout.jade +0 -9
  102. data/templates/jade/inline_image.jade +0 -24
  103. data/templates/jade/inline_indexterm.jade +0 -2
  104. data/templates/jade/inline_kbd.jade +0 -9
  105. data/templates/jade/inline_quoted.jade +0 -26
  106. data/templates/jade/listing.jade +0 -29
  107. data/templates/jade/literal.jade +0 -5
  108. data/templates/jade/olist.jade +0 -9
  109. data/templates/jade/page_break.jade +0 -1
  110. data/templates/jade/paragraph.jade +0 -7
  111. data/templates/jade/pass.jade +0 -1
  112. data/templates/jade/quote.jade +0 -11
  113. data/templates/jade/section.jade +0 -15
  114. data/templates/jade/sidebar.jade +0 -5
  115. data/templates/jade/table.jade +0 -45
  116. data/templates/jade/ulist.jade +0 -25
  117. data/templates/jade/verse.jade +0 -14
  118. data/templates/jade/video.jade +0 -30
  119. data/templates/slim/block_floating_title.html.slim +0 -1
  120. data/templates/slim/block_ruler.html.slim +0 -1
  121. data/templates/slim/block_thematic_break.html.slim +0 -1
  122. data/templates/slim/block_toc.html.slim +0 -12
  123. data/templates/slim/helpers.rb +0 -38
@@ -1,7 +0,0 @@
1
- div.paragraph(id=node.$id(),class=node.$role())
2
- if node.$title() != false
3
- div(class="title") !{node.$title()}
4
- if node['$has_role?']('small')
5
- small !{node.$content()}
6
- else
7
- p !{node.$content()}
@@ -1 +0,0 @@
1
- div !{node.$content()}
@@ -1,11 +0,0 @@
1
- div.quoteblock(id=node.$id(),class=node.$role())
2
- if node['$title?']()
3
- div.title !{node.$title()}
4
- blockquote !{node.$content()}
5
- if node.$attr("attribution", false) || node.$attr("citetitle", false)
6
- div.attribution
7
- if node.$attr("citetitle", false)
8
- cite !{node.$attr("citetitle")}
9
- if node.$attr("attribution", false) && node.$attr("citetitle", false)
10
- br
11
- | — !{node.$attr("attribution", "")}
@@ -1,15 +0,0 @@
1
- - hide_title = false
2
- if node.$level() == 1
3
- section
4
- section(id=node.$id(),data-transition=node.$attr("data-transition", ""),data-transition-speed=node.$attr("data-transition-speed", ""),data-background=node.$attr("data-background", ""),data-background-size=node.$attr("data-background-size", ""),data-background-repeat=node.$attr("data-background-repeat", ""),data-background-transition=node.$attr("data-background-transition", ""))
5
- if !hide_title
6
- h2 !{node.$title()}
7
- each block in (node.$blocks()['$-'](node.$sections()))
8
- | !{block["$convert"]()}
9
- each subsection in node.$sections()
10
- | !{subsection["$convert"]()}
11
- else
12
- section(id=node.$id(),data-transition=(node.$attr('data-transition', "")),data-transition-speed=(node.$attr('data-transition-speed', "")),data-background=(node.$attr('data-background', "")),data-background-size=(node.$attr('data-background-size', "")),data-background-repeat=(node.$attr('data-background-repeat', "")),data-background-transition=(node.$attr('data-background-transition', "")))
13
- if !hide_title
14
- h2 !{node.$title()}
15
- | !{node.$content()}
@@ -1,5 +0,0 @@
1
- .sidebarblock(id=node.$id(),class=node.$role())
2
- .content
3
- if node.$title() != false
4
- .title !{node.$title()}
5
- | !{node.$content()}
@@ -1,45 +0,0 @@
1
- table(id=node.$id(),class=["table-block", "frame-#{ node.$attr('frame', 'all') }", "frame-#{ node.$attr('grid', 'all') }", node.$role()])
2
- if node['$title?']()
3
- caption.title !{node.$captioned_title()}
4
- if node.$attr("rowcount") != 0
5
- colgroup
6
- if node['$option?']('autowidth')
7
- each ccc in node.$columns()
8
- col
9
- else
10
- each col in node.$columns()
11
- col(style={width: col.$attr("colpcwidth")})
12
- - tblsecs =["$head","$foot","$body"]
13
- each tblsec in tblsecs
14
- if node.$rows()[tblsec]().length != 0
15
- - var tag = "t" + tblsec.substr(1);
16
- #{tag}
17
- each row in node.$rows()[tblsec]()
18
- tr
19
- each cell in row
20
- if tblsec == "$head"
21
- - cell_content = cell.$text()
22
- else
23
- if cell.$style() == "verse" || cell.$style() == "literal"
24
- - cell_content = cell.$text()
25
- else
26
- - cell_content = cell.$content()
27
- #{tblsec == "$head" ? "th" : "td"}(class=['tableblock', "halign-#{cell.$attr('halign')}", "valign-#{cell.$attr('valign')}"],
28
- colspan=cell.$colspan(), rowspan=cell.$rowspan(),style=node.document.$attr("cellbgcolor", false) ? "background-color:#{node.document.$attr('cellbgcolor')}" : "")
29
- if tblsec == "$head"
30
- | !{cell_content}
31
- else
32
- case cell.$style()
33
- when "asciidoc"
34
- div !{cell_content}
35
- when "verse"
36
- div.verse !{cell_content}
37
- when "literal"
38
- div.literal
39
- pre !{cell_content}
40
- when "header"
41
- each text in cell_content
42
- p.tableblock.header !{text}
43
- default
44
- each text in cell_content
45
- p.tableblock !{text}
@@ -1,25 +0,0 @@
1
- - checklist = node['$option?']('checklist') ? "checklist": null;
2
- if checklist
3
- if node['$option?']('interactive')
4
- - marker_checked = '<input type="checkbox" data-item-complete="1" checked>'
5
- - marker_unchecked = '<input type="checkbox" data-item-complete="0">'
6
- else
7
- if node.document.$attr("icons") == "font"
8
- - marker_checked = '<i class="icon-check"></i>'
9
- - marker_unchecked = '<i class="icon-check-empty"></i>'
10
- else
11
- - marker_checked = '<input type="checkbox" data-item-complete="1" checked disabled>'
12
- - marker_unchecked = '<input type="checkbox" data-item-complete="0" disabled>'
13
- div.ulist(id=id,class=[checklist, node.$style(), node.$role()])
14
- if node['$title?']()
15
- div.title !{node.$title()}
16
- ul(class=[checklist || node.$style()])
17
- each item in node.$items()
18
- li(class=[(node['$option?']('step') || node['$has_role?']('step')) ? "fragment" : ""])
19
- p
20
- if checklist && item.$attr('checkbox', false)
21
- | !{item.$attr('checked') ? marker_checked : marker_unchecked}!{item.$text()}
22
- else
23
- | !{item.$text()}
24
- if item['$blocks?']()
25
- | !{item.$content()}
@@ -1,14 +0,0 @@
1
- div.verseblock(id=node.$id(),class=node.$role())
2
- if node['$title()']
3
- div.title !{node.$title()}
4
- pre.content !{node.$content()}
5
- - attribution = node.$attr('attribution',null)
6
- - citetitle = node.$attr('citetitle',null)
7
- if attribution || citetitle
8
- div.attribution
9
- if citetitle
10
- cite !{citetitle}
11
- if attribution
12
- if citetitle
13
- br
14
- | &#8212; #{attribution}
@@ -1,30 +0,0 @@
1
- div.videoblock(id=node.$id(),class=[node.$style(), node.$role()])
2
- if node['$title?']()
3
- .title node.$captioned_title()
4
- .content
5
- case node.$attr('poster')
6
- when "vimeo"
7
- - start_anchor = node['$attr?']('start') ? "#at=" + node.$attr("start") : ''
8
- - delimeter = "?"
9
- - autoplay_param = node['$option?']('autoplay') ? delimeter + "autoplay=1" : ''
10
- - delimeter = node['$option?']('autoplay') ? '&' : ''
11
- - loop_param = node['$option?']('loop') ? delimeter + "loop=1" : ''
12
- - src = "//player.vimeo.com/video/" + node.$attr('target') + start_anchor + autoplay_param + loop_param
13
- iframe(width=node.$attr('width'),height=node.$attr('height'),src=src,frameborder=0,webkitAllowFullScreen=true,mozallowfullscreen=true,allowFullScreen=true)
14
- when "youtube"
15
- - amp = '&'
16
- - params = ['rel=0']
17
- - params.push(node.$attr('start', false) ? (amp + "start=" + node.$attr('start')) : "")
18
- - params.push(node.$attr('end', false) ? (amp + "end=" + node.$attr('end')) : "")
19
- - params.push(node['$option?']('autoplay') ? amp + "autoplay=1" : "")
20
- - params.push(node['$option?']('loop') ? (amp + "loop=1") : "")
21
- - params.push(node['$option?']('nocontrols') ? (amp + "controls=0") : "")
22
- - src = "//www.youtube.com/embed/" + node.$attr('target') + "/?" + params.join('')
23
- iframe(width=node.$attr('width'),height=node.$attr('height'),src=src,frameborder=0,allowfullscreen=!node['$option?']('nofullscreen'))
24
- default
25
- video(src=node.$media_uri(node.$attr('target')),width=node.$attr('width'),height=node.$attr('height'),
26
- poster=node.$attr('poster', false) ? node.$media_uri(node.$attr('poster')) : '',
27
- autoplay=node['$option?']('autoplay'),controls=!node['$option?']('nocontrols'),
28
- loop=node['$option?']('loop'))
29
- | Your browser does not support the video tag.
30
-
@@ -1 +0,0 @@
1
- *{:tag=>"h#{@level + 1}", :id=>@id, :class=>[@style,role].compact} =title
@@ -1 +0,0 @@
1
- hr
@@ -1,12 +0,0 @@
1
- - if @document.attr? :toc
2
- - toc_id = @id
3
- - toc_role = (attr 'role', (@document.attr 'toc-class', 'toc'))
4
- - toc_title_id = nil
5
- - toc_title = title? ? title : (@document.attr 'toc-title')
6
- - toc_levels = (attr? :levels) ? (attr :levels).to_i : (@document.attr :toclevels, 2).to_i
7
- - if !toc_id && (@document.embedded? || !(@document.attr? 'toc-placement'))
8
- - toc_id = 'toc'
9
- - toc_title_id = 'toctitle'
10
- div id=toc_id class=toc_role
11
- .title id=toc_title_id =toc_title
12
- =Asciidoctor::HTML5::DocumentTemplate.outline(@document, toc_levels)
@@ -1,38 +0,0 @@
1
- # This helper file borrows from the Bespoke converter
2
- # https://github.com/asciidoctor/asciidoctor-bespoke
3
- require 'asciidoctor'
4
- require 'json'
5
-
6
- if Gem::Version.new(Asciidoctor::VERSION) <= Gem::Version.new('1.5.3')
7
- fail 'asciidoctor: FAILED: reveal.js backend needs Asciidoctor >=1.5.4!'
8
- end
9
-
10
- unless defined? Slim::Include
11
- fail 'asciidoctor: FAILED: reveal.js backend needs Slim >= 2.1.0!'
12
- end
13
-
14
- # This module gets mixed in to every node (the context of the template) at the
15
- # time the node is being converted. The properties and methods in this module
16
- # effectively become direct members of the template.
17
- module Slim::Helpers
18
-
19
- EOL = %(\n)
20
- SliceHintRx = / +/
21
-
22
- def slice_text str, active = nil
23
- if (active || (active.nil? && (option? :slice))) && (str.include? ' ')
24
- (str.split SliceHintRx).map {|line| %(<span class="line">#{line}</span>) }.join EOL
25
- else
26
- str
27
- end
28
- end
29
-
30
- def to_boolean val
31
- val && val != 'false' && val.to_s != '0' || false
32
- end
33
-
34
- end
35
-
36
- # More custom functions can be added in another namespace if required
37
- #module Helpers
38
- #end