Class: Redcarpet::Render::Hiki

Inherits:
Base
  • Object
show all
Defined in:
lib/redcarpet/render/hiki.rb,
lib/redcarpet/render/hiki/version.rb

Constant Summary collapse

VERSION =
"0.0.3"

Instance Method Summary collapse

Instance Method Details

#block_code(code, language) ⇒ Object

Block-level calls



7
8
9
# File 'lib/redcarpet/render/hiki.rb', line 7

def block_code(code, language)
  "<<<#{$/}#{code}>>>#{$/*2}"
end

#block_quote(quote) ⇒ Object



11
12
13
# File 'lib/redcarpet/render/hiki.rb', line 11

def block_quote(quote)
  quote.chomp.lines.map {|line| %(""#{line}) }.join + $/
end

#double_emphasis(text) ⇒ Object

Span-level calls



41
42
43
44
# File 'lib/redcarpet/render/hiki.rb', line 41

def double_emphasis(text)
  # FIXME escape '
  "'''#{text}'''"
end

#emphasis(text) ⇒ Object



46
47
48
49
# File 'lib/redcarpet/render/hiki.rb', line 46

def emphasis(text)
  # FIXME escape '
  "''#{text}''"
end

#header(text, header_level) ⇒ Object



15
16
17
18
# File 'lib/redcarpet/render/hiki.rb', line 15

def header(text, header_level)
  # FIXME escape !
  "#{?!*header_level}#{text}#{$/*2}"
end

#hruleObject



20
21
22
# File 'lib/redcarpet/render/hiki.rb', line 20

def hrule
  '-' * 4 + $/ * 2
end

#image(link, title, alt_text) ⇒ Object



51
52
53
54
# File 'lib/redcarpet/render/hiki.rb', line 51

def image(link, title, alt_text)
  # FIXME I don't care about title
  "[[#{alt_text}|#{link}]]"
end


56
57
58
59
# File 'lib/redcarpet/render/hiki.rb', line 56

def link(link, title, content)
  # FIXME I don't care about title
  "[[#{content}|#{link}]]"
end

#list(contents, list_type) ⇒ Object



24
25
26
27
28
29
# File 'lib/redcarpet/render/hiki.rb', line 24

def list(contents, list_type)
  l = list_type == :unordered ? '*' : '#'
  contents.lines.map {|line|
    "#{l}#{line}"
  }.join
end

#list_item(text, list_type) ⇒ Object



31
32
33
34
# File 'lib/redcarpet/render/hiki.rb', line 31

def list_item(text, list_type)
  # FIXME mixed list type
  text
end

#paragraph(text) ⇒ Object



36
37
38
# File 'lib/redcarpet/render/hiki.rb', line 36

def paragraph(text)
  text + $/ * 2
end

#strikethrough(text) ⇒ Object



61
62
63
64
# File 'lib/redcarpet/render/hiki.rb', line 61

def strikethrough(text)
  # FIXME escape =
  "==#{text}=="
end