mixinafConcordion::ConcordionSkin

afConcordion::ConcordionSkin

Implement to create a skin for specification output. Skins are used by Concordion and its command to generate the HTML result files.

This mixin by default renders bare, but valid, HTML5 code. Override methods to alter the markup generated.

a

Source

virtual Str a(Uri href, Str text)

Renders a complete <a> tag.

addCss

Source

virtual Void addCss(File cssFile)

Copies the given css file to the output dir and adds the resultant URL to cssUrls.

addScript

Source

virtual Void addScript(File scriptFile)

Copies the given script file to the output dir and adds the resultant URL to scriptUrls.

blockQuote

Source

virtual Str blockQuote()

Starts a <blockquote> tag.

blockQuoteEnd

Source

virtual Str blockQuoteEnd()

Ends a </blockquote> tag.

body

Source

virtual Str body()

Starts a <body> tag and renders the breadcrumbs.

bodyEnd

Source

virtual Str bodyEnd()

Ends a </body> tag.

This also calls footer() and renders the scriptUrls as <script> tags.

Source

virtual Uri:Str breadcrumbPaths()

Returns an ordered map of URLs to fixture titles to use for the breadcrumbs.

Source

virtual Str breadcrumbs()

Renders the breadcrumbs.

cmdErr

Source

virtual Str cmdErr(Uri cmdUrl, Str cmdText, Err err)

Called to render a command error.

cmdFailure

Source

virtual Str cmdFailure(Str expected, Obj? actual, Bool escape := true)

Called to render a command failure.

cmdHook

Source

virtual Str cmdHook(Uri cmdUrl, Str cmdText, Obj?[]? data)

Custom commands may use this method as a generic hook into the skin.

By default this method returns an empty string.

cmdIgnored

Source

virtual Str cmdIgnored(Str text)

Called to render a command success.

cmdSuccess

Source

virtual Str cmdSuccess(Str text, Bool escape := true)

Called to render a command success.

code

Source

virtual Str code()

Starts an <code> tag.

codeEnd

Source

virtual Str codeEnd()

Ends an </code> tag.

copyFile

Source

virtual Uri copyFile(File srcFile, Uri destUrl)

Copies the given file to the destination URL - which is relative to the output folder. Returns a URL to the destination file relative to the current fixture file. Use this URL for embedding href's in the fixture HTML. Example:

copyFile(`fan://afConcordion/res/concordion.css`.get, `etc/concordion.css`)
--> `../../etc/concordion.css`
cssUrls

Source

abstract Uri[] cssUrls

emphasis

Source

virtual Str emphasis()

Starts an <emphasis> tag.

emphasisEnd

Source

virtual Str emphasisEnd()

Ends an </emphasis> tag.

example

Source

virtual Str example()

Starts an example section. By default this returns a div with the class example:

<div class="example">
exampleEnd

Source

virtual Str exampleEnd()

Ends an example section. By default this ends a div:

</div>
fixtureCtx

Source

virtual FixtureCtx fixtureCtx()

Returns the context associated with the current fixture.

fixtureMeta

Source

virtual FixtureMeta fixtureMeta()

Returns meta associated with the current fixture.

Source

virtual Str footer()

Renders a footer. This is (usually) called by bodyEnd(). By default it just renders a simple link to the Concordion website.

Source

virtual Str head()

Starts a <head> tag - this should also render a <title> tag.

headEnd

Source

virtual Str headEnd()

heading

Source

virtual Str heading(Int level, Str title, Str? anchorId)

Starts a heading tag, e.g. <h1>

headingEnd

Source

virtual Str headingEnd(Int level)

Ends a heading tag, e.g. </h1>

html

Source

virtual Str html()

Starts a <html> tag - this should also render the DOCTYPE.

Note that XHTML5 documents require the xmlns:

<html xmlns="http://www.w3.org/1999/xhtml"> 
htmlEnd

Source

virtual Str htmlEnd()

Ends a <html> tag. This also renders the cssUrls as link tags into the <head>.

img

Source

virtual Str img(Uri src, Str alt)

Renders a complete <img> tag.

Note that in HTML5 the <img> tag is a Void element and may be self closing.

li

Source

virtual Str li()

Starts a <li> tag.

liEnd

Source

virtual Str liEnd()

Ends a </li> tag.

Source

virtual Str link(Uri href)

Renders a complete <link> tag.

Note that in HTML5 the <link> tag is a Void element and may be self closing.

ol

Source

virtual Str ol(OrderedListStyle style)

Starts an <ol> tag. By default the list style is added as a CSS style attribute:

<ol style="list-style-type: upper-roman;">
olEnd

Source

virtual Str olEnd()

Ends an </ol> tag.

p

Source

virtual Str p(Str? admonition)

Starts a <p> tag. The admonition is added as a class (lowercase):

LEAD: Here I am  --> <p class="lead">Here I am</p>
pEnd

Source

virtual Str pEnd()

Ends a </p> tag.

pre

Source

virtual Str pre()

Starts a <pre> tag.

preEnd

Source

virtual Str preEnd()

Ends a </pre> tag.

script

Source

virtual Str script(Uri src)

Renders a complete <script> tag.

Note that in HTML5 the <script> tag is NOT a Void element and therefore MUST not be self colsing.

scriptUrls

Source

abstract Uri[] scriptUrls

setup

Source

virtual Void setup()

Called before every fixture run. This should reset any state held by the skin, e.g. the cssUrls and scriptUrls.

strong

Source

virtual Str strong()

Starts an <strong> tag.

strongEnd

Source

virtual Str strongEnd()

Ends an </strong> tag.

tearDown

Source

virtual Void tearDown()

Called after every fixture run. This should reset / cleardown any state held by the skin, e.g. the cssUrls and scriptUrls.

text

Source

virtual Str text(Str text)

Renders the given text. By default the text is XML escaped.

ul

Source

virtual Str ul()

Starts a <ul> tag.

ulEnd

Source

virtual Str ulEnd()

Ends a </ul> tag.