lib/docubot/page.rb
#TODO: cache this is people keep calling to_html and it's a problem
cache this is people keep calling to_html and it's a problem
cache this is people keep calling to_html and it ' s a problem
def to_html
		@meta.template ||= leaf? ? 'page' : 'section'
		master_templates = DocuBot::TEMPLATE_DIR
		source_templates = @bundle.source / '_templates'
		tmpl = source_templates / "#{template}.haml"
		tmpl = master_templates / "#{template}.haml" unless File.exists?( tmpl )
		tmpl = master_templates / "page.haml"        unless File.exists?( tmpl )
		tmpl = IO.read( tmpl, encoding:'utf-8' )
		haml = Haml::Engine.new( tmpl, DocuBot::Writer::HAML_OPTIONS )
		haml.render( Object.new, :contents=>content_html, :page=>self, :global=>@bundle.global, :root=>root )
	end
def to_html @meta . template ||= leaf? ? 'page' : 'section' master_templates = DocuBot :: TEMPLATE_DIR source_templates = @bundle . source / '_templates' tmpl = source_templates / "#{template}.haml" tmpl = master_templates / "#{template}.haml" unless File . exists? ( tmpl ) tmpl = master_templates / "page.haml" unless File . exists? ( tmpl ) tmpl = IO . read ( tmpl , encoding : 'utf-8' ) haml = Haml :: Engine . new ( tmpl , DocuBot :: Writer :: HAML_OPTIONS ) haml . render ( Object . new , :contents => content_html , :page => self , :global => @bundle . global , :root => root ) end
TODO: cache this is people keep calling to_html and it's a problem
TODO : cache this is people keep calling to_html and it ' s a problem