Metadata-Version: 2.3
Name: boringmd
Version: 1.2.0
Summary: Extract plain text and front matter from Markdown documents
License: MIT
Keywords: markdown,text
Author: Cariad Eccleston
Author-email: cariad@cariad.earth
Requires-Python: ~=3.9
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing
Classifier: Topic :: Text Processing :: Markup :: Markdown
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Dist: lstr (>=1.0,<2.0)
Project-URL: Homepage, https://github.com/cariad/boringmd
Description-Content-Type: text/markdown

# boringmd

`boringmd` is a Python package and command line tool for extracting plain text and front matter from Markdown.

## Installation

`boringmd` requires Python 3.9 or later.

```bash
pip install boringmd
```

## Command line

Pass the filename of a Markdown document to extract its plain text content:

```bash
boringmd input.md
```

To extract the front matter only, include the `--front-matter` flag:

```bash
boringmd input.md --front-matter
```

`boringmd` prints to stdout. To write the extraction to a file, redirect it:

```bash
boringmd input.md > output.txt
```

## Package

```python
from boringmd import front_matter_from_string, text_from_string
markdown = "---\nfoo: bar\n---\n**foo** and _bar_"
print(text_from_string(markdown))
# foo and bar
print(front_matter_from_string(markdown))
# foo: bar

from pathlib import Path
from boringmd import front_matter_from_file, text_from_file
print(text_from_file(Path("input.md")))
print(front_matter_from_file(Path("input.md")))
```

## Related packages

`boringmd` uses [cariad/lstr](https://github.com/cariad/lstr) to manipulate strings.

