
org.specs2.reporter.HtmlReportOutput.scala Maven / Gradle / Ivy
package org.specs2
package reporter
import scala.xml.{Elem, NodeSeq}
import specification.{HtmlLink, Stats, SpecName, FormattedString}
import execute.{Details, ResultStackTrace, Result}
import main.Diffs
import control.StackTraceFilter
/**
* This trait defines how the specification elements should be translated as xhtml
* An implementation of that trait must accumulate the results and return the created xhmtl
* with the xml method
*/
trait HtmlReportOutput {
/** @return the build html code */
def xml: NodeSeq
/** show as a string */
def show: String
/** clear the current xml content */
def clear: HtmlReportOutput
/** print a NodeSeq */
def print(xml: NodeSeq): HtmlReportOutput
/** print an Elem */
def print(xml: Elem): HtmlReportOutput
/** print a Text Node */
def print(text: String): HtmlReportOutput = print(scala.xml.Text(text))
/** print a Text Node with a new line */
def println(text: String = ""): HtmlReportOutput = print(text+"\n")
/** set the file path for the current output */
def filePathIs(path: String): HtmlReportOutput
/** print the whole file content */
def printFile(specName: SpecName, breadcrumbs: NodeSeq, lines: HtmlReportOutput, toc: TreeToc): HtmlReportOutput
/** enclose the nodes inside
tags */
def printHtml(n: NodeSeq): HtmlReportOutput
/** enclose the nodes inside
tags */
def printBody(n: NodeSeq): HtmlReportOutput
/** provide the