Metadata-Version: 2.4
Name: nanorst
Version: 1.0.1
Summary: A tiny, hookable reStructuredText-to-text converter
Project-URL: Homepage, https://github.com/enkore/nanorst
Project-URL: Repository, https://github.com/enkore/nanorst
Project-URL: Issues, https://github.com/enkore/nanorst/issues
Author: Marian Beermann
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: ansi,restructuredtext,rst,terminal
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: Programming Language :: Python :: 3.14
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Provides-Extra: build
Requires-Dist: build>=1.2; extra == 'build'
Requires-Dist: twine>=6; extra == 'build'
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# nanorst

`nanorst` converts a deliberately small subset of reStructuredText (rST) into readable
plain text. A state hook can be used to convert inline formatting to other forms, such as
terminal escapes or HTML.

```python
from nanorst import rst_to_text, rst_to_terminal

assert rst_to_text("This is **important**.") == "This is important."
print(rst_to_terminal("This is **important**."))
```

Supported constructs include emphasis, strong emphasis, inline literals,
references supplied by the caller, simple directives, and indented literal
blocks. This module is intentionally a loose converter, not a standards-complete
reStructuredText implementation.

## Development

Create a virtual environment, then install the project and its test dependencies:

```console
python -m pip install -e '.[test]'
pytest
```

Build both distribution formats and validate their metadata with:

```console
python -m pip install '.[build]'
python -m build
twine check dist/*
```

Releases are published by the `release.yml` GitHub Actions workflow when a
version tag such as `v0.1.0` is pushed. Configure a PyPI Trusted Publisher for
the `enkore/nanorst` repository, workflow `release.yml`, and environment `pypi`.

## Users

borgbackup has been using nanorst since borg 1.1.0 as a lightweight rST terminal
formatter for `--help` and `borg help TOPIC`. The same rST sources are also rendered
using sphinx-doc for the manual.

## License

BSD-3-Clause. See [LICENSE](LICENSE).

