An open API service indexing awesome lists of open source software.

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

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+.