class Vimdeck::Render

Custom Redcarpet renderer handles headers and images Code blocks are ignored by the renderer because they have to be measured for the vimscript, so parsing of the fenced code blocks happens in the slideshow generator itself

Public Instance Methods

block_code(code, language) click to toggle source
# File lib/vimdeck.rb, line 122
def block_code(code, language)
  "```#{language}#{$nl}#{code}#{$nl}```"
end
code_span(text) click to toggle source
# File lib/vimdeck.rb, line 65
def code_span(text)
  return "`#{text}`"
end
double_emphasis(text) click to toggle source
# File lib/vimdeck.rb, line 73
def double_emphasis(text)
  return "**#{text}**"
end
emphasis(text) click to toggle source
# File lib/vimdeck.rb, line 69
def emphasis(text)
  return "*#{text}*"
end
header(title, level) click to toggle source
# File lib/vimdeck.rb, line 89
def header(title, level)
  margin = Vimdeck::Slideshow.options[:header_margin]
  linebreak = margin ? "#{$nl}" * margin : "#{$nl}"
  if !Vimdeck::Slideshow.options[:no_ascii]
    case level
    when 1
      heading = Vimdeck::Ascii.header(title, "large")
      if Vimdeck::Slideshow.options[:no_indent]
        heading = "    " + heading.gsub( /\r\n?|\n/, "#{$nl}    " ) + linebreak
      else
        heading + linebreak
      end
    when 2
      heading = Vimdeck::Ascii.header(title, "small")
      if Vimdeck::Slideshow.options[:no_indent]
        heading = "    " + heading.gsub( /\r\n?|\n/, "#{$nl}    " ) + linebreak
      else
        heading + linebreak
      end
    end
  else
    title + "#{$nl}#{$nl}"
  end
end
image(image, title, alt_text) click to toggle source
# File lib/vimdeck.rb, line 126
def image(image, title, alt_text)
  Vimdeck::Ascii.image(image)
end
list(content, type) click to toggle source
# File lib/vimdeck.rb, line 81
def list(content, type)
  if type == :unordered
    "<!~#{content}~!>#{$nl}#{$nl}"
  else
    "<@~#{content}~@>#{$nl}#{$nl}"
  end
end
paragraph(text) click to toggle source
# File lib/vimdeck.rb, line 118
def paragraph(text)
  text + "#{$nl}#{$nl}"
end
triple_emphasis(text) click to toggle source
# File lib/vimdeck.rb, line 77
def triple_emphasis(text)
  return "***#{text}***"
end