Skip to main content

LEAF-Turning Engine Documentation

The LEAF Turning Engine (LEAF-TE) is an integrated component of LEAF-Writer Commons that supports easy transformation to and from TEI-XML fie formats. It is designed to enhance the digital editorial workflow.

The LEAF-Writer user can transform from the Transkribus HTR engine, Microsoft Word, and Markdown files into basic TEI-all compliant files for encoding in LEAF-Writer. Note that LEAF-Writer works with XML files, and so you will need to make sure that the file you are importing into LEAF-Writer is properly structured as a .xml file format. The following are instructions about preparing files for import.

Importing files into LEAF-Writer

Import from Transkribus

  1. Logged into Transkribus and working in a collection, check the square(s) of the document or documents to be encoded in LEAF-Writer.
    1. Choose 'Export' from the available tasks
    2. In Export Options choose "TEI Export"
    3. Uncheck "Include Zones"
    4. Choose between line tags <l>...</l> and line breaks <lb/> -- if you choose line tags, LEAF-Writer will transform your text in verse format (with lines nested in line groups); if you choose line breaks, LEAF-Writer will transform your text in prose format (turning divided lines into paragraphs).
    5. Download the exported file. Transkribus will send a zipped file to your registered email account. Unzip and look for file within those directories with the document name and .xml file type (do not choose files with 'page.xml' or 'mets.xml' file names).
  2. In LEAF-Writer click on "Import Document" and choose Transkribus option. Drag your file into the box or browse for it on your desktop.
  3. Click "Import". Your document should open in the LEAF-Writer panel.
note

LEAF is not connected to Transkribus or the READ Coop, and have no control over their subscription practices. As of July 2025 the instructions laid out here require a Transkribus Scholar subscription or higher.

Import From MS Word

  1. With your document open in MS Word 'Save As' and choose the Word XML Document (.xml) option.
  2. In LEAF-Writer click on In LEAF-Writer click on "Import Document" and choose Word option. Drag your file into the box or browse for it on your desktop.
  3. Click "Import". Your document should open in the LEAF-Writer panel.

Once your document is imported from Transkribus or Word you can edit the TEI header or associate a custom schema or CSS styleshetet by editing in Raw XML mode. You can also choose to save your new TEI file to your desktop or (if you are logged into GitHub) to one of your repositories.

While the LEAF-Team is dedicated to openly accessible software wherever possible we know that many editors use proprietary programs or subscription-based platforms as part of their workflow. We will continue to add file forms for import that are available to more users.

Import From Markdown

Because LEAF-Writer requires a .xml file with an XML declaration, you will need to take the following steps:

  1. In a text editor add these two lines of code at the top of your document: <?xml version="1.0" encoding="utf-8"?><markdown> and this line of code at the very end of your document: </markdown>
  2. Save your file as .xml

The file is now ready to import to LEAF-Writer.

Exporting files from LEAF-Writer

The LEAF-Writer user can transform from LEAF-Writer to XML, HTML or Markdown format for further encoding, sharing, or web publication. The XML format includes all of the encoding you have done in LEAF-Writer (including RDF, if you are tagging Markup and Linking). The HTML and Markdown exports include basic formatting and links to entity authorities that you have tagged. Other semantic tags are not retained.

Export to XML, HTML, or Markdown

In LEAF-Writer look for the three horizontal lines at the top left of the screen (next to the LEAF-Writer logo). From the drop-down menu choose "Export Document". Choose the format you want.

note

LEAF-Writer currently only supports downloading of the exported document to your desktop. If you are working in a GitHub repository you will need to manually add the exported file to your repository.

If you want to experiment with or adapt any of the XSLTs or CSS that we use with LEAF-Writer, you'll find the files on our GitHub repository (here)[https://github.com/LEAF-VRE/code_snippets].