module Fluid::HTMLable

Defined in:

fluid/htmlable.cr

Constant Summary

HTML_DOC_TEMPLATE = "<!DOCTYPE html>\n<html>\n<head>\n {{html_head}}\n</head>\n<body>\n {{html_body}}\n</body>\n</html>"

Instance Method Summary

Instance Method Detail

def before_render #

A hook that is executed during the output of any Fluid mixin. Unlike '#before_to_text', this hook is called during all Fluid mixin output methods.


[View source]
def before_to_html #

A hook that is executing during the #to_html method.


[View source]
def css : String | Nil #

Returns the unminified CSS for this document.


[View source]
def full_css : String #

Returns the CSS for this document and all included partials.


[View source]
def html_head(minify : Bool) : String #

Returns the contents of the element for the html output.


[View source]
def to_html : String #

Generates and returns the html output of the document.

Executes 2 hooks, #before_render and #before_to_html, in that order.


[View source]
def to_html_doc(minify = true) : String #

Generates and returns a complete HTML document with the output from #to_html forming the element.

For example:

greeting.to_html      #=> %(<p class="salutation">Hello {{name}}</p>)
greeting.to_html_doc  #=> %(<!DOCTYPE html><html><head><style>.salutation{font-style:italic;}</style></head><body><p class="salutation">Hello {{name}}</p></body></html>)

Like #to_html, this method executes the #before_render and #before_to_html hooks, in that order.


[View source]