Class: Bookingit::HtmlRenderer
- Inherits:
-
Renderer
- Object
- Redcarpet::Render::HTML
- Renderer
- Bookingit::HtmlRenderer
show all
- Includes:
- FileUtils
- Defined in:
- lib/bookingit/html_renderer.rb
Constant Summary
Constants inherited
from Renderer
Renderer::EXTENSION_TO_LANGUAGE
Instance Attribute Summary
Attributes inherited from Renderer
#headers, #images, #stylesheets, #theme
Instance Method Summary
collapse
Methods inherited from Renderer
#block_code, #current_chapter=, #doc_footer, #doc_header, #header, #identify_language, #image, #initialize, #record_sections=
Instance Method Details
#css_class(language) ⇒ Object
29
30
31
32
33
34
35
|
# File 'lib/bookingit/html_renderer.rb', line 29
def css_class(language)
if language.nil? || language.strip == ''
""
else
" class=\"language-#{language}\""
end
end
|
#render_block_code(code, filename, language) ⇒ Object
25
26
27
|
# File 'lib/bookingit/html_renderer.rb', line 25
def render_block_code(code,filename,language)
Views::CodeView.new(code,filename,language,@config).render.strip
end
|
21
22
23
|
# File 'lib/bookingit/html_renderer.rb', line 21
def
Views::.new(@chapter,@config).render
end
|
17
18
19
|
# File 'lib/bookingit/html_renderer.rb', line 17
def
Views::.new(@stylesheets,@theme,@config).render
end
|
9
10
11
|
# File 'lib/bookingit/html_renderer.rb', line 9
def (text,,anchor)
"<a name='#{anchor}'></a><h#{header_level+1}>#{text}</h#{header_level+1}>"
end
|
#render_image(link, title, alt_text) ⇒ Object
13
14
15
|
# File 'lib/bookingit/html_renderer.rb', line 13
def render_image(link, title, alt_text)
"<img src='#{link}' alt='#{alt_text}' title='#{title}'>"
end
|