title | author | date |
---|---|---|
read me |
Till Grallert |
2020-02-27 |
This repository contains a customisation of TEI Boilerplate adopted to the need of TEI editions of Arabic language material. In general, TEI Boilerplate provides a first display of TEI files in a web browser based on XSLT 1 and without the need for pre-processed HTML. Our customisation adds support for RTL scripts, a beautiful open source Arabic font (Khaled Hosny's Amiri font based on early 20th-century fonts developped by the Bulāq Press in Cairo), side-by-side display of text and facsimiles, a functional table of content, and links to the bibliographic metadata for every article (provided they are available). For a first impression see the included example file from "Digital Muqtabas".
The code has been developed in the context of the Digital Muqtabas, Digital Ḥaqāʾiq and Digital Manār projects.
In contrast to the original TEI Boilerplate, the display is built around modular xslt and css files that are all loaded through a central call to teibp_parameters.xsl
, teibp.css
and teibp_custom.css
.
In order to make use of XSLT 1 stylesheets in a web browser, one has to provide a link to the main stylesheet teibp_parameters
in the head of one's TEI files:
<?xml-stylesheet type="text/xsl" href="path-to-the-boilerplate-folder/teibp_parameters.xsl"?>
The boilerplate can be installed / used in three different ways:
- By downloading the latest release or cloning the "master" branch of this repository and integrating it into one's own project. This gives you full command over the display of your files, guarantees that no dependencies will be broken, and allows you to display TEI files using boilerplate without an active internet connection.
- By downloading only
xslt-boilerplate/teibp_parameters.xsl
from the "online" branch of this repository. This allows you to independently set various display parameters (see below) but otherwise make use of the current stylesheets as hosted on GitHub. - By linking
xslt-boilerplate/teibp_parameters.xsl
in thegh-pages
branch of this repository of this repository in the head of one's XML files:
<?xml-stylesheet type="text/xsl" href="https://openarabicpe.github.io/tei-boilerplate-arabic-editions/boilerplate/xslt/teibp_parameters.xsl"?>
NOTE 2018-11-12: Since http://rawgit.com is shutting down, the following is depreciated.
The repository comes with a (small) variety of standard settings all hosted in different branches that allow you to toggle between parameters. The two currently available branches are all set to display page breaks and facsimiles, to not display any line breaks, and to generate English interface text. They differ in which facsimiles are displayed:
- display online facsimiles:
<?xml-stylesheet type="text/xsl" href="https://rawgit.com/tillgrallert/tei-boilerplate-arabic-editions/online/xslt-boilerplate/teibp_parameters.xsl"?>
- display local facsimiles:
<?xml-stylesheet type="text/xsl" href="https://rawgit.com/tillgrallert/tei-boilerplate-arabic-editions/online-local-facsimiles/xslt-boilerplate/teibp_parameters.xsl"?>
Most features are toggled through parameters in xslt-boilerplate/teibp_parameters.xsl
.
<xsl:param name="p_display-page-breaks" select="true()"/>
<xsl:param name="p_display-online-facsimiles" select="true()"/>
<xsl:param name="p_display-line-breaks" select="true()"/>
Toggle between English and the language of your TEI encoded texts:
<xsl:param name="p_lang-interface-same-as-text" select="false()"/>
Currently our boilerplate supports English (as fall-back option) and Arabic, but one can easily add additional languages to all parameters that begin with p_text-
; e.g.
<xsl:param name="p_text-page">
<span class="c_teibp-pbNote" lang="{$v_lang-interface}">
<xsl:choose>
<xsl:when test="$v_lang-interface = 'ar'">
<xsl:text>صفحة</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>page</xsl:text>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:param>
To add another language just add another <xsl:when>
option; e.g.
<xsl:param name="p_text-page">
<span class="c_teibp-pbNote" lang="{$v_lang-interface}">
<xsl:choose>
<xsl:when test="$v_lang-interface = 'ar'">
<xsl:text>صفحة</xsl:text>
</xsl:when>
<xsl:when test="$v_lang-interface = 'de'">
<xsl:text>Seite</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>page</xsl:text>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:param>