Metadata-Version: 2.4
Name: zenmarked
Version: 0.1.2
Summary: Standalone markdown editor with live preview and image support
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: flask>=3.1.0
Requires-Dist: pillow>=10.0.0
Dynamic: license-file

# zenmarked

A snappy offline-first markdown editor with live preview, CodeMirror syntax highlighting,
and drag-and-drop image support. It runs as a local web server, you access it in your browser.

## Usage

<div class="figure align-center">
  <img src="./images/zenmarked-screenshot-readme.png" alt="Screenshot of ZenMarked">
  <p class="caption">ZenMarked being used to update its own README</p>
</div>




```
uv run zenmarked [FILE.md] [options]
```

| Argument | Description |
|----------|-------------|
| `FILE.md` | Optional. File to open on start (created if it doesn't exist). Its directory becomes the working directory. |

| Option | Description |
|--------|-------------|
| `--port PORT` | Port to listen on (default: 5055) |
| `--image-dir PATH` | Directory for uploaded images (default: `images/` inside working dir) |
| `--no-autosave` | Disable auto-save (use Ctrl+S only) |
| `--theme THEME` | Color theme: `light` or `dark` (default: `dark`) |
| `--no-browser` | Don't auto-open browser on start |

### Examples

```bash
# Open CWD — sidebar shows all .md files, create/edit freely
uv run zenmarked

# Open a specific file
uv run zenmarked notes.md

# Light theme, custom port
uv run zenmarked journal.md --theme light --port 8080

# Custom image directory, no autosave
uv run zenmarked docs/readme.md --image-dir docs/assets/imgs --no-autosave
```

## Features

- **3-column layout**: sidebar (file list + image gallery) + editor + live preview
- **Markdown syntax highlight** via [CodeMirror](https://codemirror.net/5/)
- **Live preview** via [marked.js](https://marked.js.org/), updates as you type
- **Auto-save** enabled by default, **Ctrl+S** to save manually at any time
- **Image support**: drag-and-drop, click drop zone, or paste from clipboard
- **Image insertion modal**: alt text, caption, alignment, custom width
- **Click image in preview** to edit its properties
- **Rename image** right-click image in the gallery to rename it
  - references are updated automatically across all `.md` files in the working dir
- **Smart URL paste**: select text in editor, paste a URL → auto-creates a markdown link
- **Light / Dark themes**


## Image paths

Images are stored in `./images/` (relative to the working directory) by default,
and inserted into markdown as `./images/filename.png`.

The image target directory can be overriden through option `--image-dir PATH`


## Keyboard shortcuts

| Shortcut | Action |
|----------|--------|
| `Ctrl+S` | Save current file |
| `Alt+N` | Create new file |
| `Escape` | Close modals |
