Module: Roda::RodaPlugins::RodaTags

Defined in:
lib/roda/plugins/tags.rb

Overview

TODO: Add documentation here

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Constant Summary collapse

OPTS =

default options

{
  # toggle for XHTML formatted output in case of legacy
  tag_output_format_is_xhtml: false,
  # toggle for adding newlines after output
  tag_add_newlines_after_tags: true
}.freeze
MULTI_LINE_TAGS =

Tags that should be rendered in multiple lines, like…

<body>
  <snip...>
</body>
%w( 
  a address applet bdo big blockquote body button caption center 
  colgroup dd dir div dl dt fieldset form frameset head html iframe 
  map noframes noscript object ol optgroup pre script section select small 
  style table tbody td tfoot th thead title tr tt ul 
)
SELF_CLOSING_TAGS =

Self closing tags, like…

<hr> or <hr />
%w( area base br col frame hr img input link meta param )
SINGLE_LINE_TAGS =

Tags that should be rendered in a single line, like…

<h1>Header</h1>
%w( 
  abbr acronym b cite code del dfn em h1 h2 h3 h4 h5 h6 i kbd 
  label legend li option p q samp span strong sub sup var
)
BOOLEAN_ATTRIBUTES =

Boolean attributes, ie: attributes like…

<option value="a" selected="selected">A</option>
%w(autofocus checked disabled multiple readonly required selected)

Class Method Summary collapse

Class Method Details

.configure(app, opts = {}) ⇒ Object



65
66
67
68
69
70
71
72
73
74
# File 'lib/roda/plugins/tags.rb', line 65

def self.configure(app, opts = {})
  if app.opts[:tags]
    opts = app.opts[:tags][:orig_opts].merge(opts)
  else
    opts = OPTS.merge(opts)
  end
  
  app.opts[:tags]             = opts.dup
  app.opts[:tags][:orig_opts] = opts
end

.load_dependencies(app, opts = OPTS) ⇒ Object

Depend on the render plugin, since this plugin only makes sense when the render plugin is used.



61
62
63
# File 'lib/roda/plugins/tags.rb', line 61

def self.load_dependencies(app, opts = OPTS)
  app.plugin :render
end