Markdown TUI viewer with translation support
Project description
mark4
mark4 is a Textual-based TUI for browsing markdown files under a root
directory, reading them in a two-pane layout, and translating the selected
document into Korean.
Features
- Recursive markdown file tree
- Mouse and keyboard navigation
- Markdown rendering with scrolling
- Chunk-by-chunk Korean translation updates
- Persistent translation cache across app runs
- In-app status messages for scan, translation, cache, and errors
Requirements
- Python 3.12+
uv
Setup
uv sync --extra dev
Run
./mark4 /path/to/markdown/root
You can also use:
PYTHONPATH=src .venv/bin/python -m mark4 /path/to/markdown/root
Public-safe options:
./mark4 --no-translate /path/to/markdown/root
./mark4 --no-cache /path/to/markdown/root
./mark4 --clear-cache /path/to/markdown/root
Key Bindings
- Mouse click: select files and folders
Up/Down: move tree selectionLeft/Right: collapse or expand directories in the treeEnter: open the selected markdown filer: rescan the root patht: first show the translation privacy warning, then toggle Korean translation?: show help text in the status lineq: quit
Translation Behavior
- On the first translation attempt in a session,
mark4warns that document content will be sent to an external translation service and may be stored in the local cache. Presstagain to continue. - Press
ton an open document to switch the right pane into translation mode. - Translation runs chunk by chunk and the viewer updates as translated chunks arrive.
- Code fences and inline code stay in the original source form.
- If a chunk translation returns no text, the app falls back to the original chunk instead of crashing.
- Press
tagain to return to the source markdown. - Use
--no-translateto disable all external translation requests.
Translation Cache
Translated documents are cached in a global user cache directory so they can be reused after restarting the app.
- macOS:
~/Library/Caches/mark4/translations/ - Linux:
~/.cache/mark4/translations/ - Windows:
%LOCALAPPDATA%/mark4/translations/
Cache validity is based on:
- absolute file path
- source file content hash
- translator/provider identity
If the markdown file changes, the previous cached translation is ignored and a new translation is generated.
- Use
--no-cacheto disable persistent cache reads and writes. - Use
--clear-cacheto remove the persistent translation cache directory.
Status Messages
The status line reports the current document path and important events such as:
- invalid root path
- no markdown files found
- rescan complete
- translation progress such as
번역 중 2/8 - translation errors
Known Limitations
- Translation still depends on the external translator provider and network availability.
- Cached translations are not pruned automatically yet.
- Large markdown trees may still take time to render because the full file tree is built in the TUI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mark4-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mark4-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45a3d2568b5aa98bb0b4dec724550edd25328c83270b5afdd45fe5952220d412
|
|
| MD5 |
9bd3b16841233c1600af520ebc2aebfc
|
|
| BLAKE2b-256 |
5a69577abb398c2494502fad590fa08b970bafd4fb65dc547c7a78ff5a58408d
|