asciidoctor-revealjs 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.adoc +46 -0
  3. data/HACKING.adoc +250 -0
  4. data/LICENSE.adoc +22 -0
  5. data/README.adoc +671 -0
  6. data/asciidoctor-revealjs.gemspec +32 -0
  7. data/bin/asciidoctor-revealjs +20 -0
  8. data/lib/asciidoctor-revealjs.rb +2 -0
  9. data/lib/asciidoctor-revealjs/converter.rb +36 -0
  10. data/lib/asciidoctor-revealjs/version.rb +5 -0
  11. data/templates/jade/admonition.jade +17 -0
  12. data/templates/jade/audio.jade +6 -0
  13. data/templates/jade/colist.jade +22 -0
  14. data/templates/jade/dlist.jade +60 -0
  15. data/templates/jade/document.jade +103 -0
  16. data/templates/jade/embedded.jade +11 -0
  17. data/templates/jade/example.jade +4 -0
  18. data/templates/jade/floating_title.jade +2 -0
  19. data/templates/jade/image.jade +12 -0
  20. data/templates/jade/inline_anchor.jade +9 -0
  21. data/templates/jade/inline_break.jade +2 -0
  22. data/templates/jade/inline_button.jade +1 -0
  23. data/templates/jade/inline_callout.jade +9 -0
  24. data/templates/jade/inline_image.jade +24 -0
  25. data/templates/jade/inline_indexterm.jade +2 -0
  26. data/templates/jade/inline_kbd.jade +9 -0
  27. data/templates/jade/inline_quoted.jade +26 -0
  28. data/templates/jade/listing.jade +29 -0
  29. data/templates/jade/literal.jade +5 -0
  30. data/templates/jade/olist.jade +9 -0
  31. data/templates/jade/page_break.jade +1 -0
  32. data/templates/jade/paragraph.jade +7 -0
  33. data/templates/jade/pass.jade +1 -0
  34. data/templates/jade/quote.jade +11 -0
  35. data/templates/jade/ruler.jade +1 -0
  36. data/templates/jade/section.jade +15 -0
  37. data/templates/jade/sidebar.jade +5 -0
  38. data/templates/jade/table.jade +45 -0
  39. data/templates/jade/thematic_break.jade +1 -0
  40. data/templates/jade/ulist.jade +25 -0
  41. data/templates/jade/verse.jade +14 -0
  42. data/templates/jade/video.jade +30 -0
  43. data/templates/slim/block_admonition.html.slim +18 -0
  44. data/templates/slim/block_audio.html.slim +6 -0
  45. data/templates/slim/block_colist.html.slim +20 -0
  46. data/templates/slim/block_dlist.html.slim +53 -0
  47. data/templates/slim/block_example.html.slim +4 -0
  48. data/templates/slim/block_floating_title.html.slim +1 -0
  49. data/templates/slim/block_image.html.slim +21 -0
  50. data/templates/slim/block_listing.html.slim +33 -0
  51. data/templates/slim/block_literal.html.slim +4 -0
  52. data/templates/slim/block_olist.html.slim +9 -0
  53. data/templates/slim/block_open.html.slim +15 -0
  54. data/templates/slim/block_page_break.html.slim +1 -0
  55. data/templates/slim/block_paragraph.html.slim +7 -0
  56. data/templates/slim/block_pass.html.slim +1 -0
  57. data/templates/slim/block_preamble.html.slim +2 -0
  58. data/templates/slim/block_quote.html.slim +14 -0
  59. data/templates/slim/block_ruler.html.slim +1 -0
  60. data/templates/slim/block_sidebar.html.slim +5 -0
  61. data/templates/slim/block_stem.html.slim +10 -0
  62. data/templates/slim/block_table.html.slim +45 -0
  63. data/templates/slim/block_thematic_break.html.slim +1 -0
  64. data/templates/slim/block_toc.html.slim +12 -0
  65. data/templates/slim/block_ulist.html.slim +25 -0
  66. data/templates/slim/block_verse.html.slim +14 -0
  67. data/templates/slim/block_video.html.slim +40 -0
  68. data/templates/slim/document.html.slim +184 -0
  69. data/templates/slim/embedded.html.slim +9 -0
  70. data/templates/slim/helpers.rb +34 -0
  71. data/templates/slim/inline_anchor.html.slim +11 -0
  72. data/templates/slim/inline_break.html.slim +2 -0
  73. data/templates/slim/inline_button.html.slim +1 -0
  74. data/templates/slim/inline_callout.html.slim +7 -0
  75. data/templates/slim/inline_footnote.html.slim +6 -0
  76. data/templates/slim/inline_image.html.slim +24 -0
  77. data/templates/slim/inline_indexterm.html.slim +2 -0
  78. data/templates/slim/inline_kbd.html.slim +8 -0
  79. data/templates/slim/inline_menu.html.slim +15 -0
  80. data/templates/slim/inline_quoted.html.slim +22 -0
  81. data/templates/slim/section.html.slim +89 -0
  82. data/templates/slim/section.html.slim.orig +97 -0
  83. metadata +186 -0
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path '../lib/asciidoctor-revealjs/version', __FILE__
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'asciidoctor-revealjs'
6
+ s.version = Asciidoctor::Revealjs::VERSION
7
+ s.authors = ['Olivier Bilodeau']
8
+ s.email = ['olivier@bottomlesspit.org']
9
+ s.homepage = 'https://github.com/asciidoctor/asciidoctor-reveal.js'
10
+ s.summary = 'Converts AsciiDoc to HTML for a Reveal.js presentation'
11
+ s.description = 'An Asciidoctor converter that generates the HTML component of a Reveal.js presentation from AsciiDoc.'
12
+ s.license = 'MIT'
13
+ s.required_ruby_version = '>= 1.9.3'
14
+
15
+ files = begin
16
+ (result = Open3.popen3('git ls-files -z') {|_, out| out.read }.split %(\0)).empty? ? Dir['**/*'] : result
17
+ rescue
18
+ Dir['**/*']
19
+ end
20
+ s.files = files.grep %r/^(?:(?:lib|templates)\/.+|Gemfile|Rakefile|(?:CHANGELOG|LICENSE|README)\.adoc|#{s.name}\.gemspec)$/
21
+
22
+
23
+ s.executables = ['asciidoctor-revealjs']
24
+ s.extra_rdoc_files = Dir['README.adoc', 'LICENSE.adoc', 'HACKING.adoc']
25
+ s.require_paths = ['lib']
26
+
27
+ s.add_runtime_dependency 'asciidoctor', '~> 1.5.4'
28
+ s.add_runtime_dependency 'slim', '~> 3.0.6'
29
+ s.add_runtime_dependency 'thread_safe', '~> 0.3.5'
30
+
31
+ s.add_development_dependency 'rake', '~> 10.4.2'
32
+ end
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if File.file?(asciidoctor_revealjs = (File.expand_path '../../lib/asciidoctor-revealjs.rb', __FILE__))
4
+ require asciidoctor_revealjs
5
+ else
6
+ require 'asciidoctor-revealjs'
7
+ end
8
+ require 'asciidoctor/cli'
9
+
10
+ options = Asciidoctor::Cli::Options.new backend: 'revealjs'
11
+
12
+ # FIXME (from bespoke) This is a really bizarre API. Please make me simpler.
13
+ if Integer === (result = options.parse! ARGV)
14
+ exit result
15
+ else
16
+ invoker = Asciidoctor::Cli::Invoker.new options
17
+ GC.start
18
+ invoker.invoke!
19
+ exit invoker.code
20
+ end
@@ -0,0 +1,2 @@
1
+ require 'asciidoctor' unless defined? Asciidoctor::Converter
2
+ require_relative 'asciidoctor-revealjs/converter'
@@ -0,0 +1,36 @@
1
+ require 'asciidoctor/converter/html5'
2
+ require 'asciidoctor/converter/composite'
3
+ require 'asciidoctor/converter/template'
4
+
5
+ module Asciidoctor; module Revealjs
6
+
7
+ class Converter < ::Asciidoctor::Converter::CompositeConverter
8
+ ProvidedTemplatesDir = ::File.expand_path '../../../templates', __FILE__
9
+ register_for 'revealjs'
10
+
11
+ def initialize backend, opts = {}
12
+ # merge user templates with provided templates (user wins)
13
+ template_dirs = [ProvidedTemplatesDir]
14
+ if (user_template_dirs = opts[:template_dirs])
15
+ template_dirs += user_template_dirs.map {|d| ::File.expand_path d }
16
+ end
17
+ # Engine Opal means we need to use the Javascript based templates
18
+ if RUBY_ENGINE == 'opal'
19
+ template_engine = 'jade'
20
+ else
21
+ template_engine = 'slim'
22
+ end
23
+ # create the main converter
24
+ template_converter = ::Asciidoctor::Converter::TemplateConverter.new backend,
25
+ template_dirs,
26
+ (opts.merge htmlsyntax: 'html', template_engine: template_engine)
27
+ # create the delegate / fallback converter
28
+ html5_converter = ::Asciidoctor::Converter::Html5Converter.new backend, opts
29
+ # fuse the converters together
30
+ super backend, template_converter, html5_converter
31
+ basebackend 'html'
32
+ htmlsyntax 'html'
33
+ end
34
+ end
35
+
36
+ end; end
@@ -0,0 +1,5 @@
1
+ module Asciidoctor
2
+ module Revealjs
3
+ VERSION = '1.0.0'
4
+ end
5
+ end
@@ -0,0 +1,17 @@
1
+ if node['$has_role?']('aside') || node['$has_role?']('speaker')
2
+ aside.notes !{node.$content()}
3
+ else
4
+ div.admonitionblock(id=node.$id(),class=[node.$attr('name'), node.$role()])
5
+ table
6
+ tr
7
+ td.icon
8
+ if node.document.$attr('icons') == 'font'
9
+ i(class="icon-#{node.$attr('name')}",title=node.$caption())
10
+ else if node.document.$attr('icons', false)
11
+ img(src=node.$icon_uri(node.$attr('name')),alt=node.$caption())
12
+ else
13
+ div.title
14
+ | !{node.$caption()}
15
+ if node.$title() != false
16
+ div.title !{node.$title()}
17
+ | !{node.$content()}
@@ -0,0 +1,6 @@
1
+ div.audioblock(id=node.$id(),class=[node.$style(), node.$role()])
2
+ if node.$title() != false
3
+ div.title !{node.$captioned_title()}
4
+ div.content
5
+ audio(src=node.$media_uri(node.$attr('target')),autoplay=node.$option('autoplay', ""),controls=node.$option('nocontrols', ""),loop=node.$option('loop', ""))
6
+ | "Your browser does not support the audio tag."
@@ -0,0 +1,22 @@
1
+ div.colist(id=node.$id(),class=[node.$style(), node.$role()])
2
+ if node.$title() != false
3
+ div.title !{node.$title()}
4
+ if node.document.$attr("icons", false)
5
+ - font_icons = node.document.$attr("icons") == "font"
6
+ table
7
+ each item,i in node.$items()
8
+ - num = i + 1
9
+ tr
10
+ td
11
+ if font_icons
12
+ i.conum(data-value=num)
13
+ b !{num}
14
+ else
15
+ img(src=node.$icon_uri("callouts/#{num}"),alt=num)
16
+ td !{item.$text()}
17
+ else
18
+ ol
19
+ each item in node.$items()
20
+ li
21
+ p
22
+ | !{item.$text()}
@@ -0,0 +1,60 @@
1
+ if node.$style() == 'qanda'
2
+ div.qlist(id=node.$id(),class=['qanda', node.$role()])
3
+ if node['$title?']()
4
+ .title= node.$title()
5
+ ol
6
+ each item, i in node.$items()
7
+ - questions = item[0]
8
+ - answer = item[1]
9
+ li
10
+ each question in [].concat(questions)
11
+ p
12
+ em= question.$text()
13
+ unless answer['$nil?']()
14
+ if answer['$text?']()
15
+ p= answer.$text()
16
+ if answer['$blocks?']()
17
+ | !{answer.$content()}
18
+ else if node.$style() == 'horizontal'
19
+ .hdlist(id=node.$id(),class=node.$role())
20
+ if node['$title?']()
21
+ .title= node.$title()
22
+ table
23
+ if node['$attr?']('labelwidth') || node['$attr?']('itemwidth')
24
+ colgroup
25
+ col(width=node.$attr('labelwidth'))
26
+ col(width=node.$attr('itemwidth'))
27
+ each item in node.$items()
28
+ - var terms = item[0]
29
+ - var dd = item[1]
30
+ tr
31
+ td(class=['hdlist1', node['$option?']('strong') ? 'strong' : ''])
32
+ - terms = [].concat(terms)
33
+ - last_term = terms.$last()
34
+ each dt in terms
35
+ | !{dt.$text()}
36
+ if dt != last_term
37
+ br
38
+ td.hdlist2
39
+ unless dd['$nil?']()
40
+ if dd['$text?']()
41
+ p= dd.$text()
42
+ if dd['$blocks?']()
43
+ | !{dd.$content()}
44
+ else
45
+ .dlist(id=node.$id(),class=[node.$style(), node.$role()])
46
+ if node['$title?']()
47
+ .title= node.$title()
48
+ dl
49
+ each item in node.$items()
50
+ - terms = item[0]
51
+ - dd = item[1]
52
+ each dt in [].concat(terms)
53
+ dt(class=node.$style() == false ? 'hdlist1' : '')
54
+ | !{dt.$text()}
55
+ unless dd['$nil?']()
56
+ dd
57
+ if dd['$text?']()
58
+ p= dd.$text()
59
+ if dd['$blocks?']()
60
+ | !{dd.$content()}
@@ -0,0 +1,103 @@
1
+ doctype html
2
+ html(lang=node.document.$attr("lang", "en") )
3
+ head
4
+ meta(charset="UTF-8")
5
+ - revealjsdir = node.$attr('revealjsdir', 'reveal.js')
6
+ each key in ["description","keywords","author","copyright"]
7
+ if node.$attr(key, false)
8
+ meta(name=key,content=node.$attr(key))
9
+ title= node.$doctitle()
10
+ meta(content="yes",name="apple-mobile-web-app-capable")
11
+ meta(content="black-translucent",name="apple-mobile-web-app-status-bar-style")
12
+ meta(content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui",name="viewport")
13
+ link(href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css",rel="stylesheet")
14
+ link(href="#{revealjsdir}/css/reveal.css",rel="stylesheet")
15
+ if node.$attr("revealjs_customtheme", false)
16
+ link(rel='stylesheet',href="#{node.$attr('revealjs_customtheme')}",id='theme')
17
+ else
18
+ link(rel='stylesheet',href='#{revealjsdir}/css/theme/serif.css',id='theme')
19
+ link(href="#{revealjsdir}/lib/css/zenburn.css",rel="stylesheet")
20
+ script(src = "http://getfirebug.com/firebug-lite.js#startOpened=false")
21
+ script(type='text/javascript').
22
+ document.write('<link rel="stylesheet" href="#{revealjsdir}/css/print/' + ( window.location.search.match(/print-pdf/gi) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">');
23
+ body
24
+ .reveal
25
+ .slides !{node.$content()}
26
+ script(src = "#{revealjsdir}/lib/js/head.min.js")
27
+ script(src = "#{revealjsdir}/js/reveal.js")
28
+ script(type='text/javascript').
29
+ function initializeReveal() {
30
+ // See https://github.com/hakimel/reveal.js#configuration for a full list of configuration options
31
+ Reveal.initialize({
32
+ // Display controls in the bottom right corner
33
+ controls: #{node.$attr('revealjs_controls', true)},
34
+ // Display a presentation progress bar
35
+ progress: #{node.$attr('revealjs_progress', true) },
36
+ // Display the page number of the current slide
37
+ slideNumber: #{node.$attr('revealjs_slidenumber', true) },
38
+ // Push each slide change to the browser history
39
+ history: #{node.$attr('revealjs_history', true) },
40
+ // Enable keyboard shortcuts for navigation
41
+ keyboard: #{node.$attr('revealjs_keyboard', true) },
42
+ // Enable the slide overview mode
43
+ overview: #{node.$attr('revealjs_overview', true) },
44
+ // Vertical centering of slides
45
+ center: #{node.$attr('revealjs_center', true) },
46
+ // Enables touch navigation on devices with touch input
47
+ touch: #{node.$attr('revealjs_touch', true) },
48
+ // Loop the presentation
49
+ loop: #{node.$attr('revealjs_loop', false) },
50
+ // Change the presentation direction to be RTL
51
+ rtl: #{node.$attr('revealjs_rtl', false) },
52
+ // Turns fragments on and off globally
53
+ fragments: #{node.$attr('revealjs_fragments', true) },
54
+ // Flags if the presentation is running in an embedded mode,
55
+ // i.e. contained within a limited portion of the screen
56
+ embedded: #{node.$attr('revealjs_embedded', false) },
57
+ // Number of milliseconds between automatically proceeding to the
58
+ // next slide, disabled when set to 0, this value can be overwritten
59
+ // by using a data-autoslide attribute on your slides
60
+ autoSlide: #{node.$attr('revealjs_autoslide', 0) },
61
+ // Stop auto-sliding after user input
62
+ autoSlideStoppable: #{node.$attr('revealjs_autoslidestoppable', true) },
63
+ // Enable slide navigation via mouse wheel
64
+ mouseWheel: #{node.$attr('revealjs_mousewheel', true) },
65
+ // Hides the address bar on mobile devices
66
+ hideAddressBar: #{node.$attr('revealjs_hideaddressbar', true) },
67
+ // Opens links in an iframe preview overlay
68
+ previewLinks: #{node.$attr('revealjs_previewlinks', false) },
69
+ // Theme (e.g., beige, blond, default, moon, night, serif, simple, sky, solarized)
70
+ theme: Reveal.getQueryHash().theme || '#{node.$attr('revealjs_theme', 'serif') }',
71
+ // Transition style (e.g., default, cube, page, concave, zoom, linear, fade, none)
72
+ transition: Reveal.getQueryHash().transition || '#{node.$attr('revealjs_transition', 'default') }',
73
+ // Transition speed (e.g., default, fast, slow)
74
+ transitionSpeed: '#{node.$attr('revealjs_transitionspeed', 'default') }',
75
+ // Transition style for full page slide backgrounds (e.g., default, none, slide, concave, convex, zoom)
76
+ backgroundTransition: '#{node.$attr('revealjs_backgroundtransition', 'default') }',
77
+ // Number of slides away from the current that are visible
78
+ viewDistance: #{node.$attr('revealjs_viewdistance', 3)},
79
+ // Parallax background image (e.g., "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'")
80
+ parallaxBackgroundImage: '#{node.$attr('revealjs_parallaxbackgroundimage', '') }',
81
+ // Parallax background size in CSS syntax (e.g., "2100px 900px")
82
+ parallaxBackgroundSize: '#{node.$attr('revealjs_parallaxbackgroundsize', '') }',
83
+ // Optional libraries used to extend on reveal.js
84
+ dependencies: [
85
+ {
86
+ src: '#{revealjsdir}/lib/js/classList.js',
87
+ condition: function () { return !document.body.classList; }
88
+ },
89
+ #{(node.$attr('source-highlighter') == 'highlight.js') ? "{ src: '#{revealjsdir}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }," : ""}
90
+ {
91
+ src: '#{revealjsdir}/plugin/zoom-js/zoom.js',
92
+ async: true,
93
+ condition: function () { return !!document.body.classList; }
94
+ },
95
+ {
96
+ src: '#{revealjsdir}/plugin/notes/notes.js',
97
+ async: true,
98
+ condition: function () { return !!document.body.classList; }
99
+ }
100
+ ]
101
+ });
102
+ }
103
+ initializeReveal();
@@ -0,0 +1,11 @@
1
+ unless node.$notitle() || !node['$has_header?']()
2
+ h1(id=node.$id()) !{node.$header().$title()}
3
+ | !{node.$content()}
4
+ unless !node['$footnotes?']() || node['$attr?']('nofootnotes')
5
+ div(id='footnotes')
6
+ hr
7
+ each fn in node.$footnotes()
8
+ div.footnote(id='_footnote_' + fn.$index())
9
+ a(href='#_footnoteref_' + fn.$index())
10
+ | !{fn.$index()}
11
+ | !{fn.$text()}
@@ -0,0 +1,4 @@
1
+ div.exampleblock(id=node.$id(),class=node.$role())
2
+ if node.$title() != false
3
+ div.title !{node.$captioned_title()}
4
+ div.content !{node.$content()}
@@ -0,0 +1,2 @@
1
+ - levelPlusOne = level + 1
2
+ #{"h#{levelPlusOne}"}(id=node.$id(),class=[node.$style(), node.$role()]) !{node.$title()}
@@ -0,0 +1,12 @@
1
+ div.imageblock(id=node.$id(),class=["#{node.$style()}", "#{node.$role()}"],style={
2
+ "text-align": node.$attr('align'),
3
+ float: node.$attr('float') ? "float: #{node.$attr('float')}" : ''
4
+ })
5
+ .content
6
+ if node.$attr('link', false)
7
+ a.image(href=node.$attr('link'))
8
+ img(src=node.$image_uri(node.$attr('target')),alt=node.$attr('alt'),width=node.$attr('width'),height=node.$attr('height'),style=[node.$attr('background') ? "background: #{node.$attr('background')}" : ""])
9
+ else
10
+ img(src=node.$image_uri(node.$attr('target')),alt=node.$attr('alt'),width=node.$attr('width'),height=node.$attr('height'),style=[node.$attr('background') ? "background: #{node.$attr('background')}" : ""])
11
+ if node.$title() != false
12
+ .title !{node.$captioned_title()}
@@ -0,0 +1,9 @@
1
+ case node.$type()
2
+ when "xref"
3
+ a(href=node.$target()) !{node.$text()}
4
+ when "ref"
5
+ a(id=node.$target())
6
+ when "bibref"
7
+ a(id=node.$target())
8
+ default
9
+ a(href=node.$target(),class=node.$role(),target=node.$attr('window')) !{node.$text()}
@@ -0,0 +1,2 @@
1
+ | !{node.$text()}
2
+ br
@@ -0,0 +1 @@
1
+ b.button !{node.$text()}
@@ -0,0 +1,9 @@
1
+ if node.document.$attr("icons") == "font"
2
+ - num = "(" + node.$text() + ")"
3
+ i.conum(data-value=node.$text())
4
+ b !{num}
5
+ else if node.document.$attr("icons", false)
6
+ img(src=node.$icon_uri("callouts/#{node.$text()}"),alt=node.$text())
7
+ else
8
+ - num = "(" + node.$text() + ")"
9
+ b !{num}
@@ -0,0 +1,24 @@
1
+ span(class=[node.$type(), node.$role()],style=node.$attr('float', ''))
2
+ if node.$type() == 'icon' && node.document.$attr('icons') == 'font'
3
+ - style_class = ["fa fa-" + node.$target()]
4
+ - style_class.push(node['$attr?']('size') ? 'fa-' + node.$attr('size'): '');
5
+ - style_class.push(node['$attr?']('rotate') ? 'fa-rotate-' + node.$attr('rotate'): '');
6
+ - style_class.push(node['$attr?']('flip') ? 'fa-flip-' + node.$attr('flip'): '');
7
+ if node['$attr?']('link')
8
+ a.image(href=node.$attr('link'),target=node.$attr('window'))
9
+ i(class=[style_class],title=node.$attr('title'))
10
+ else
11
+ i(class=[style_class],title=node.$attr('title'))
12
+ else if node.$type() == 'icon' && !node.document['$attr?']('icons')
13
+ if node['$attr?']('link')
14
+ a.image(href=node.$attr('link'),target=node.$attr('window'))
15
+ | [#{node.$attr('alt')}]
16
+ else
17
+ | [#{node.$attr('alt')}]
18
+ else
19
+ - src = node.$type() == 'icon' ? node.$icon_uri(node.$target()) : node.$image_uri(node.$target())
20
+ if node['$attr?']('link')
21
+ a.image(href=node.$attr('link'),target=node.$attr('window'))
22
+ img(src=src,alt=node.$attr('link'),width=node.$attr('width'),height=node.$attr('height'),title=node.$attr('title'))
23
+ else
24
+ img(src=src,alt=node.$attr('link'),width=node.$attr('width'),height=node.$attr('height'),title=node.$attr('title'))
@@ -0,0 +1,2 @@
1
+ if node.$type() == "visible"
2
+ = !{node.$text()}
@@ -0,0 +1,9 @@
1
+ - var keys = node.$attr('keys')
2
+ if keys.length == 1
3
+ kbd !{keys.$first()}
4
+ else
5
+ kbd.keyseq
6
+ each key,idx in keys
7
+ if !idx['$zero?']()
8
+ | +
9
+ kbd !{key}
@@ -0,0 +1,26 @@
1
+ case node.$type()
2
+ when "emphasis"
3
+ em(class=node.$role()) !{node.$text()}
4
+ when "strong"
5
+ strong(class=node.$role()) !{node.$text()}
6
+ when "monospaced"
7
+ code(class=node.$role()) !{node.$text()}
8
+ when "superscript"
9
+ sup(class=node.$role()) !{node.$text()}
10
+ when "subscript"
11
+ sub(class=node.$role()) !{node.$text()}
12
+ when "double"
13
+ if node.$role() != false
14
+ span(class=node.$role()) &#8220;!{node.$text()}&#8221;
15
+ else
16
+ | &#8220;!{node.$text()}&#8221;
17
+ when "single"
18
+ if node.$role() != false
19
+ span(class=node.$role()) &#8216;!{node.$text()}&#8217;
20
+ else
21
+ | &#8216;!{node.$text()}&#8217;
22
+ default
23
+ if node.$role() != false
24
+ span(class=node.$role()) !{node.$text()}
25
+ else
26
+ | !{node.$text()}