evolve-hub

XSLT Library to detect and tag headlines, lists, tables and figures

Repository
Git URL https://github.com/transpect/evolve-hub.git
SVN URL https://github.com/transpect/evolve-hub
Base URI http://transpect.io/evolve-hub/

Source ⬇

hub:evolve-hub

evolve-hub deals with up-converting flat hub to hub documents with proper lists, hierarchies, etc. This is the up-conversion part where most knowledge about layout and style names (e.g., for headings or box types) comes into play. Therefore it is essential that everything is customizable per imprint, series, work, etc. The basic evolve-hub.xsl library is an XSLT micropipeline. It uses some meta-information from the hub input data to determine whether the document is already purportedly hierarchized or contains proper lists. But other than some branching according to these document properties and XSLT’s import mechanism (that allows for clumsy reshuffling of the default pipeline), the pipeline is of a fixed, one-size-fits-all kind. Therefore we outsource the pipelining part to XProc here, and we allow evaluation of pipelines that are determined dynamically at runtime. This front-end pipeline step loads dynamically evolve-hub/driver.xpl and evolve-hub/driver.xsl from the first configuration directory where it can find each file. The directories searched are, in that order, from higher to lower specificity: work, series, publisher, common. driver.xsl imports the central evolve-hub.xsl and typically configures variables for the relevant modes. driver.xpl is a custom pipeline that orchestrates some or all of the modes available in evolve-hub. Please note that every transformation in evolve-hub.xpl always uses the same XSLT, namely the most specific driver.xsl that could be found. If templates are needed that aren’t included in evolve-hub or driver.xsl, they’d have to be imported by driver.xsl, too. Also note that driver.xsl and driver.xpl don’t need to reside in the same configuration directory. You might perfectly well use the common pipeline together with a series’ XSLT stylesheet. The tr:load-cascaded mechanism will take care of loading the most specific available of each file type. If some (not just one, not all) series would like to share a pipeline or an XSLT stylesheet, they should create the corresponding files at some location (= for some series) and create stub pipelines/stylesheets in the other locations. These stubs should simply import the master series’ files.

Import

<p:import href="http://transpect.io/evolve-hub/xpl/evolve-hub.xpl"/>

Dependencies

Synopsis

<hub:evolve-hub xmlns:hub="http://transpect.io/hub">
  <p:input port="source" sequence="true" primary="true"/>
  <p:input port="paths" primary="true"/>
  <p:input port="options" sequence="true"/>
  <p:output port="result" sequence="true" primary="true"/>
  <p:output port="report" sequence="true"/>
  <p:option name="load" required="false" select="'evolve-hub/driver'"/>
  <p:option name="srcpaths" required="false" select="'no'"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="status-dir-uri" select="'status'"/>
  <p:option name="fallback-xsl" select="'http://transpect.io/evolve-hub/xsl/evolve-hub.xsl'"/>
  <p:option name="fallback-xpl" select="'http://transpect.io/evolve-hub/xpl/fallback.xpl'"/>
</hub:evolve-hub>

hub:evolve-hub_lists-by-indent

Import

<p:import href="http://transpect.io/evolve-hub/xpl/evolve-hub_lists-by-indent.xpl"/>

Dependencies

Synopsis

<hub:evolve-hub_lists-by-indent xmlns:hub="http://transpect.io/hub">
  <p:input port="source" primary="true"/>
  <p:input port="parameters" sequence="true" primary="true"/>
  <p:input port="stylesheet"/>
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug-dir-uri'"/>
  <p:option name="debug-indent" select="'true'"/>
  <p:option name="status-dir-uri" select="'status-dir-uri'"/>
  <p:option name="fail-on-error" select="'no'"/>
  <p:option name="prefix" required="false" select="'evolve-hub/5'"/>
  <p:option name="hub-version" required="false" select="'1.2'"/>
</hub:evolve-hub_lists-by-indent>

hub:evolve-hub_lists-by-role

Import

<p:import href="http://transpect.io/evolve-hub/xpl/evolve-hub_lists-by-role.xpl"/>

Dependencies

Synopsis

<hub:evolve-hub_lists-by-role xmlns:hub="http://transpect.io/hub">
  <p:input port="source" primary="true"/>
  <p:input port="parameters" sequence="true" primary="true"/>
  <p:input port="stylesheet"/>
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug-dir-uri'"/>
  <p:option name="debug-indent" select="'true'"/>
  <p:option name="status-dir-uri" select="'status-dir-uri'"/>
  <p:option name="fail-on-error" select="'no'"/>
  <p:option name="prefix" required="false" select="'evolve-hub/5'"/>
  <p:option name="hub-version" required="false" select="'1.2'"/>
</hub:evolve-hub_lists-by-role>

GitHub sync date: 2024-04-23+02:00