Encode Advanced Style in Semi-Diplomatic Transcriptions
This documentation will teach you about LEMDOʼs practice for using advanced styling
options such as CSS Flex. It is designed for people who have previous experience using
CSS.
¶ Rationale
LEMDO has created a default stylesheet that should capture the basic composition and
mise-en-page of most early modern playbooks. Some playbooks deviate from this basic
mise-en-page in consistent ways, in which case you can use anthology-level CSS or
create renditions in the
<teiHeader>
of each individual file. Inline deviations from the anthology-level CSS or file-level
renditions can be described using inline CSS. If your playbook sporadically deviates
from the features described in our default stylesheet in a way that cannot be captured
by our pre-fabricated renditions or by regular CSS, use advanced CSS options such
as CSS Flex.¶ Principles
Only use the advanced CSS options outlined in this documentation if:
If you think that your file requires advanced CSS but you do not have the experience
necessary to use it, please contact lemdotech@uvic.ca.
Some aspect of your playbook deviates from LEMDOʼs default styling, your anthology’s
default styling, and any renditions in the
<teiHeader>
of your XML file.You cannot adequately capture the deviations using the options outlined in
Encode Inline Style in Semi-Diplomatic Transcriptions.
You have experience using CSS.
¶ Introduction to CSS Flex
CSS Flex allows us to truthfully encode and accurately render features that cannot
be captured by standard CSS.
CSS typically uses
blockformatting, which renders an element on the line below the previous element, or
inlineformatting, which renders an element on the same line as the previous element. CSS Flex allows for elements that do not fit either the block or inline format and are not tables. For example, although we could potentially encode long braces using a table with styling, that method would not be a truthful depiction of the page layout in early modern playbooks.
¶ CSS Flex Use Cases
We primarily use CSS Flex for inline long braces. There may be other features that
are best captured by CSS Flex. If you come across a different use case for CSS Flex
in your edition, let the LEMDO team know by emailing lemdotech@uvic.ca.
¶ Practice: Encode Long Braces with CSS Flex
The first step to encode long braces is to break down the relevant compositorial units
on the page that you are encoding. You have to think like an early modern compositor.
What are the basic blocks on the page that you need to be able to style in some way?
Each thing that needs to be styled (stretched, centered, italicized, grouped) needs
to be contained in its own element.
If you are encoding a list wrapped in a pair of long braces, your components might
be: list heading (
<label>
), brace (
<metamark>
), list (
<list>
), item(s) (
<item>
), and brace (
<metamark>
). Each of these components will be represented as an element in TEI. If there is
no obvious element to act as a container for the component, you may use the
<hi>
or
<seg>
element.Next, group all of the components that you have identified by wrapping them in a
<seg>
element. Put a
@style
attribute on the
<seg>
. There are three components included in the value of
@style
. Format these as you do for typical CSS (i.e., put a semicolon after each component
and separate components with a space). The first component is "display"
. Because we are using CSS Flex, we want to have the value "display: flex;"
. The second component is "flex-direction"
. You have the option to use either "flex-direction: row;"
or "flex-direction: column;"
. If you choose row as your flex direction, content will be centered in vertical space;
if you choose column as your flex direction, content will be centred in horizontal
space. The third component is "align-items"
. We typically want items to be centred when we use CSS Flex, so use "align-items: center;"
(note American spelling in CSS values).You should now have something that looks either like this:
<seg style="display: flex; flex-direction: row; align-items: center;">
<label>Label</label>
<metamark>{</metamark>
<list>
<item>Item 1</item>
<item>Item 2</item>
</list>
<metamark>}</metamark>
</seg>
or like this:
<label>Label</label>
<metamark>{</metamark>
<list>
<item>Item 1</item>
<item>Item 2</item>
</list>
<metamark>}</metamark>
</seg>
<seg style="display: flex; flex-direction: column; align-items: center;">
<metamark>{</metamark>
<list>
<item>Item 1</item>
<item>Item 2</item>
</list>
<metamark>}</metamark>
</seg>
<metamark>{</metamark>
<list>
<item>Item 1</item>
<item>Item 2</item>
</list>
<metamark>}</metamark>
</seg>
To stretch your braces, add a
@style
attribute to the
<metamark>
element. There are three components to the value for
@style
. The first component is "transform"
, which defines the axis that you want to stretch. For long braces, you will stretch
the vertical or Yaxis. To do this, encode as
"transform: scaleY"
followed by a number equivalent to the number of sizes larger that you want the element
to stretch wrapped in parentheses (for example, to stretch a brace to three times
its normal height, the "transform"
component would be encoded as: "transform: scaleY (3);"
). The second component is "transform-origin"
, which defines where the stretch starts. We typically want this to be "transform-origin: left-top;"
. The third component is "margin"
, which contains four numerical values seperated with spaces. The first value corresponds
to the top, the second to the right, the third to the bottom, and the fourth to the
left. You will need to tweak these values until your braces look correct. Note that
after values other than zero, you will need to specify emas the unit after the number. If the value is 0, you do not need to specify the unit.
This is an example of a brace encoded to be three times its original height and transformed
to have a margin of -2.4 ems from the top and 0.2 ems from the left:
<item style="display: flex; flex-direction: column; align-items: center;">
<metamark style="transform: scaleY (3); transform-origin: left-top; margin: -2.4em 0 0 0.2em;">{</metamark>
<list>
<item>Item.</item>
</list> } </item>
<metamark style="transform: scaleY (3); transform-origin: left-top; margin: -2.4em 0 0 0.2em;">{</metamark>
<list>
<item>Item.</item>
</list> } </item>
You will likely need to tweak the margin values. See for options for checking and
tweaking your CSS Flex values.
¶ Practice: Tweak CSS Flex Values
There are three ways to check and tweak your CSS. The first is to commit your file
to the LEMDO repository, wait for it to build on the website, and use inspector view
to change the CSS. The second is to use a computer that has Ant installed and create
a local build. The third is to use a coding site such as CodePen. The first option works well as long as there is at least one successful build of
your page on the Jenkins site. The second option works even if there is not yet a
successful build. The third option requires at least one successful build of your
page on the Jenkins site, but shows immediate results from tweaks to CSS and has a
clearly laid out code editor.
To tweak your CSS in inspector, follow these steps:
Commit your file to the repository and wait for it to build. This will take a few
hours.
Once there is one successful build with your styling in place, open your fileʼs page
in the LEMDO-dev Jenkins site.
Right click the item that you are styling (e.g., if you are using CSS Flex to create
a long brace, right click the long brace). Select
inspectfrom the dropdown menu.
Try using different values in the style pane of your browserʼs inspector.
Once you have determined the correct values that you want to use, enter them into
your file in Oxygen.
To check and tweak your CSS using a local build, follow these steps:
Note that not all JavaScript will work correctly when you download the static site,
but the layout and styling will appear. You will not need the JavaScript for tweaking
your CSS.
Save your file locally.
In your terminal, change directory into your
lemdodirectory.
Once you are in the correct directory, copy and paste
./getSiteFromJenkins.sh
into your command line, then click Enter.This command will download the most recent successful Jenkins site. Alternatively, you can type the command
ls
into your command line and select ./getSiteFromJenkins.sh
.Once you have downloaded the static site, copy and paste the following command into
your command line:
ant quick -DdocsToBuild=filename
(with the name of your file rather than filename).
You can then tweak your CSS and build your page until your styling appears correct.
To tweak your code with CodePen, go to the
Penfeature of the CodePen website, then follow these steps:
Open your page on the Jenkins site.
Right click the item that you are styling (e.g., if you are using CSS Flex to create
a long brace, right click the long brace). Select
inspectfrom the dropdown menu.
Right click the HTML line (or lines) for the item that you are styling and select
Copyand then
Outer HTML.
Paste the outer HTML into the HTML box.
You can then tweak your
@style
values directly in the HTML box and see immediate results below.¶ Further Examples
This example shows how to apply CSS Flex to a stretched brace used to group characters
that share a role description in a manuscript cast list. The parent element containing
all the
boxesis the first
<castGroup>
element. The first box is the child
<castGroup>
element. The second box is the
<metamark>
element containing the brace (French: accolade), which has styling to stretch the
brace. The third box is the
<roleDesc>
:
<castGroup style="display: flex; flex-direction: row; align-items: center;">
<castGroup>
<castItem xml:id="emdDouai_Mac_macbeth">
<role>Macbeth<space dim="horizontal" unit="em" quantity="0.5"/>
</role>
</castItem>
<lb/>
<castItem xml:id="emdDouai_Mac_banquo">
<role>Banquo<space dim="horizontal" unit="em" quantity="0.5"/>
</role>
</castItem>
</castGroup>
<metamark style="transform: scaleY(3); transform-origin: center; margin: 0 1em;">}</metamark>
<roleDesc>generalls of his armies.</roleDesc>
</castGroup>
<castGroup>
<castItem xml:id="emdDouai_Mac_macbeth">
<role>Macbeth<space dim="horizontal" unit="em" quantity="0.5"/>
</role>
</castItem>
<lb/>
<castItem xml:id="emdDouai_Mac_banquo">
<role>Banquo<space dim="horizontal" unit="em" quantity="0.5"/>
</role>
</castItem>
</castGroup>
<metamark style="transform: scaleY(3); transform-origin: center; margin: 0 1em;">}</metamark>
<roleDesc>generalls of his armies.</roleDesc>
</castGroup>
¶ Resources
The following resources have helpful information and tools for learning and practicing
CSS Flex:
CSS-Trickʼs
Complete Guide to Flexbox.
The Mozilla Developer Networkʼs
Flexbox.
Prosopography
Isabella Seales
Isabella Seales is a fourth year undergraduate completing her Bachelor of Arts in
English at the University of Victoria. She has a special interest in Renaissance and
Metaphysical Literature. She is assisting Dr. Jenstad with the MoEML Mayoral Shows
anthology as part of the Undergraduate Student Research Award program.
Janelle Jenstad
Janelle Jenstad is a Professor of English at the University of
Victoria, Director of The Map
of Early Modern London, and Director of Linked Early Modern Drama
Online. With Jennifer Roberts-Smith and Mark Kaethler, she
co-edited Shakespeare’s Language in Digital Media: Old
Words, New Tools (Routledge). She has edited John Stow’s
A Survey of London (1598 text) for MoEML
and is currently editing The Merchant of Venice
(with Stephen Wittek) and Heywood’s 2 If You Know Not
Me You Know Nobody for DRE. Her articles have appeared in
Digital Humanities Quarterly, Elizabethan Theatre, Early Modern
Literary Studies, Shakespeare
Bulletin, Renaissance and
Reformation, and The Journal of Medieval
and Early Modern Studies. She contributed chapters to Approaches to Teaching Othello (MLA); Teaching Early Modern Literature from the Archives
(MLA); Institutional Culture in Early Modern
England (Brill); Shakespeare, Language, and
the Stage (Arden); Performing Maternity in
Early Modern England (Ashgate); New
Directions in the Geohumanities (Routledge); Early Modern Studies and the Digital Turn (Iter);
Placing Names: Enriching and Integrating
Gazetteers (Indiana); Making Things and
Drawing Boundaries (Minnesota); Rethinking
Shakespeare Source Study: Audiences, Authors, and Digital
Technologies (Routledge); and Civic
Performance: Pageantry and Entertainments in Early Modern
London (Routledge). For more details, see janellejenstad.com.
Joey Takeda
Joey Takeda is LEMDO’s Consulting Programmer and Designer, a role he
assumed in 2020 after three years as the Lead Developer on
LEMDO.
Martin Holmes
Martin Holmes has worked as a developer in the
UVicʼs Humanities Computing and Media Centre for
over two decades, and has been involved with dozens
of Digital Humanities projects. He has served on
the TEI Technical Council and as Managing Editor of
the Journal of the TEI. He took over from Joey Takeda as
lead developer on LEMDO in 2020. He is a collaborator on
the SSHRC Partnership Grant led by Janelle Jenstad.
Navarra Houldin
Project manager 2022–present. Textual remediator 2021–present. Navarra Houldin (they/them)
completed their BA in History and Spanish at the University of Victoria in 2022. During
their degree, they worked as a teaching assistant with the University of Victoriaʼs
Department of Hispanic and Italian Studies. Their primary research was on gender and
sexuality in early modern Europe and Latin America.
Sofia Spiteri
Sofia Spiteri is currently completing her Bachelor of Arts in History at the University
of Victoria. During the summer of 2023, she had the opportunity to work with LEMDO
as a recipient of the Valerie Kuehne Undergraduate Research Award (VKURA). Her work
with LEMDO primarily includes semi-diplomatic transcriptions for The Winterʼs Tale and Mucedorus.
Tracey El Hajj
Junior Programmer 2019–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 algorhythmics of networked communications. She was a 2019–2020 President’s Fellow in Research-Enriched
Teaching at UVic, where she taught an advanced course on
Artificial Intelligence and Everyday Life.Tracey was also a member of the Map of Early Modern London team, between 2018 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.
Orgography
LEMDO Team (LEMD1)
The LEMDO Team is based at the University of Victoria and normally comprises the project
director, the lead developer, project manager, junior developers(s), remediators,
encoders, and remediating editors.
Metadata
Authority title | Encode Advanced Style in Semi-Diplomatic Transcriptions |
Type of text | Documentation |
Short title | |
Publisher | University of Victoria on the Linked Early Modern Drama Online Platform |
Series | Linked Early Modern Drama Online |
Source |
TEI Customization created by Martin Holmes, Joey Takeda, and Janelle Jenstad; documentation written by members of the LEMDO Team
|
Editorial declaration | n/a |
Edition | Released with Linked Early Modern Drama Online 1.0 |
Encoding description | Encoded in TEI P5 according to the LEMDO Customization and Encoding Guidelines |
Document status | prgGenerated |
Funder(s) | Social Sciences and Humanities Research Council of Canada |
License/availability | This file is licensed under a CC BY-NC_ND 4.0 license, which means that it is freely downloadable without permission under the following conditions: (1) credit must be given to the author and LEMDO in any subsequent use of the files and/or data; (2) the content cannot be adapted or repurposed (except in quotations for the purposes of academic review and citation); and (3) commercial uses are not permitted without the knowledge and consent of the editor and LEMDO. This license allows for pedagogical use of the documentation in the classroom. |