Skip to main content

A markdown extension for converting Leiden+ epigraphic text to TEI Epidoc XML

Project description

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 markdown import markdown
>>> from leidenmark import LeidenPlus
>>> content = """\
<D=.r<=
1. Lorem ipsum dolor
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>"""
>>> markdown(content, extensions = [LeidenPlus()])

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

<div n="r" type="textpart">
  <ab>
    <l n="1">Lorem ipsum dolor</l>
    <l n="2">sit amet, con<gap precision="low" quantity="3" 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>

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:

>>> markdown(content, extensions = [LeidenPlus(strict = True)])

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leidenmark-0.1.4.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

leidenmark-0.1.4-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file leidenmark-0.1.4.tar.gz.

File metadata

  • Download URL: leidenmark-0.1.4.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.4

File hashes

Hashes for leidenmark-0.1.4.tar.gz
Algorithm Hash digest
SHA256 948ad34f33878a964790c3b27a09f7f1945ca78d3be452aefcb313d078f23e79
MD5 4ce9ef0b46d2cbec3a2a2bcdb69cceb6
BLAKE2b-256 69c583021f0ea148a721af299bcd0849e31ae3b42c50e964b50bb081310615e0

See more details on using hashes here.

File details

Details for the file leidenmark-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: leidenmark-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.4

File hashes

Hashes for leidenmark-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 85d4a7cad537d81b033e2db5327d1baf2eb57747bb48d079ee4acf8bf184a673
MD5 e63b090fe72a6a6f21e5108ff8a41da1
BLAKE2b-256 51e261ac3c19e350b791ec49dbba5a10705c6a030f0cc9225cb812fc1c7f45a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page