Module: Rubyoshka::HTML
- Included in:
- HTMLRenderer
- Defined in:
- lib/rubyoshka/html.rb
Overview
Markup extensions
Constant Summary collapse
- S_HTML5_DOCTYPE =
'<!DOCTYPE html>'
Instance Method Summary collapse
-
#html5(&block) ⇒ void
Emits an HTML5 doctype tag and an html tag with the given block.
- #link_stylesheet(href, custom_attributes = nil) ⇒ Object
-
#p(text = nil, **props, &block) ⇒ void
Emits the p tag (overrides Object#p).
Instance Method Details
#html5(&block) ⇒ void
This method returns an undefined value.
Emits an HTML5 doctype tag and an html tag with the given block
22 23 24 25 |
# File 'lib/rubyoshka/html.rb', line 22 def html5(&block) @buffer << S_HTML5_DOCTYPE self.html(&block) end |
#link_stylesheet(href, custom_attributes = nil) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rubyoshka/html.rb', line 27 def link_stylesheet(href, custom_attributes = nil) attributes = { rel: 'stylesheet', href: href } if custom_attributes attributes = custom_attributes.merge(attributes) end link(**attributes) end |
#p(text = nil, **props, &block) ⇒ void
This method returns an undefined value.
Emits the p tag (overrides Object#p)
13 14 15 |
# File 'lib/rubyoshka/html.rb', line 13 def p(text = nil, **props, &block) method_missing(:p, text, **props, &block) end |