XSLT as a powerful static
website generator

Hogrefe's Clinical Handbook
of Psychotropic Drugs.

martin.kraetke@le-tex.de / @mkraetke

ToC

  1. Background
  2. Markup
  3. Navigation
  4. Static site generators

Background

Hogrefe

  • subject areas: psychology, psychiatry, and mental health
  • backlist include about 2,500 books, 220 new titles p.a., 40 journals
  • located in Europe, the USA, and Brazil with 270 employees

Logo of the Clinical Handbook of Psychotropic Drugs

  • Hogrefe's core publications and standard reference on psychotropic drugs
  • content is derived from various forms of published literature (randomized controlled trials, scientific data, cohort trials, case series, and case reports)
  • available in print (400 pages) and online
double spread from the print version of the Clinical Handbook of Psychotropic Drugs

Markup

DocBook 5.0

  • previous DTD had insufficient table markup
  • DocBook is a publicly available standard

XInclude for chapters

<xi:include href="chapter_RepetitiveTranscranialMagnetic.xml"/>
<xi:include href="chapter_Antipsychotics.xml"/>
<xi:include href="chapter_AntipsychoticInducedExtrapyram.xml"/>
<!-- … -->

LaTeX pis for print output

</tr>
<?tex \Hack{\splittable}?>
<tr>

@linkends attribute for multiple citations

<para>
  SSRIs are used (off-label) in the  treatment of behavioral 
  and psychological symptoms of dementia<superscript>
    <xref role="bibref" linkends="Seitz2011 Henry2011"/>
  </superscript>
</para>

allows for a selective rendering for print (for example, “[3–5,7]”) and online (linked individual numbers, “[3,4,5,7]”)

@role to classify indication,
tradename or substance name

<indexterm role="indication"
           xml:id="EPSE_general_parkinsonism">
  <primary>Parkinsonism</primary>
</indexterm>

XSLT 2.0 as a static
site generator

Google Trends result for "static site generator"

Google Trends shows an increasing curve for the search term 'static website generator' from 2009 to mid of 2016

Some benefits of static site generators

  • simple, fast, less security flaws
  • easily deployable, offline readable
  • much dynamic code can be moved to the client

Why not using non-XML approaches?

  • MarkDown, Textile and HTML provide no standardized query language
  • flat content model, not applicable to STM content
  • with index terms, a key feature is missing

Benefits of XSLT 2.0
as static site generator

  • XML input may be easily queried using XPath 2.0
  • features: grouping, functions and regular expressions
  • xsl:result-document to generate file chunks

Generated content

  • HTML content files (621 HTML files)
  • HTML files for search results (821 HTML files)
  • search terms (1147 terms in a JSON file)

Thank you!