Sha256: 4ae52798d2971abe9137a57fe099b64a8caaa063e8b36744d3c6f84508b912b6

Contents?: true

Size: 876 Bytes

Versions: 1

Compression:

Stored size: 876 Bytes

Contents

require 'redcarpet'
require 'cgi'
require 'fileutils'

module Bookingit
  class HtmlRenderer < Bookingit::Renderer
    include FileUtils

    def render_header(text,header_level,anchor)
      "<a name='#{anchor}'></a><h#{header_level+1}>#{text}</h#{header_level+1}>"
    end

    def render_image(link, title, alt_text)
      "<img src='#{link}' alt='#{alt_text}' title='#{title}'>"
    end

    def render_doc_header
      Views::HeaderView.new(@stylesheets,@theme,@config).render
    end

    def render_doc_footer
      Views::FooterView.new(@chapter,@config).render
    end

    def render_block_code(code,filename,language)
      Views::CodeView.new(code,filename,language,@config).render.strip
    end

    def css_class(language)
      if language.nil? || language.strip == ''
        ""
      else
        " class=\"language-#{language}\""
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bookingit-0.5.0 lib/bookingit/html_renderer.rb