Metadata-Version: 2.4
Name: tui-md-editor
Version: 0.1.0
Summary: A TUI markdown editor built with Textual
Requires-Python: >=3.9
Requires-Dist: textual>=0.50.0
Description-Content-Type: text/markdown

# TUI Markdown Editor

A terminal-based markdown editor built with [Textual](https://textual.textualize.io/).

Inspired by the navigation style of [Frogmouth](https://github.com/Textualize/frogmouth), this editor uses a top address bar to open files and provides a single-pane toggle between editing raw markdown and viewing a rendered preview.

## Features

- **Single-pane toggle** — Switch between a syntax-highlighted editor and a live Markdown preview with `Ctrl+P`.
- **Address bar navigation** — Type a file path in the top bar and press `Enter` to open it.
- **Save & dirty tracking** — Know when you have unsaved changes; save with `Ctrl+S`.
- **Unsaved-changes guard** — Prompted to save when quitting or opening a new file with pending edits.

## Installation

Install the package into your virtual environment in editable mode:

```bash
pip install -e .
```

This installs the `tui-md-editor` CLI command.

## Usage

Launch the editor with an optional starting file:

```bash
tui-md-editor
tui-md-editor ~/notes.md
```

## Keybindings

| Key | Action |
|-----|--------|
| `Ctrl+L` | Focus the address bar |
| `Ctrl+S` | Save the current file |
| `Ctrl+P` | Toggle Edit / Preview mode |
| `Ctrl+Q` | Quit (guards unsaved changes) |
| `Escape` | Return focus from address bar to editor |

## Project Structure

```
src/tui_md_editor/
├── __init__.py
├── __main__.py
├── app.py              # Main Textual application
├── app.tcss            # Textual CSS styles
├── utils.py            # File I/O helpers
└── widgets/
    ├── address_bar.py  # Top path input
    └── status_bar.py   # Bottom state indicator
```
