Class

laika.render

TagWriter

Related Doc: package render

Permalink

abstract class TagWriter extends TextWriter

Base type for writers that produce tag-based output formats like XML or HTML. Extends the base TextWriter and adds methods for writing text with special characters as entities and for conveniently writing tags with attributes.

Linear Supertypes
TextWriter, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TagWriter
  2. TextWriter
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TagWriter(out: (String) ⇒ Unit, render: (Element) ⇒ Unit, root: Element, newLine: String = "\n", formatted: Boolean = true)

    Permalink

    out

    the render function to write string values to

    render

    the render function for writing elements

    root

    the root element to render

    newLine

    the newline character to use

    formatted

    whether the output is formatted (adding indentation and newlines)

Abstract Value Members

  1. abstract def attributes(tag: String, element: Element, attrs: Seq[(String, Any)]): Seq[(String, Any)]

    Permalink

    Produces the complete sequence of attributes to write for the specified tag.

    Produces the complete sequence of attributes to write for the specified tag.

    Attributes
    protected
  2. abstract def attributes(tag: String, options: Options, attrs: Seq[(String, Any)]): Seq[(String, Any)]

    Permalink

    Produces the complete sequence of attributes to write for the specified tag.

    Produces the complete sequence of attributes to write for the specified tag.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def <<(element: Element): TagWriter.this.type

    Permalink

    Writes the specified element to the output, on the same line.

    Writes the specified element to the output, on the same line.

    Definition Classes
    TextWriter
  4. def <<(elements: Seq[Element]): TagWriter.this.type

    Permalink

    Writes the specified elements to the output, all on the same line.

    Writes the specified elements to the output, all on the same line.

    Definition Classes
    TextWriter
  5. def <<(str: String): TagWriter.this.type

    Permalink

    Writes the specified string to the output, on the same line.

    Writes the specified string to the output, on the same line.

    Definition Classes
    TextWriter
  6. def <<&(str: String): TagWriter.this.type

    Permalink

    Writes the specified string to the output, on the same line, with all special XML/HTML characters converted to entities.

  7. def <<<(elements: Seq[Span]): TagWriter.this.type

    Permalink

    Writes the specified span elements to the output, on the same line, while omitting indentation for all text spans written with one of the methods that convert special characters.

  8. def <<<&(str: String): TagWriter.this.type

    Permalink

    Writes the specified string to the output, without any indentation, with all special XML/HTML characters converted to entities.

    Writes the specified string to the output, without any indentation, with all special XML/HTML characters converted to entities. This is needed for writing blocks like those enclosed in <pre&rt; tags where whitespace is significant.

  9. def <<@(tag: String, element: Element, attrs: (String, Any)*): TagWriter.this.type

    Permalink

    Writes an opening tag with attributes derived from both the element parameter and the subsequent tuples.

  10. def <<@(tag: String, options: Options, attrs: (String, Any)*): TagWriter.this.type

    Permalink

    Writes an opening tag with attributes derived from both the options parameter and the subsequent tuples.

  11. def <<@(attrs: (String, Any)*): TagWriter.this.type

    Permalink

    Writes the specified attributes (passed as name-value tuples), including a preceding space character.

    Writes the specified attributes (passed as name-value tuples), including a preceding space character. In cases where the value is None nothing will be written to the output.

  12. def <<@(name: String, value: Any): TagWriter.this.type

    Permalink

    Writes the specified name and value as an optional attribute, including a preceding space character.

    Writes the specified name and value as an optional attribute, including a preceding space character. In case the value is None nothing will be written to the output.

    Attributes
    protected
  13. def <<@(name: String, value: String): TagWriter.this.type

    Permalink

    Writes the specified name and value as an attribute, including a preceding space character.

  14. def <<@(name: String, value: Option[String]): TagWriter.this.type

    Permalink

    Writes the specified name and value as an optional attribute, including a preceding space character.

    Writes the specified name and value as an optional attribute, including a preceding space character. In case the value is None nothing will be written to the output.

  15. def <<@/(tag: String, element: Element, attrs: (String, Any)*): TagWriter.this.type

    Permalink

    Writes an empty tag with attributes derived from both the element parameter and the subsequent tuples.

  16. def <<@/(tag: String, options: Options, attrs: (String, Any)*): TagWriter.this.type

    Permalink

    Writes an empty tag with attributes derived from both the options parameter and the subsequent tuples.

  17. def <<|(element: Element): TagWriter.this.type

    Permalink

    Writes the specified element to the output, on a new line using the current level of indentation.

    Writes the specified element to the output, on a new line using the current level of indentation.

    Definition Classes
    TextWriter
  18. def <<|(elements: Seq[Element]): TagWriter.this.type

    Permalink

    Writes the specified elements to the output, each of them on a new line using the current level of indentation.

    Writes the specified elements to the output, each of them on a new line using the current level of indentation.

    Definition Classes
    TextWriter
  19. def <<|(str: String): TagWriter.this.type

    Permalink

    Writes the specified string to the output, on a new line using the current level of indentation.

    Writes the specified string to the output, on a new line using the current level of indentation.

    Definition Classes
    TextWriter
  20. def <<|&(str: String): TagWriter.this.type

    Permalink

    Writes the specified string to the output, on a new line using the current level of indentation, with all special XML/HTML characters converted to entities.

  21. def <<|>(element: Element): TagWriter.this.type

    Permalink

    Writes the specified element to the output, on a new line and increasing indentation one level to the right.

    Writes the specified element to the output, on a new line and increasing indentation one level to the right.

    Definition Classes
    TextWriter
  22. def <<|>(elements: Seq[Element]): TagWriter.this.type

    Permalink

    Writes the specified elements to the output, each of them on a new line with the indentation increased one level to the right.

    Writes the specified elements to the output, each of them on a new line with the indentation increased one level to the right.

    Definition Classes
    TextWriter
  23. def <<|>(str: String): TagWriter.this.type

    Permalink

    Writes the specified string to the output, on a new line and increasing indentation one level to the right.

    Writes the specified string to the output, on a new line and increasing indentation one level to the right.

    Definition Classes
    TextWriter
  24. def <<|>&(str: String): TagWriter.this.type

    Permalink

    Writes the specified string to the output, on a new line and increasing indentation one level to the right, with all special XML/HTML characters converted to entities.

  25. def <|: TagWriter.this.type

    Permalink

    Writes a new line character sequence.

    Writes a new line character sequence.

    Definition Classes
    TextWriter
  26. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  27. object Indent

    Permalink
    Attributes
    protected
    Definition Classes
    TextWriter
  28. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  29. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  31. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  32. def escaped(str: String): String

    Permalink

    Replaces all special XML/HTML characters with entities.

    Replaces all special XML/HTML characters with entities.

    Attributes
    protected
  33. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  34. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  35. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  36. def indented(indent: Int)(block: ⇒ Unit): Unit

    Permalink

    Executes the specified block while temporarily shifting the indentation level (if it is greater than the currently active one).

    Executes the specified block while temporarily shifting the indentation level (if it is greater than the currently active one).

    Definition Classes
    TextWriter
  37. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  38. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. def parents: List[Element]

    Permalink
    Attributes
    protected
    Definition Classes
    TextWriter
  42. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  43. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  44. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. def withoutIndentation(f: ⇒ Any): TagWriter.this.type

    Permalink

    Invokes the specified function after switching off the rendering of any indentation for escaped text elements.

    Invokes the specified function after switching off the rendering of any indentation for escaped text elements. The old flag gets restored after invocation.

    Attributes
    protected

Inherited from TextWriter

Inherited from AnyRef

Inherited from Any

Ungrouped