https://github.com/andredelft/leidenmark
A markdown extension for converting Leiden+ epigraphic text to TEI XML/HTML
https://github.com/andredelft/leidenmark
epidoc leiden-plus markdown python tei xml
Last synced: 7 months ago
JSON representation
A markdown extension for converting Leiden+ epigraphic text to TEI XML/HTML
- Host: GitHub
- URL: https://github.com/andredelft/leidenmark
- Owner: andredelft
- License: mit
- Created: 2020-05-14T17:36:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-04T10:56:04.000Z (almost 5 years ago)
- Last Synced: 2025-08-23T21:19:34.712Z (10 months ago)
- Topics: epidoc, leiden-plus, markdown, python, tei, xml
- Language: Python
- Homepage:
- Size: 133 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LeidenMark
```shell
$ 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.
```python
>>> from leidenmark import leiden_plus
>>> content = """\
=D>
=D>"""
>>> leiden_plus(content, indent=True)
```
The output of the above lines is the following XML snippet:
```xml
Lorem ipsum dolor
sit amet, conc
etur adipiscing
ut labore et dol
ore magna aliqua
```
`leiden_plus()` is syntactic sugar for the registered Markdown extension, and equivalent to:
```python
>>> 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 [``](https://tei-c.org/release/doc/tei-p5-doc/en/html/ref-hi.html)). 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`:
```python
>>> leiden_plus(content, strict=True)
```
NB: The blockprocessors for paragraphs and ordered list are always switched off, because they interfer too much with Leiden+.