Class: Vimdeck::Render

Inherits:
Redcarpet::Render::Base
  • Object
show all
Defined in:
lib/vimdeck.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#block_code(code, language) ⇒ Object



85
86
87
# File 'lib/vimdeck.rb', line 85

def block_code(code, language)
  "```#{language}\n#{code}\n```"
end

#header(title, level) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/vimdeck.rb', line 63

def header(title, level)
  if !Vimdeck::Slideshow.options[:no_ascii]
    case level
    when 1
      Vimdeck::Ascii.header(title, "large") + "\n"

    when 2
      Vimdeck::Ascii.header(title, "small") + "\n"
    end
  else
    title + "\n\n"
  end
end

#image(image, title, alt_text) ⇒ Object



89
90
91
# File 'lib/vimdeck.rb', line 89

def image(image, title, alt_text)
  Vimdeck::Ascii.image(image)
end


77
78
79
# File 'lib/vimdeck.rb', line 77

def link(link, title, content)
  content
end

#list(content, type) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/vimdeck.rb', line 55

def list(content, type)
  if type == :unordered
    "<!~#{content}~!>"
  else
    "<@~#{content}~@>"
  end
end

#paragraph(text) ⇒ Object



81
82
83
# File 'lib/vimdeck.rb', line 81

def paragraph(text)
  text + "\n\n"
end