Htmlx

org.specs2.html.Htmlx
See theHtmlx companion object
trait Htmlx

This trait provide additional methods on a NodeSeq or a Node representing an html document

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Htmlx.type
Self type

Members list

Type members

Classlikes

implicit class HRef(s: String)

Attributes

Supertypes
class Object
trait Matchable
class Any
case class Header(level: Int, node: Node, namer: UniqueNames)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object HeaderShow extends Show[Header]

Attributes

Supertypes
trait Show[Header]
class Object
trait Matchable
class Any
Self type
HeaderShow.type
implicit class HtmlNodeOps(n: Node)

Attributes

Supertypes
class Object
trait Matchable
class Any
implicit class HtmlOps(ns: NodeSeq)

Attributes

Supertypes
class Object
trait Matchable
class Any
class HtmlRewriteRule(pf: PartialFunction[Node, Seq[Node]]) extends RewriteRule

Attributes

Supertypes
class RewriteRule
class BasicTransformer
trait Node => Node
class Object
trait Matchable
class Any
Show all
implicit class HtmlSeqNodeOps(ns: Seq[Node])

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def anchorName(name: String): String

create a sanitized anchor name

create a sanitized anchor name

Attributes

def headers(nodes: NodeSeq): NodeSeq

Attributes

Returns

all the headers and all the subtoc elements of a document

This rule can be used to add anchors to header elements

This rule can be used to add anchors to header elements

Attributes

def headersToTree(body: NodeSeq, headers: TreeLoc[Header]): TreeLoc[Header]

collect all the headers as a Tree

collect all the headers as a Tree

Attributes

def isHeader(e: Node): Boolean

Attributes

Returns

true if the element is a header

def nodeText(n: Node): String

Attributes

Returns

the text of the first child of a Node

def rewriteRule(pf: PartialFunction[Node, Seq[Node]]): HtmlRewriteRule

Attributes

Returns

a rewrite rule that will rewrite recursively each node based on a partial function

def sanitize(s: String): String

sanitize a string so that it can be used as a href

sanitize a string so that it can be used as a href

Attributes

def updateHead(ns: NodeSeq)(f: PartialFunction[Node, Node]): NodeSeq

Attributes

Returns

a NodeSeq where the first Node is updated with a partial function

def updateHeadAttribute(ns: NodeSeq, name: String, value: String): NodeSeq

Attributes

Returns

a NodeSeq where the first Node attribute named 'named' has a new value

def updateHeadAttribute(ns: NodeSeq, name: String, value: Int): NodeSeq

Attributes

Returns

a NodeSeq where the first Node attribute named 'named' has a new value, from an Int

def urls(ns: NodeSeq, filePath: FilePath): List[String]

Attributes

Returns

the href urls in elements

Implicits

Implicits

final implicit def HRef(s: String): HRef
final implicit def HtmlNodeOps(n: Node): HtmlNodeOps
final implicit def HtmlOps(ns: NodeSeq): HtmlOps
final implicit def HtmlSeqNodeOps(ns: Seq[Node]): HtmlSeqNodeOps