<?xml version="1.0" encoding="UTF-8"?><?xml-model href="../schemas/tei_all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?><?xml-model href="../schemas/tei_all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?><TEI xmlns="http://www.tei-c.org/ns/1.0" version="5.0" xml:id="pdfDev_about">
<teiHeader>
    <fileDesc>
      
      <titleStmt>
        <title>MoEML’s PDF Developer Documentation</title>
        <respStmt>
          <resp ref="#aut">Author<date notBefore="2018"/>
          </resp>
          <name ref="#ELHA1">Tracey El Hajj</name>
        </respStmt>
        <respStmt>
          <resp ref="#prg">Junior Programmer<date notBefore="2018"/>
          </resp>
          <name ref="#ELHA1">Tracey El Hajj</name>
        </respStmt>
        <respStmt>
          <resp ref="#prg">Programmer<date notBefore="2018"/>
          </resp>
          <name ref="#TAKE1">Joey Takeda</name>
        </respStmt><respStmt>
          <resp ref="#prg">Programmer<date notBefore="2011"/>
          </resp>
          <name ref="#HOLM3">Martin Holmes</name>
        </respStmt>
        <respStmt>
          <resp ref="#pmg">Project Manager<date notBefore="2016"/></resp>
          <name ref="#MCQU1">Ryann McQuarrie-Salik</name>
        </respStmt>
        <respStmt>
          <resp ref="#pdr">Project Director<date notBefore="1999"/>
          </resp>
          <name ref="#JENS1">Janelle Jenstad</name>
        </respStmt>
      </titleStmt>
      
      <publicationStmt>
        <publisher><title level="m">The Map of Early Modern London</title></publisher><idno type="URL">http://mapoflondon.uvic.ca/includes.xml</idno><pubPlace>Victoria, BC, Canada</pubPlace><address>
        <addrLine>Department of English</addrLine>
        <addrLine>P.O.Box 3070 STNC CSC</addrLine>
        <addrLine>University of Victoria</addrLine>
        <addrLine>Victoria, BC</addrLine>
        <addrLine>Canada</addrLine>
        <addrLine>V8W 3W1</addrLine>
    </address><date when="2016">2016</date><distributor>University of Victoria</distributor><idno type="ISBN">978-1-55058-519-3</idno><authority>
          <name ref="#JENS1">Janelle Jenstad</name>
          <email>london@uvic.ca</email>
        </authority><availability>
            <p>Copyright held by <title level="m">The Map of Early Modern London</title> on behalf of the contributors.</p>
            <licence target="http://creativecommons.org/licenses/by-sa/4.0/">
              <p>This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. </p>
            </licence>
            <p>Further details of licences are available from our
              <ref target="licence.xml">Licences</ref> page. For more
              information, contact the project director, <name ref="#JENS1">Janelle Jenstad</name>, for
              specific information on the availability and licensing of content
              found in files on this site.</p>
        </availability>
      </publicationStmt>
      
      
    <notesStmt><note xml:id="pdfDev_about_citationsByStyle"><listBibl>
<bibl type="ris"><code>Provider: University of Victoria
Database: The Map of Early Modern London
Content: text/plain; charset="utf-8"

TY  - ELEC
A1  - El Hajj, Tracey
ED  - Jenstad, Janelle
T1  - MoEML’s PDF Developer Documentation
T2  - The Map of Early Modern London
ET  - 7.0
PY  - 2022
DA  - 2022/05/05
CY  - Victoria
PB  - University of Victoria
LA  - English
UR  - https://mapoflondon.uvic.ca/edition/7.0/pdfDev_about.htm
UR  - https://mapoflondon.uvic.ca/edition/7.0/xml/standalone/pdfDev_about.xml
TY  - UNP
ER  - </code></bibl>
<bibl type="mla"><author><name ref="#ELHA1"><surname>El Hajj</surname>, <forename>Tracey</forename></name></author>. <title level="a">MoEML’s PDF Developer Documentation</title>. <title level="m">The Map of Early Modern London</title>, Edition <edition>7.0</edition>, edited by <editor><name ref="#JENS1"><forename>Janelle</forename> <surname>Jenstad</surname></name></editor>, <publisher>U of Victoria</publisher>, <date when="2022-05-05">05 May 2022</date>, <ref target="https://mapoflondon.uvic.ca/edition/7.0/pdfDev_about.htm">mapoflondon.uvic.ca/edition/7.0/pdfDev_about.htm</ref>. Draft.</bibl>
<bibl type="chicago"><author><name ref="#ELHA1"><surname>El Hajj</surname>, <forename>Tracey</forename></name></author>. <title level="a">MoEML’s PDF Developer Documentation</title>. <title level="m">The Map of Early Modern London</title>, Edition <edition>7.0</edition>. Ed. <editor><name ref="#JENS1"><forename>Janelle</forename> <surname>Jenstad</surname></name></editor>. <pubPlace>Victoria</pubPlace>: <publisher>University of Victoria</publisher>. Accessed <date when="2022-05-05">May 05, 2022</date>. <ref target="https://mapoflondon.uvic.ca/edition/7.0/pdfDev_about.htm">mapoflondon.uvic.ca/edition/7.0/pdfDev_about.htm</ref>. Draft.</bibl>
<bibl type="apa"><author><name><surname>El Hajj</surname>, <forename>T.</forename></name></author> <date when="2022-05-05">2022</date>. <title>MoEML’s PDF Developer Documentation</title>. In <editor><name ref="#JENS1"><forename>J.</forename> <surname>Jenstad</surname></name></editor> (Ed), <title level="m">The Map of Early Modern London</title> (Edition <edition>7.0</edition>). <pubPlace>Victoria</pubPlace>: <publisher>University of Victoria</publisher>. Retrieved  from <ref target="https://mapoflondon.uvic.ca/edition/7.0/pdfDev_about.htm">https://mapoflondon.uvic.ca/editions/7.0/pdfDev_about.htm</ref>. Draft.</bibl>
</listBibl></note></notesStmt><sourceDesc><bibl>Born Digital</bibl></sourceDesc></fileDesc>
    <profileDesc>
      <textClass>
        <catRef scheme="includes.xml#molDocumentTypes" target="includes.xml#mdtBornDigital"/>
        <catRef scheme="includes.xml#molDocumentTypes" target="includes.xml#mdtDocumentationProgramming"/>
      </textClass>
    <calendarDesc>
<!--        JT deleted calendar/@xml:id='julian' April 28, 2018.-->
<!--        
        <calendar xml:id="julian" n="Julian">    
          <p>TO BE DEPRECATED. DO NOT USE: The Julian calendar, in use in the British Empire until September 1752. Sometimes
            referred to as <quote>Old Style</quote> (OS). Years run from March 25 through March 24.</p>
        </calendar>-->
        <!--These are new calendars, whose full rendering is not yet implemented.-->
        <calendar xml:id="julianSic" n="Julian Sic">
          <p>The Julian calendar, in use in the British Empire until September 1752. This calendar is used for
          dates where the date of the beginning of the year is ambigious.</p>
        </calendar>
        <calendar xml:id="julianJan" n="Julian (Regularized to 1 January)">
          <p>The Julian calendar with the calendar year regularized to beginning on 1 January.</p>
        </calendar>
        <calendar xml:id="julianMar" n="Julian (Regularized to 25 March)">
          <p>The Julian calendar with the calendar year beginning on 25 March. This was the
          calendar used in the British Empire until September 1752.</p>
        </calendar>
        <calendar xml:id="gregorian" n="Gregorian">
          <p>The Gregorian calendar, used in the British Empire from September 1752. Sometimes
            referred to as <mentioned>New Style</mentioned> (NS). Years run from January 1 through December 31.</p>
        </calendar>
        <calendar xml:id="annoMundi" n="Anno Mundi">
          <p>The Anno Mundi (<quote>year of the world</quote>) calendar is based on the supposed date of the
            creation of the world, which is calculated from Biblical sources. At least two different
            creation dates are in common use. See <ref target="https://en.wikipedia.org/wiki/Anno_Mundi">Anno Mundi</ref> (Wikipedia).</p>
        </calendar>
        <calendar xml:id="regnal" n="Regnal">
          <p>Regnal dates are given as the number of years into the reign of a particular monarch.
            Our practice is to tag such dates with <att>calendar</att>=<val>regnal</val>, and provide an
            equivalent date using a more systematic calendar (usually Julian) in a custom dating
            attribute.</p>
        </calendar>
      </calendarDesc><particDesc><listPerson><person xml:id="MCQU1">
      <persName type="cont">
       <reg>Ryann McQuarrie-Salik</reg>
       <forename>Ryann</forename>
       <surname>McQuarrie-Salik</surname>
       <abbr>RM</abbr>
      </persName>
      <note>
       <p>Project Manager, 2020.</p>
      </note>
     </person><person xml:id="ELHA1">
      <persName type="cont">
       <reg>Tracey El Hajj</reg>
       <forename>Tracey</forename>
       <surname>El Hajj</surname>
       <abbr>TEH</abbr>
      </persName>
      <note>
       <p>Junior Programmer 2018-2020. Research Associate 2020-2021. Tracey received her PhD from the Department of English at the University of Victoria in the field of Science and Technology Studies. Her research focuses on the <term>algorhythmics</term> of networked communications. She was a 2019-20 President’s Fellow in Research-Enriched Teaching at UVic, where she taught an advanced course on <title level="a">Artificial Intelligence and Everyday Life.</title> Tracey was also a member of the <title level="m">Linked Early Modern Drama Online</title> team, between 2019 and 2021. Between 2020 and 2021, she was a fellow in residence at the Praxis Studio for Comparative Media Studies, where she investigated the relationships between artificial intelligence, creativity, health, and justice. As of July 2021, Tracey has moved into the alt-ac world for a term position, while also teaching in the English Department at the University of Victoria.</p>
      </note>
     </person><person xml:id="TAKE1">
      <persName type="cont">
       <reg>Joey Takeda</reg>
       <forename>Joey</forename>
       <surname>Takeda</surname>
       <abbr>JT</abbr>
      </persName>
      <note>
       <p>Programmer, 2018-present. Junior Programmer, 2015-2017. Research Assistant, 2014-2017.
        Joey Takeda was a graduate student at the University of British Columbia in the Department
        of English (Science and Technology research stream). He completed his BA honours in English
        (with a minor in Women’s Studies) at the University of Victoria in 2016. His primary
        research interests included diasporic and indigenous Canadian and American literature,
        critical theory, cultural studies, and the digital humanities.</p>
      </note>
     </person><person xml:id="JENS1">
      <persName type="cont">
       <reg>Janelle Jenstad</reg>
       <forename>Janelle</forename>
       <surname>Jenstad</surname>
       <abbr>JJ</abbr>
      </persName>
      <note>
       <p>Janelle Jenstad is Associate Professor of English at the University of Victoria, Director
        of <title level="m">The Map of Early Modern London</title>, and PI of <title level="m">Linked Early Modern Drama Online</title>. She has taught at Queen’s University, the Summer
        Academy at the Stratford Festival, the University of Windsor, and the University of
        Victoria. With Jennifer Roberts-Smith and Mark Kaethler, she co-edited <title level="m">Shakespeare’s Language in Digital Media</title> (<ref target="https://www.routledge.com/Shakespeares-Language-in-Digital-Media-Old-Words-New-Tools/Jenstad-Kaethler-Roberts-Smith/p/book/9781472427977">Routledge</ref>). She has prepared a documentary edition of John Stow’s <title level="m">A
         Survey of London</title> (1598 text) for MoEML and is currently editing <title level="m">The Merchant of Venice</title> (with Stephen Wittek) and Heywood’s <title level="m">2 If
         You Know Not Me You Know Nobody</title> for DRE. Her articles have appeared in <title level="j">Digital Humanities Quarterly</title>, <title level="j">Renaissance and
         Reformation</title>,<title level="j">Journal of Medieval and Early Modern Studies</title>,
         <title level="j">Early Modern Literary Studies</title>, <title level="j">Elizabethan
         Theatre</title>, <title level="j">Shakespeare Bulletin: A Journal of Performance
         Criticism</title>, and <title level="j">The Silver Society Journal</title>. Her book
        chapters have appeared (or will appear) in <title level="m">Institutional Culture in Early
         Modern Society</title> (Brill, 2004), <title level="m">Shakespeare, Language and the Stage,
         The Fifth Wall: Approaches to Shakespeare from Criticism, Performance and Theatre
         Studies</title> (Arden/Thomson Learning, 2005), <title level="m">Approaches to Teaching
         Othello</title> (Modern Language Association, 2005), <title level="m">Performing Maternity
         in Early Modern England</title> (Ashgate, 2007), <title level="m">New Directions in the
         Geohumanities: Art, Text, and History at the Edge of Place</title> (Routledge, 2011), Early
        Modern Studies and the Digital Turn (Iter, 2016), <title level="m">Teaching Early Modern
         English Literature from the Archives</title> (MLA, 2015), <title level="m">Placing Names:
         Enriching and Integrating Gazetteers</title> (Indiana, 2016), <title level="m">Making
         Things and Drawing Boundaries</title> (Minnesota, 2017), and <title level="m">Rethinking
         Shakespeare’s Source Study: Audiences, Authors, and Digital Technologies</title>
        (Routledge, 2018).</p>
      </note>
     </person><person xml:id="HOLM3">
      <persName type="cont">
       <reg>Martin D. Holmes</reg>
       <forename>Martin</forename>
       <forename>D.</forename>
       <surname>Holmes</surname>
       <abbr>MDH</abbr>
      </persName>
      <note>
       <p>Programmer at the University of Victoria Humanities Computing and Media Centre (HCMC).
        Martin ported the MOL project from its original PHP incarnation to a pure eXist database
        implementation in the fall of 2011. Since then, he has been lead programmer on the project
        and has also been responsible for maintaining the project schemas. He was a co-applicant on
        MoEML’s 2012 SSHRC Insight Grant.</p>
      </note>
     </person></listPerson></particDesc></profileDesc>
    
    <encodingDesc>
      <listPrefixDef>
        <prefixDef ident="mol" matchPattern="(.+)(#.+)?" replacementPattern="../../$1.htm$2">
          <p>Most MoEML documents, or significant fragments with <att>xml:id</att> attributes, can
            be addressed using the <code>mol:</code> prefix and accessed through the web application
            with their id + <code>.xml</code>.</p>
        </prefixDef>
        <prefixDef ident="molagas" matchPattern="(.+)" replacementPattern="https://mapoflondon.uvic.ca/agas.htm?locIds=$1">
          <p>The molagas prefix points to the shape representation of a location on 
            MoEML’s OpenLayers3-based
          rendering of the Agas Map.</p>
        </prefixDef>
        <prefixDef ident="moleebo" matchPattern="([0-9]+)\|([0-9]+)" replacementPattern="http://eebo.chadwyck.com/fetchimage?vid=$1&amp;page=$2&amp;width=1200">
          <p>Links to page-images in the Chadwyck-Healey <title level="m">Early English Books Online</title> (EEBO)
            repository. Note that this is a subscription service, and may not be accessible to those
            accessing it from locations outside member institutions.</p>
        </prefixDef>
        <prefixDef ident="molebba" matchPattern="(.+)" replacementPattern="http://ebba.english.ucsb.edu/ballad/$1">
          <p>Links to page-images in the <title level="m">English Broadside Ballad Archive</title> (EBBA).</p>
        </prefixDef>
        <prefixDef ident="mdt" matchPattern="(.+)" replacementPattern="includes.xml#$1">
          <p>The mdt (MoEML Document Type) prefix used on <gi>catRef</gi>/<att>target</att> points
            to a central taxonomy in the includes file.</p>
        </prefixDef>
        <prefixDef ident="mdtlist" matchPattern="(.+)" replacementPattern="$1.xml">
          <p>The mdtlist (MoEML Document Type listing) prefix used in linking attributes points to a listings page constructed from a category in the central MDT taxonomy in the includes file. There are two variants, one with the plain <att>xml:id</att> of the category, meaning all documents in the specified category, and one with the suffix <q>_subcategories</q>, meaning all subcategories of the category.</p>
        </prefixDef>
        <prefixDef ident="molgls" matchPattern="(.+)" replacementPattern="GLOSS1.xml#$1">
          <p>The molgls (MoEML gloss) prefix used on <gi>term</gi>/<att>corresp</att> points
            to a a glossary entry in the GLOSS1.xml file.</p>
        </prefixDef>
        <prefixDef ident="molvariant" matchPattern="(.*)\|(.+)" replacementPattern="spelling_variants.xml#$2">
          <p>This molvariant prefix is used on <gi>ref</gi>/<att>target</att> attributes during automated 
          generation of gazetteer index files. It points to an element in the generated variant spellings
          listing file which lists all documents which contain a particular spelling variant for a 
          location.</p>
        </prefixDef>
        <prefixDef ident="molajax" matchPattern="(.+)" replacementPattern="../../ajax/$1.xml">
          <p>This molajax prefix is used on <gi>ref</gi>/<att>target</att> attributes during the static build 
          process, to specify links which point to MoEML resources which should not be loaded into the source 
          page during standalone processing; instead, these should be turned into links to the XML source 
          documents, and at HTML page load time, these should be turned into AJAX calls. This is to handle 
          the scenario in which a page such as an A-Z index of the whole site would end up containing 
          virtually the whole site inside itself.</p>
        </prefixDef>
        <prefixDef ident="molstow" matchPattern="(.+)|(.+)" replacementPattern="https://hcmc.uvic.ca/stow/$1/SL$1_$2.jpg">
          <p>The molstow prefix is used on <att>facs</att> attributes to link to the HCMC verison of the Stow facsimiles.
          Usually the first group is the year (1633) and then last is the image number (0001).</p>
        </prefixDef>
        
        <prefixDef ident="molshows" matchPattern="([^\|]+)\|([^\|]+)\|([^\|]+)" replacementPattern="https://hcmc.uvic.ca/~london/images/shows/$1/$2/$3.jpg">
          <p>The molshows prefix is used on <att>facs</att> attributes to link to the copies of page-images
            from mayoral shows stored in the london account on the HCMC server.
            The first group is the year (1633), the second is the source repository, and then last is the image
            file name.</p>
        </prefixDef>
        
        <prefixDef ident="sb" matchPattern="(.+)" replacementPattern="https://johnstowsbooks.library.utoronto.ca/admin/items/show/$1">
          <p>The sb prefix is used on <gi>ref</gi>/<att>target</att> attributes to link to 
          Stow’s Books URLs at UToronto.</p>
        </prefixDef>
      </listPrefixDef>
      <p>
        Our editorial and encoding practices are documented
        in detail in the <ref target="praxis.xml">Praxis</ref>
        section of our website.
      </p>
    <classDecl><taxonomy xml:id="marcRelators"><category xml:id="aut">
      <catDesc>
       <term>Author</term>
       <gloss type="marcRelator" target="http://id.loc.gov/vocabulary/relators/aut.html">A person or
        organization chiefly responsible for the intellectual or artistic content of a work, usually
        printed text. This term may also be used when more than one person or body bears such
        responsibility. </gloss>
       <gloss type="mol">MoEML uses the term <mentioned>author</mentioned> to designate a
        contributor who is wholly or partly responsible for the original content of either a
        born-digital document, such as an encyclopedia entry, or a primary source document, such as
        a MoEML Library text.</gloss>
      </catDesc>
     </category><category xml:id="pdr">
      <catDesc>
       <term>Project director</term>
       <gloss type="marcRelator">A person or organization with primary responsibility for all
        essential aspects of a project, or that manages a very large project that demands senior
        level responsibility, or that has overall responsibility for managing projects, or provides
        overall direction to a project manager.</gloss>
       <gloss type="mol">MoEML’s Project Director directs the intellectual and scholarly aspects of
        the project, consults with the Advisory and Editorial Boards, and ensures the ongoing
        funding of the project.</gloss></catDesc>
     </category><category xml:id="prg">
      <catDesc>
       <term>Programmer</term>
       <gloss type="marcRelator">A person or organization responsible for the creation and/or
        maintenance of computer program design documents, source code, and machine-executable
        digital files and supporting documentation.</gloss>
       <gloss type="mol">MoEML uses the term <mentioned>programmer</mentioned> to designate a person
        or organization responsible for the creation and/or maintenance of computer program design
        documents, source code, and machine-executable digital files and supporting
        documentation.</gloss></catDesc>
     </category></taxonomy><taxonomy xml:id="molRelators"><category xml:id="pmg">
      <catDesc>
       <term>Project manager</term>
       <gloss type="mol">MoEML uses the term <mentioned>Project Manager</mentioned> for a person who
        handles the administration for the project.</gloss>
      </catDesc>
     </category></taxonomy></classDecl></encodingDesc>
    
    
    <revisionDesc status="draft">
      <change who="#ELHA1" when="2020-06-02">Created document.</change>
    </revisionDesc>
  </teiHeader><text>
    <front>
      <docTitle>
        <titlePart type="main">
          MoEML’s PDF Developer Documentation
        </titlePart>
      </docTitle>
    </front>
    <body>
      <div xml:id="pdfDev_about_files">
        <head><code>XSLT</code> files responsible for creating MoEML PDFs:</head>
        <list>
          <item><code>pdf_globals.xsl</code></item>
          <item><code>createPdfs.xml</code> (ant application)</item>
          <item><code>add_special_styles_to_fo_master.xsl</code></item>
          <item><code>get_attribute_sets_names.xsl</code></item>
          <item><code>list_classes_for_pdf.xsl</code></item>
          <item><code>list_fonts_for_pdf.xsl</code></item>
          <item><code>list_images_for_pdf.xsl</code></item>
          <item><code>xhtml5_to_fo_master.xsl</code></item>
          <item><code>xhtml5_to_fo_styles_module.xsl</code></item>
        </list>
        <p>This documentation goes through the <code>XSL</code> and <code>XML</code> files responsible for building the PDFs.</p>
      </div>
      <div xml:id="pdfDev_about_globals">
        <head><code>pdf_globals.xsl</code></head>
        <p>The <code>pdf_globals</code> is an <code>XSL</code> file that contains the variables, parameters, and functions necessary for the creation of every PDF. <code>$docId</code> is the variable that gets the <code>xml:id</code> of the document, so that we can use it to build this particular file and all of its required components. <code>$attSetDoc</code> is a variable that gets the docId-specific styling module and the master styling module (used later to assign corresponding attribute sets as per the respective classes). Two parameters assign the locations of necessary folders: the <code>FO</code> folder and the output folder. Two other parameters get the titles of the document at hand: one for born digital files and one for primary sources. <code>pdf_globals</code> also contains a function, <code>getAtts</code>, that allows us to add attributes from the class’ corresponding attribute sets, in addition to the attributes that are unique to the class, which we retrieve from the style element in the original <code>HTML</code> source document. This function finds the appropriate attributes selected in the master styles module, and then finds the document specific attribute sets. Attributes get added if they were not already, and if they are already written in, they get overwritten by the specific styling. The same function also manipulates some attributes and their values, to accommodate the <code>FO</code> restrictions, such as <code>rem</code> (replaced with <code>pt</code>), and the small-caps font variant, which gets a specific font-family selected for this particular purpose.</p>
      </div>
      <div xml:id="pdfDev_about_createPdf">
        <head><code>createPdfs.xml</code></head>
        <p><code>createPdfs.xml</code> is the Ant application that builds the selected PDFs. This file runs through the terminal application. It checks for <code>FOP</code>; if it is not available it gets downloaded. If <code>FOP</code> is downloaded, it checks whether or not it is up to date and updates it if need be. Images and fonts folders are defined in properties, to be used later in retrieving the appropriate material. The <code>listFiles</code> property lists the document ids that need to be built into PDFs.</p>
        <p>The Ant application creates a list of images mentioned and used in the source documents and then downloads said images. The same process is applied to the fonts. In addition, the ant application runs the following targets:</p>
        <list rend="bulleted">
          <item>
            <label><code>createSpecialStylesModule</code></label>
            <p>Creates a special styles module, particular to the document that is being processed. This special module contains the formatting from the <gi>html</gi>/<gi>head</gi>/<gi>style</gi> element.</p>
          </item>
          <item>
            <label><code>addSpecialModulesToMaster</code></label>
            <p>Adds the special module to other <code>XSLT</code>s responsible for the creation of the PDFs.</p>
          </item>
          <item>
            <label><code>ValidateFo</code></label>
            <p>Validates the resulting <code>FO</code> document.</p>
          </item>
          <item>
            <label><code>getSourceFileFromJenkins</code></label>
            <p>Is responsible for retrieving the source <code>HTML</code> file from our server.</p>
          </item>
          <item>
            <label><code>processOneFile</code></label>
<p>Is the main (though not the default) target that processes the file (<code>docId</code>) in the following order: gets the file from Jenkins, creates the special styles module, adds the special module to the master module, creates the images list, copies the images, creates the fonts list, copies the fonts, creates the <code>FO</code> file, creates the PDF, and finally gets the <code>.png</code> of the title (cover) page (which is used in the creation of ePubs).</p>
          </item>
          <item>
            <label><code>createFO</code></label>
            <p>Creates the <code>XSL:FO</code> file from the <code>HTML</code> source file, as per the <code>docId_xhtml5_to_fo</code> transformation.</p>
          </item>
          <item>
            <label><code>createPdf</code></label>
            <p>Creates the PDF file from the <code>docID.fo</code> file using the <code>FOP</code> application.</p>
          </item>
          <item>
            <label><code>getTitlePage</code></label>
            <p>Gets the PDF’s title page in <code>.png</code> format, so we can use it for the ePubs. For this we use <code>pdftoppm</code> execution.</p>
          </item>
          <item>
            <label><code>buildFiles</code></label>
            <p>Is the default target; it runs <code>processOneFile</code> to build all the documents listed in the listFiles property.</p>
          </item>
        </list>
      </div>
      <div xml:id="pdfDev_about_addSpecialStyles">
        <head><code>add_special_styles_to_fo_master.xsl</code></head>
        <p>This <code>XSL</code> transformation is designed to include a special <code>XSL</code> styles module in the <code>xhtml5_to_fo_master</code>. It does so by creating a variable that gets the attributes from the special styles module. The file has templates that match onto the following elements: <gi>div</gi>, <gi>span</gi>, and <gi>img</gi>. These templates find the classes and their corresponding attribute sets to add the necessary attributes and their values, and apply other templates as required.</p>
      </div>
      <div xml:id="pdfDev_about_getAttributes">
        <head><code>get_attribute_sets_names.xsl</code></head>
        <p>This stylesheet is a rather simple one that reads the special styles module (<code>docId_styles_module.xsl</code>) and gets the attribute sets that need to be used. It stores them in an output file <code>listOfSets.txt</code> which gets used in <code>xhtml5_to_fo_master.xsl</code>.</p>
      </div>
      <div xml:id="pdfDev_about_listClasses">
        <head><code>list_classes_for_pdf.xsl</code></head>
        <p>This <code>XSL</code> transformation is designed to read the <gi>style</gi> element in the <code>HTML</code> file and list the styling classes needed for the particular PDF being built. It starts by parsing the <gi>style</gi> element as a string, stored in a variable (<code>$style</code>). The variable <code>$parsedClasses</code> stores the name of the classes so that we use them later in naming the attribute-sets. <code>$attribute</code> is the variable that has the attribute names as well as their values.</p>
        <p>The root template of this transformation creates the attribute sets corresponding to classes mentioned in the style element of the source file. It results in a document saved in <code>db/data/static/xsl</code> called <code>$docId_styles_module.xsl</code>. The template recreates the following variables: <code>parsedClasses</code>, and <code>parsedStyle</code>.</p>
      </div>
      <div xml:id="pdfDev_about_listFonts">
        <head><code>list_fonts_for_pdf.xsl</code></head>
        <p>This <code>XSLT</code> is designed to read the <code>CSS</code> files and list the fonts needed for the particular PDF being built. We adopt it from the transformation designed for ePubs. The root (main) template creates a list of fonts mentioned in the corresponding <code>CSS</code> files, to be then used by the ant file to copy these fonts into the PDF container folder. It first creates a variable that lists the css files. The files are then tokenized in $tokenizedCss and normalized in <code>$allCss</code>. The variable <code>$parsedCssFonts</code> results in a document <code>listOfFonts.txt</code> that contains <code>$distinctSiteFonts</code>, which gets the distinct values of the <code>$parsedCssFonts</code> variable.</p>
      </div>
      <div xml:id="pdfDev_about_listImages">
        <head><code>list_images_for_pdf.xsl</code></head>
        <p>This <code>XSLT</code> reads the <code>XHTML</code> and <code>CSS</code> files and list the images needed for the particular PDF being built. It is very similar in its structure to <code>list_fonts_for_pdf.xsl</code>: The root template creates a list of images mentioned in the corresponding <code>CSS</code> files as well as the <code>XHTML</code> file, to be then used by the ant file to copy these images into the PDF container folder. This template first creates a variable that lists the <code>CSS</code> files. The files are then tokenized in <code>$tokenizedCss</code> and normalized in <code>$allCss</code>. The variable <code>$parsedCssImages</code> results in a document <code>listOfImages.txt</code> that contains <code>$distinctSiteImages</code>, which gets the distinct values of the <code>$parsedCssImages</code> variable. This transformation also has a few hard coded images, given that they are not present in the <code>CSS</code> or <code>XHTML</code> files.</p>
      </div>
      <div xml:id="pdfDev_about_xhtmlToFo">
        <head><code>xhtml5_to_fo_master.xsl</code></head>
        <p>This <code>XSLT</code> is designed to convert a MoEML <code>XHTML5</code> static site document into a PDF. It converts the document to <code>XSL:FO</code>, validates the <code>FO</code>, and then the calling Ant script uses <code>FOP</code> to generate a PDF. This file includes the styles module <code>xhtml5_to_fo_styles_module.xsl</code> (discussed below), and <code>pfd_globals.xsl</code>. The root template sets up the <code>FO</code> basics: four simple page masters (title page, first page, recto page, and verso page). The sequence of pages follows. The <soCalled>main</soCalled> page-sequence contains the footers (title page, recto, and verso) and headers (recto and verso). The headers differ in their code as per born digital or primary source, because of the structure of their titles. The template that matches on the <gi>html</gi> element applies templates (both named and unnamed as discussed below).
          <list rend="bulleted">
            <item>
              <label>CreateTitlePage</label>
              <p>This template processes the metadata in the page header to get the key information. The aesthetic and stylistic components include: a background image, two flower logos (top and bottom), decorative lines (top and bottom) between which the title of the document sits, and a snippet of the agas map. The size of the title and the authors depends on the length of the title and the number of authors listed. The title page also contains the edition information (which is basically the release version at the time of the build).</p>
            </item>
            <item>
              <label>CreateHybridTitlePage</label>
              <p>This named template creates another title page that contains hybrid metadata, which includes the title, authors, compilers, and editors, in addition to the publication information. This template contains two conditions: one is when the document at hand is a born digital file, and the other is when it is a primary source file.</p>
            </item>
          </list>
        </p>
      </div>
      <div xml:id="pdfDev_about_unnamedTemplates">
        <head>Unnamed Templates</head>
        <list rend="bulleted">
          <item>
            <label>Matches <gi>div</gi></label>
            <p><gi>div</gi>s are transformed into <gi>fo:blocks</gi>. Their ids are replicated into <att>id</att> attributes. Depending on the class attribute of the <gi>div</gi>, the <gi>fo:block</gi> element gets assigned the appropriate attribute set(s). <gi>div</gi>s that are children or descendant of the appendix <gi>div</gi>, get special attribute sets that correspond to the appendix styling of the PDF.
            </p>
          </item>
          <item>
            <label>Matches <gi>nav</gi></label>
            <p><gi>nav</gi> elements are transformed into <gi>fo:blocks</gi>, and their ids are copied into corresponding <att>id</att> attributes.
            </p>
          </item>
          <item>
            <label>Matches <gi>ul</gi></label>
            <p><gi>ul</gi> elements are transformed into <gi>fo:list-block</gi> elements. Their ids are replicated into corresponding <att>id</att> attributes. <gi>ul</gi>s that are descendant of the appendix get special styling to correspond with the appendix styles.
            </p>
          </item>
          <item>
            <label>Matches <gi>ol</gi></label>
            <p><gi>ol</gi> elements are transformed into <gi>fo:list-block</gi> elements. Their ids are replicated into corresponding <att>id</att> attributes. <gi>ol</gi>s that are descendant of the appendix get special styling to correspond with the appendix styles.</p>
          </item>
          <item>
            <label>Matches <gi>li</gi></label>
            <p><gi>li</gi> elements are transformed into <gi>fo:list-item</gi> elements. Every <gi>fo:list-item</gi> contains an <gi>fo:list-item-label</gi> and an <gi>fo:list-item-body</gi>. Depending on their level in the list structure, <gi>fo:list-item-label</gi> and <gi>fo:list-item-body</gi> elements get the following attribute sets, respectively: <code>list-item-label</code> and <code>list-item-body</code>, <code>list-item-label-descendant</code> and <code>list-item-body-descendant</code>, <code>list-item-label-level3</code> and <code>list-item-body-level3</code>, <code>list-item-label-appendix</code> and <code>list-item-body-appendix</code>. In tables, <gi>fo:list-item-label</gi> and <gi>fo:list-item-body</gi> get attribute sets <code>list-item-label-table</code> and <code>list-item-body-table</code>, respectively. The page menu <gi>fo:list-item</gi> gets the attribute set <code>pageMenu</code>.</p>
          </item>
          <item>
            <label>Matches <gi>table</gi></label>
            <p><gi>table</gi>s are transformed into <gi>fo:table</gi>. When the table has a class attribute <code>contentTable</code>, the <gi>fo:table</gi> element gets the <code>contentTable</code> attribute set.</p>
          </item>
          <item>
            <label>Matches <gi>thead</gi></label>
            <p><gi>thead</gi>s are transformed into <gi>fo:table-header</gi> elements, with attribute set <code>table-head-td</code>.</p>
          </item>
          <item>
            <label>Matches <gi>tbody</gi></label>
            <p><gi>tbody</gi> elements are transformed into <gi>fo:table-body</gi> elements.</p>
          </item>
          <item>
            <label>Matches <gi>tr</gi></label>
            <p><gi>tr</gi> elements are transformed into <gi>fo:table-row</gi> elements.</p>
          </item>
          <item>
            <label>Matches <gi>td</gi></label>
            <p><gi>td</gi> elements are transformed into <gi>fo:table-cell</gi> elements. <gi>td</gi> elements with parents or ancestor <gi>thead</gi> elements acquire the attribute set <code>table-head-td</code>; if the <gi>td</gi> element has an ancestor <gi>table</gi> that has attribute class <code>contentTable</code>, the <gi>fo:table-cell</gi> gets the attribute set <code>contentTable-td</code>; otherwise, <gi>fo:table-cell</gi> elements get the <code>table-cell</code> attribute set.</p>
          </item>
          <item>
            <label>Matches <gi>a</gi></label>
            <p><gi>a</gi> elements are transformed into <gi>fo:basic-links</gi>, with attributes: <att>id</att>(if applicable), <att>external-destination</att> or <att>internal-destination</att> for the value of the <att>href</att> attribute of the <gi>a</gi> element, and color. If <gi>href</gi> ends with <code>.htm</code>, or contains <code>http</code>, <code>jpg</code>, <code>mp3</code>, the <gi>fo:basic-link</gi> gets an external destination attribute. The <gi>fo:basic-link</gi> also gets an <att>external-destination</att> attribute and other appropriate styling attributes, if the <gi>a</gi> element has a <att>class</att> attribute that is not <code>noteMarker</code> nor <code>returnFromNote</code> nor <code>local</code>. Otherwise, <gi>fo:basic-link</gi> gets an <att>internal-destination</att> attribute.</p>
          </item>
          <item>
            <label>Matches <gi>a</gi><code>[@href[starts-with(., ‘#’)]][not(@class= ‘pilcrow’)]</code></label>
            <p>This template is responsible for links that refer to ids, mostly with internal references. We use the variable <code>$thisid</code> to identify the <att>id</att> of the current <gi>a</gi> element. If <code>$thisid</code> is not stated anywhere else in the document, then the <code>fo:basic-link</code> will have an <att>external-destination</att>, with https://mapoflondon.uvic.ca/$thisid.htm. Otherwise, the <gi>fo:basic-link</gi> will have an internal destination, without the #, and with the appropriate attribute sets as per the class attributes.</p>
          </item>
          <item>
            <label>Matches <gi>p</gi></label>
            <p><gi>p</gi> elements become <gi>fo:blocks</gi>.</p>
          </item>
          <item>
            <label>Matches <gi>span</gi></label>
            <p><gi>span</gi> elements become <gi>fo:inline</gi> elements.</p>
          </item>
          <item>
            <label>Matches <gi>strong</gi></label>
            <p><gi>strong</gi> elements become <gi>fo:block</gi> elements when they have a parent element <gi>li</gi>, and <gi>fo:inline</gi> elements otherwise.</p>
          </item>
          <item>
            <label>Matches <gi>pre</gi></label>
            <p><gi>pre</gi> elements become <gi>fo:block</gi> elements when they have a parent element <gi>li</gi>, and <gi>fo:inline</gi> elements otherwise.
            </p>
          </item>
          <item>
            <label>Matches <gi>q</gi></label>
            <p><gi>q</gi> elements become <gi>fo:block</gi> elements when they have a parent element <gi>li</gi>, and <gi>fo:inline</gi> elements otherwise.</p>
          </item>
          <item>
            <label>Matches <gi>blockquote</gi></label>
            <p><gi>blockquote</gi> elements become <gi>fo:block</gi> elements with the <code>blockquote</code> attribute set.</p>
          </item>
          <item>
            <label>Matches <gi>code</gi></label>
            <p><gi>code</gi> elements are transformed into <gi>fo:inline</gi> elements with the <code>code</code> attribute set.</p>
          </item>
          <item>
            <label>Matches <gi>img</gi></label>
            <p><gi>img</gi> elements are transformed into <gi>fo:external-graphic</gi> elements. They all have the <code>images</code> attribute set, and when appropriate, they have an additional attribute set that corresponds to their appropriate class, including <code>acknowledgementImg</code> and <code>socialMediaImg</code>.</p>
          </item>
          <item>
            <label>Matches <gi>figure</gi></label>
            <p><gi>figure</gi> elements are transformed into <gi>fo:block</gi> elements.</p>
          </item>
          <item>
            <label>Matches <gi>figcaption</gi></label>
            <p><gi>ficgaption</gi> elements are transformed into <gi>fo:block</gi> elements. When the <gi>figcaption</gi> element contains the strings <soCalled>horizontal rule</soCalled> or <soCalled>Printer’s ornament</soCalled>, the <gi>fo:block</gi> element gets the attribute set <code>figcaption_special</code>; otherwise it gets the attribute set <code>figcaption</code>.</p>
          </item>
          <item>
            <label>Matches <gi>h1</gi></label>
            <p><gi>h1</gi> elements are transformed into <gi>fo:block</gi> elements. When <gi>h1</gi> has a child <gi>span</gi> that has a <att>class</att> attribute <code>titlePart</code>, it gets both attribute sets <code>h1</code> and <code>h1TitlePart</code>, otherwise it only get the attribute set <code>h1</code>.</p>
          </item>
          <item>
            <label>Matches <gi>h2</gi></label>
            <p><gi>h2</gi> elements are transformed into <gi>fo:block</gi> elements. When they are appendix headers, they get the attribute set <code>appendixH2</code>, otherwise they get the attribute set <code>h2</code>.</p>
          </item>
          <item>
            <label>Matches <gi>h3</gi></label>
            <p><gi>h3</gi> elements are transformed into <gi>fo:block</gi> elements. When they are appendix headers, they get the attribute set <code>appendixH3</code>; when they are appendix list headers, they get the attribute set <code>appendixListH3</code>, otherwise they get the attribute set <code>h3</code>.</p>
          </item>
          <item>
            <label>Matches <gi>h4</gi></label>
            <p><gi>h4</gi> elements are transformed into <gi>fo:block</gi> elements. When they are appendix headers, they get the attribute set <code>appendixH4</code>, otherwise they get the attribute set <code>h4</code>.</p>
          </item>
          <item>
            <label>Matches <gi>br</gi></label>
            <p><gi>br</gi> elements are transformed into <gi>fo:block</gi> elements.</p>
          </item>
          <item>
            <label>Matches <gi>hr</gi></label>
            <p>[Primary Source Element] <gi>hr</gi> elements are transformed into <gi>fo:leader</gi> elements, with <att>id</att> attributes when appropriate.</p>
          </item>
        </list>
        <p>This transformation is also responsible for removing the following components from the document: the top banner, <soCalled>See XML</soCalled>, <soCalled>More Info</soCalled>, blackletter typeface and toggle, script elements, <soCalled>Send Feedback</soCalled>, the footer menu, the info popup, document mentions, person’s contributions, person’s mentions, the citation header, facsimile figures, links to <code>agas.css</code> and <code>agas_embedded.css</code> from the header, pilcrow (¶) links, and social media logos. It also replaces <code>lightbox.css</code> with <code>nav.css</code>, rewrites some links as necessary, renames <soCalled>Personography</soCalled> into <soCalled>Contributors</soCalled>, rearranges appendix lists (historical persons and variant spellings), and sorts the personography alphabetically.</p>
        <p>Note that there are other removals that happen through <code>add_special_styles_to_fo_master.xsl</code>.</p>
      </div>
      <div xml:id="pdfDev_about_styles">
        <head><code>xhtml5_to_fo_styles_module.xsl</code></head>
        <p>This <code>XSLT</code> module contains the styling and layout data for the <code>XHTML5</code> to <code>XSL:FO</code> transformation, which turns MoEML <code>XHTML5</code> static site pages into PDFs. We will set up the pages initially so recto and verso have slightly different margins, to allow for binding along the long edge. We may decide to eliminate this distinction at some point. This module works with the special one created for the particular files being transformed. It contains all the master attribute sets needed, which have been mostly inspired from the various MoEML site <code>CSS</code> files. The attribute sets in this document do not include attributes or values that do not agree with <code>XSL:FO</code> or <code>FOP</code>. The structure is straight-forward: the <gi>xsl:stylesheet</gi> element contains all <gi>xsl:attribute-set</gi> elements that must have a <att>name</att> attribute. These elements in turn contain <gi>xsl:attribute</gi> elements, which also must have a <att>name</att> attribute and a value.</p>
      </div>
    </body>
  </text></TEI>