Class: Phlex::HTML Abstract

Inherits:
SGML
  • Object
show all
Extended by:
Elements
Includes:
StandardElements, VoidElements, Helpers
Defined in:
lib/phlex/html.rb

Overview

This class is abstract.

Subclass and define SGML#template to create an HTML component class.

Defined Under Namespace

Modules: StandardElements, VoidElements

Constant Summary collapse

EVENT_ATTRIBUTES =

A list of HTML attributes that have the potential to execute unsafe JavaScript.

%w[onabort onafterprint onbeforeprint onbeforeunload onblur oncanplay oncanplaythrough onchange onclick oncontextmenu oncopy oncuechange oncut ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus onhashchange oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmessage onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onoffline ononline onpagehide onpageshow onpaste onpause onplay onplaying onpopstate onprogress onratechange onreset onresize onscroll onsearch onseeked onseeking onselect onstalled onstorage onsubmit onsuspend ontimeupdate ontoggle onunload onvolumechange onwaiting onwheel].to_h { [_1, true] }.freeze
UNBUFFERED_MUTEX =
Mutex.new

Instance Method Summary collapse

Methods included from Elements

register_element

Methods included from Helpers

#classes, #mix, #tokens

Methods included from VoidElements

#area, #br, #col, #embed, #hr, #img, #input, #link, #meta, #param, #source, #track

Methods included from StandardElements

#a, #abbr, #address, #article, #aside, #b, #bdi, #bdo, #blockquote, #body, #button, #caption, #cite, #code, #colgroup, #data, #datalist, #dd, #del, #details, #dfn, #dialog, #div, #dl, #dt, #em, #fieldset, #figcaption, #figure, #footer, #form, #h1, #h2, #h3, #h4, #h5, #h6, #head, #header, #hgroup, #html, #i, #iframe, #ins, #kbd, #label, #legend, #li, #main, #map, #mark, #meter, #nav, #noscript, #object, #ol, #optgroup, #option, #output, #p, #picture, #pre, #progress, #q, #rp, #rt, #ruby, #s, #samp, #script, #section, #select, #slot, #small, #span, #strong, #style, #sub, #summary, #sup, #table, #tbody, #td, #template_tag, #textarea, #tfoot, #th, #thead, #time, #title, #tr, #u, #ul, #video, #wbr

Methods inherited from SGML

#after_template, #around_template, #before_template, #call, call, #capture, #comment, #format_object, #initialize, new, #plain, #render, #render?, #template, #unsafe_raw, #whitespace, #yield_content, #yield_content_with_args, #yield_content_with_no_args

Constructor Details

This class inherits a constructor from Phlex::SGML

Instance Method Details

#doctypeObject

Output an HTML doctype.



28
29
30
31
# File 'lib/phlex/html.rb', line 28

def doctype
	@_context.target << "<!DOCTYPE html>"
	nil
end

#svgnil

Outputs an <svg> tag



36
37
38
39
40
41
42
# File 'lib/phlex/html.rb', line 36

def svg(...)
	super do
		render Phlex::SVG.new do |svg|
			yield(svg)
		end
	end
end