delimiters "$","$" symbols ::= [ "copyright":"©", "tm":"™", "[":"[" ] /* NOTES From: https://css-tricks.com/probably-dont-base64-svg/ for embedding SVG directly in HTML doc with base64 make sure to take tag off the head of .svg file. */ header(title,css,googletracking,metadata) ::= << $if(googletracking)$ $endif$ $title$ $webmetadata(metadata)$ >> footer() ::= << >> // title,imageurl,description,url,pagetype,twitterhandle webmetadata(data) ::= << >> /** This is the title page, TOC etc... for the book. Chapters and * all content in separate files. Article has no main page. * * 'file' attribute available to all nested templates. */ BookFrontMatterFile(file) ::= << $header(title=file.book.title, css=file.book.cssFile, googletracking=file.attributes.googletracking, metadata=file.book.metadata)$

$file.title$

$if(file.attributes.version)$
$file.attributes.watermark$
Book version $file.attributes.version$
$endif$

$file.attributes.author$

$file.book.copyright$

$if(file.book.abstract_)$

$file.book.abstract_$

$endif$

Contents

$footer()$ >> /** Any kind of output document; wraps chapter but not book toc. * 'artifact' attribute available to all nested templates. * There is no file attribute as OutputFile has no model object. */ OutputFile(artifact, title, body, numbering) ::= << $header(title=title, css=artifact.cssFile, googletracking=artifact.attributes.googletracking, metadata=artifact.metadata)$ $body$ $footer()$ >> /** Also represents an article page */ Chapter(chapter, preabstract, abstract_, content, subcontainers) ::= <<
$if(chapter.artifact.attributes.watermark)$ $chapter.artifact.attributes.watermark$
$endif$ $if(chapter.artifact.attributes.version)$ Book version $chapter.artifact.attributes.version$ $endif$

$if(numbering)$$chapter.def.entityID$ $endif$$chapter.title$

$chapter.artifact.attributes.author$

$chapter.attributes.author$

$chapter.artifact.copyright$

$preabstract$ $abstract_$ $if(chapter.subcontainers)$

Contents

$endif$ $content$ $subcontainers$ >> NotebooksIndexFile(file,artifact,names,booktitle) ::= << $header(title={Jupyter Notebook Files for $booktitle$}, css={../$file.cssFile$}, googletracking=file.attributes.googletracking, metadata=file.book.metadata)$

Jupyter Notebook Files for $booktitle$

$footer()$ >> Author(model, author) ::= <<

$author$

>> Abstract(model, elements) ::= <<

Abstract

$elements$

>> PreAbstract(model, elements) ::= <<

$elements$

>> Section(model, content, subcontainers) ::= <<

$if(numbering)$$model.def.entityID$ $endif$$model.title$

$content$ $subcontainers$ >> SubSection(model, content, subcontainers) ::= <<

$if(numbering)$$model.def.entityID$ $endif$$model.title$

$content$ $subcontainers$ >> SubSubSection(model, content, subcontainers) ::= <<

$if(numbering)$$model.def.entityID$ $endif$$model.title$

$content$ >> TextBlock(model,elements) ::= "$elements$" SideQuote(model) ::= "

$model.def.index$ “$model.def.attributes.quote$” — $model.def.attributes.author$

" SideNote(model,text) ::= "

$model.def.index$$text$

" Citation(model) ::= "

$model.def.index$ “$model.def.title$” — $model.def.author$

" ChapQuote(model) ::= "

$model.quote$” — $model.author$

" dumpCode(code) ::= << $\n$
$code; format="xml-encode"$
>> BlockCode(model) ::= << $dumpCode(model.code)$ $\n$ >> PyEval(model) ::= << $if(model.codeDef.isCodeVisible)$ $dumpCode({$if(model.codeDef.code)$$model.codeDef.code; format="xml-encode"$$\n$$endif$$if(model.codeDef.displayExpr)$print($model.codeDef.displayExpr$)$endif$})$ $endif$ $if(model.stdout&&model.displayData)$

$model.stdout; format="xml-encode"$ $model.displayData; format="xml-encode"$

$elseif(model.stdout)$

$model.stdout; format="xml-encode"$

$elseif(model.displayData)$

$model.displayData; format="xml-encode"$

$endif$ $if(model.stderr)$

$model.stderr; format="xml-encode"$

$endif$ >> InlinePyEval(model) ::= << $if(model.stderr)$$model.stderr; format="xml-encode"$$else$$model.displayData$$endif$ >> PyEvalDataFrame(model) ::= << $if(model.codeDef.isCodeVisible)$ $dumpCode({$model.codeDef.code$$if(model.codeDef.displayExpr)$$\n$$model.codeDef.displayExpr$$endif$})$ $endif$ $if(model.stdout)$

$model.stdout; format="xml-encode"$

$endif$ $if(model.stderr)$

$model.stderr; format="xml-encode"$

$endif$ $dataTable(model.dataTable)$ >> dataTable(dt) ::= <<
$if(dt.firstColIsIndex)$ $rest(dt.colNames):{c | }$ $else$ $dt.colNames:{c | }$ $endif$ $dt.rows:{r | $dataTableRow(dt,r)$}; separator="\n"$
 $c$
$first(dt.colNames)$
$c$
>> dataTableRow(dt,r) ::= << $r:{c| $c$}$ >> PyFig(model) ::= << $if(model.args.side)$
$if(!model.args.hide)$ » Generated by code to left
$endif$
$endif$ $if(model.codeDef.isCodeVisible)$ $dumpCode(model.codeDef.code)$ $endif$ $if(!model.args.side)$
$else$
$endif$ $if(model.stderr)$

$model.stderr$

$endif$ >> Site(model) ::= "$model.def.index$ $model.def.website$" Figure(model, code) ::= << $code$
Figure $model.def.enclosingChapter.index$.$model.def.index$. $model.caption$
>> SideFigure(model, code) ::= << $code$
Figure $model.def.enclosingChapter.index$.$model.def.index$. $model.caption$
>> YouTube(model) ::= << >> // side stuff collected into Paragraph model and float:right'd for HTML (but not latex) SiteRef(model) ::= "$model.def.index$" CitationRef(model) ::= "$model.def.index$" FigureRef(model) ::= "Figure $model.def.enclosingChapter.index$.$model.def.index$" SideNoteRef(model) ::= "$model.def.index$" SideQuoteRef(model) ::= "$model.def.index$" SectionRef(model) ::= "Section$if(numbering)$ $model.def.entityID$$endif$ $model.def.title$" /* what is filename? << Section $model.def.index$ $model.def.title$ >> */ ChapterRef(model) ::= "Chapter $model.def.index$ $model.def.title$" CalloutRef(model) ::= "" // show nothing; ref just identifies which para to associate with UnknownRef(model) ::= << [$model.def.label$] >> UnknownSymbol(model) ::= << !$model.symbolName$! >> OrderedList(model, items) ::= <<
    $items; separator="\n"$
>> UnOrderedList(model, items) ::= << >> ListItem(model, elements) ::= "
  • $elements$
  • " Table(model, headers, rows) ::= <<
    $headers$ $rows; separator="\n"$
    >> TableRow(model, items) ::= << $items$ >> TableRowItem(model, contents) ::= << $contents$ >> TableHeaderItem(model, contents) ::= << $contents$ >> Paragraph(model, content) ::= << $if(model.entitiesRefd)$
    $model.entitiesRefd:{d | $d.template$}$

    $content$

    $else$

    $content$

    $endif$ >> InlineImage(model) ::= << >> Image(model) ::= << $if(model.attributes.side)$
    $endif$ $if(!model.attributes.nocenter)$
    $endif$ $if(model.attributes.url)$$endif$ $if(model.attributes.url)$$endif$ $if(!model.attributes.nocenter)$
    $endif$ $if(model.attributes.side)$
    $endif$ >> BlockImage(model) ::= <<$\n$ $if(!model.attributes.nocenter)$
    $endif$ $Image(model)$ $if(!model.attributes.nocenter)$
    $endif$ $\n$ >> XMLTag(model) ::= << <$model.name$ $model.attributes:{attr | $attr$="$model.attributes.(attr)$"}; separator=" "$> >> XMLEndTag(model) ::= "" Latex(model) ::= <<
    >> RawHTML(model) ::= "$model.html$" BlockEquation(model) ::= <<
    >> InlineEquation(model) ::= << >> EqnVar(model) ::= "$model.varname$" EqnIndexedVar(model) ::= "$model.varname$$model.indexname$" EqnVecVar(model) ::= "$model.varname$" EqnIndexedVecVar(model) ::= "$model.varname$$model.indexname$" HyperLink(model) ::= << $model.title$ >> Quoted(model, elements) ::= "“$elements$”" Callout(model, text) ::= "
    $text$
    " Aside(model, text) ::= <<
    $model.attributes.title$
    $text$
    >> InlineCode(model) ::= << $model.code; format="xml-encode"$ >> Bold(model) ::= "$model.text$" Italics(model) ::= "$model.text$" Hyphen(model) ::= "—" TODO(model) ::= << {TODO: $model.text$} >> LineBreak(model) ::= "
    " Text(model) ::= "$model.text$" Join(model, elements) ::= "$elements$"