Metadata-Version: 2.4
Name: txt2md-cli
Version: 0.1.0
Summary: Convert plain text files to Markdown with automatic heading, list and code detection
Project-URL: Homepage, https://github.com/Santt997/txt2md
Project-URL: Repository, https://github.com/Santt997/txt2md
Project-URL: Bug Tracker, https://github.com/Santt997/txt2md/issues
Project-URL: Changelog, https://github.com/Santt997/txt2md/blob/main/CHANGELOG.md
Author-email: Santt997 <santiago.burastero@gmail.com>
License: MIT
License-File: LICENSE
Keywords: cli,converter,markdown,md,text,txt
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: Topic :: Text Processing :: Markup
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# txt2md-cli

[![PyPI version](https://badge.fury.io/py/txt2md-cli.svg)](https://pypi.org/project/txt2md-cli/)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GitHub](https://img.shields.io/badge/GitHub-Santt997%2Ftxt2md-181717?logo=github)](https://github.com/Santt997/txt2md)

> Convert plain text files to Markdown with automatic heading, list, and code detection — one command, no config.

---

## The Problem

You have a `.txt` file full of notes, documentation, or exported content and want to quickly turn it into clean Markdown without manually adding `#`, `-`, or backticks everywhere. `txt2md` does this heuristically with zero configuration.

---

## Installation

```bash
pip install txt2md-cli
```

> Requires Python 3.8+. No external dependencies — only Python stdlib.

---

## Usage

### CLI

```bash
txt2md input.txt output.md
```

### Python API

```python
from txt2md_cli import convert_file, line_to_md

# Convert a full file
convert_file("notes.txt", "notes.md")

# Convert a single line
print(line_to_md("INTRODUCTION"))      # → # Introduction
print(line_to_md("- item one"))        # → - item one
print(line_to_md("some/path/file"))    # → `some/path/file`
print(line_to_md("Normal sentence."))  # → Normal sentence.
```

---

## Detection Rules

Applied in order to each line:

| Rule | Condition | Output |
|---|---|---|
| **Heading** | ALL-CAPS, ≤60 chars, no period | `# Title Case` |
| **Bullet list** | Starts with `- ` or `* ` | Preserved as-is |
| **Numbered list** | Starts with `1.`, `2.`, etc. | Preserved as-is |
| **Inline code** | >10 chars, <2 spaces | `` `text` `` |
| **Paragraph** | Everything else | Plain text |

---

## Example

**Input (`notes.txt`):**
```
INTRODUCTION

This is a normal paragraph with some text.

- First item
- Second item

1. Step one
2. Step two

/usr/local/bin/python3

CONCLUSION
```

**Output (`notes.md`):**
```markdown
# Introduction

This is a normal paragraph with some text.

- First item
- Second item

1. Step one
2. Step two

`/usr/local/bin/python3`

# Conclusion
```

---

## License

MIT © [Santt997](https://github.com/Santt997)
