Skip to main content

LeidenMark

$ pip install leidenmark

A Python Markdown extension for converting Leiden+ epigraphic text to TEI XML/HTML. Inspired by the Brill plain text (BPT) format that aims to incorporate Leiden+ into a Markdown-based syntax.

>>> from leidenmark import leiden_plus
>>> content = """\
<D=.r<=
1. Lorem ipsum dolor
vac.1lin
2. sit amet, con[ca.3]c
3.-etur adipiscing
=>=D>
<D=.v<=
lost.2lin
6. ut labore et dol
7.-ore magna aliqua
=>=D>"""
>>> leiden_plus(content, indent=True)

The output of the above lines is the following XML snippet:

<div n="r" type="textpart">
  <ab>
    <l n="1">Lorem ipsum dolor</l>
    <space quantity="1" unit="line"/>
    <l n="2">sit amet, con<gap precision="low" quantity="3" reason="lost" unit="character"/>c</l>
    <l break="no" n="3">etur adipiscing</l>
  </ab>
</div>
<div n="v" type="textpart">
  <ab>
    <gap quantity="2" unit="line"/>
    <l n="6">ut labore et dol</l>
    <l break="no" n="7">ore magna aliqua</l>
  </ab>
</div>

leiden_plus() is syntactic sugar for the registered Markdown extension, and equivalent to:

>>> import leidenmark
>>> from markdown import markdown
>>> markdown(content, extensions=['leiden_plus']) # Other extensions can be added to this list

Configuration

Given that this is a Markdown extension, conventions like *italics* and **bold** will also be recognized an converted (these in particular will additionally be transformed to the TEI element <hi>). Though these are in principle not part of the Leiden+ syntax, in practice the use of italics and boldface is still encountered a lot. Therefore, support is maintaned by default, which can be switched off by passing strict=True:

>>> leiden_plus(content, strict=True)

NB: The blockprocessors for paragraphs and ordered list are always switched off, because they interfer too much with Leiden+.

Metadata

Release files for leidenmark 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leidenmark 0.2.2
File Size Uploaded
leidenmark-0.2.2.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for leidenmark 0.2.2
File Interpreter ABI Platform
leidenmark-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.3 kB

Release files / leidenmark-0.2.2.tar.gz

Download URL leidenmark-0.2.2.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0d8bd811e6a1277ba1d9421d34649116e04f4206625c56fd9ae8e688bf092ff3
BLAKE2b-256 checksum
How to use checksums
c19ca3af9da8bd7fd8ef77bcfccf590a6b43fbd0dac93298548a1aef84a0ba9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

Release files / leidenmark-0.2.2-py3-none-any.whl

Download URL leidenmark-0.2.2-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a52a44e4db046e5226f9ab38562491607b55f692d1e0a7de6404c4d8dacf0b38
BLAKE2b-256 checksum
How to use checksums
e522de0bd3179e8da0cbcabc5735d96238b346957b1c9b685bbe0ea6538c2af7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page