levsha.dsl

package levsha.dsl

Type members

Classlikes

trait AttrDef
trait Optimize
trait StyleDef
trait TagDef
object html

HTML Tags, Attributes, and Styles specification

HTML Tags, Attributes, and Styles specification

object svg

https://developer.mozilla.org/en-US/docs/Web/SVG

Value members

Concrete methods

def AttrDef(attrName: String): AttrDef
def AttrDef(namespace: XmlNs, attrName: String): AttrDef
def StyleDef(styleName: String): StyleDef
def TagDef(tagName: String): TagDef
def TagDef(namespace: XmlNs, tagName: String): TagDef
def void[T]: Node[T] & Attr[T]
def when[T, D >: Document[T]](condition: Boolean)(doc: D)(ev: Document[T] =:= D): D

Add node or attribute conditionally

Add node or attribute conditionally

Example
button(
 when(inProgress)(disabled)
 "Push me"
)

Inherited methods

inline def optimize[T](inline node: Node[T]): Node[T]

Optimize template to monolith (if possible) levsha.Document.Node in compile time. Note this method touched by non-idempotent typechecking bug of Scala compiler. It means, sometimes your code could be broken. Try not to insert non-DSL code into optimize {} call.

Optimize template to monolith (if possible) levsha.Document.Node in compile time. Note this method touched by non-idempotent typechecking bug of Scala compiler. It means, sometimes your code could be broken. Try not to insert non-DSL code into optimize {} call.

See also
Inherited from
Optimize

Concrete fields

Use it when want overwrite default click behavior.

Use it when want overwrite default click behavior.

 a(href := "http://example.com", preventDefaultClickBehavior)

Implicits

Implicits

implicit def arbitraryOptionToNode[M, T](value: Option[T])(ev: T => Node[M]): Node[M]

Converts option of T (which can be converted to Node) to document node

Converts option of T (which can be converted to Node) to document node

implicit def arbitrarySeqToNode[M, T](xs: Iterable[T])(ev: T => Node[M]): Node[M]

Converts sequence of T (which can be converted to Node) to document fragment

Converts sequence of T (which can be converted to Node) to document fragment

implicit def miscToNode[M](value: M): Node[M]

Converts MiscType to text document node

Converts MiscType to text document node

implicit def optionToAttr[M](value: Option[Attr[M]]): Attr[M]

Implicitly unwraps optional attributes

Implicitly unwraps optional attributes

implicit def optionToNode[M](value: Option[Node[M]]): Node[M]

Implicitly unwraps optional documents

Implicitly unwraps optional documents

implicit def seqToAttr[M](xs: Iterable[Attr[M]]): Attr[M]

Converts iterable of attributes to document one attr

Converts iterable of attributes to document one attr

implicit def seqToNode[M](xs: Iterable[Node[M]]): Node[M]

Converts iterable of templates to document fragment

Converts iterable of templates to document fragment

implicit def stringToNode[M](value: String): Node[M]

Converts String to text document node

Converts String to text document node