Segment-based book manuscript editor with git integration
Project description
Writer-Reader
Segment-based book manuscript editor with git integration.
Overview
Writer-Reader breaks book chapters into individual markdown segments for granular editing, with built-in git integration for tracking changes.
Features:
- ๐ Segment chapters into editable markdown files
- โ๏ธ In-browser editing with live preview
- ๐ Git integration (status, diff, commit, push)
- ๐ Convention-based file organization
- ๐ Assemble segments back into chapters
Installation
pip install writer-reader
Or install from source:
git clone https://github.com/bobmatnyc/writer-reader.git
cd writer-reader
pip install -e .
Quick Start
1. Initialize a new project
writer-reader init my-book --title "My Book" --author "My Name"
cd my-book
2. Add your chapters
Place markdown files in chapters/:
my-book/
โโโ chapters/
โ โโโ chapter-01-introduction.md
โ โโโ chapter-02-the-beginning.md
โ โโโ ...
3. Segment chapters
writer-reader segment
Creates:
my-book/
โโโ segments/
โ โโโ ch01-introduction/
โ โ โโโ _meta.yaml
โ โ โโโ 01-introduction.md
โ โ โโโ 02-the-beginning.md
โ โ โโโ ...
โ โโโ _index.yaml
4. Start the editor
writer-reader serve
File Convention
segments/
โโโ ch01-chapter-title/
โ โโโ _meta.yaml # Chapter metadata
โ โโโ 01-opening.md # First segment
โ โโโ 02-section-name.md # Named section
โ โโโ ...
โโโ ch02-next-chapter/
โ โโโ ...
โโโ _index.yaml # Master index
Segment Types
- chapter-title: The
# Chapter N: Titleheading - section:
## Section Nameheaders - prose: Content between
---dividers
Metadata Format
_meta.yaml:
chapter: 1
title: The Beginning
source_file: chapter-01-the-beginning.md
segments:
- file: 01-the-beginning.md
title: "The Beginning"
type: chapter-title
index: 1
- file: 02-first-section.md
title: "First Section"
type: section
index: 2
CLI Commands
| Command | Description |
|---|---|
writer-reader init <dir> |
Initialize a new manuscript project |
writer-reader segment [dir] |
Segment chapters into individual files |
writer-reader serve |
Start the editor server |
writer-reader assemble [dir] |
Assemble segments back into chapters |
Options
# Serve on different port
writer-reader serve --port 8080
# Segment with force overwrite
writer-reader segment --force
# Assemble specific chapter
writer-reader assemble --chapter 5
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/index |
GET | Get all chapters/segments |
/api/chapter/<num> |
GET | Get chapter metadata |
/api/segment/<path> |
GET | Read segment content |
/api/segment/<path> |
PUT | Write segment content |
/api/git/status |
GET | Git status |
/api/git/diff |
GET | Show uncommitted changes |
/api/git/add |
POST | Stage files |
/api/git/commit |
POST | Commit with message |
/api/git/push |
POST | Push to remote |
/api/assemble/<num> |
GET | Preview assembled chapter |
/api/assemble/<num> |
POST | Save assembled chapter |
Development
# Clone repository
git clone https://github.com/bobmatnyc/writer-reader.git
cd writer-reader
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
ruff check src/ --fix
Version History
- 0.1.0 - Initial release
- Chapter segmentation
- In-browser editing
- Git integration
- CLI commands
License
MIT License - see LICENSE for details.
Author
Bob Matsuoka (@bobmatnyc)
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 Distribution
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 writer_reader-0.1.1.tar.gz.
File metadata
- Download URL: writer_reader-0.1.1.tar.gz
- Upload date:
- Size: 584.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11707757172ae2b9a6bd0f1f807bc1e58fc49a7a039576213ba7dd1c0b4315da
|
|
| MD5 |
755afa8232e8102887f907c0dd804a11
|
|
| BLAKE2b-256 |
999b92d906eb8fa06f6ad0928403e39500120cc69110835d865f3ccdc91cec3d
|
File details
Details for the file writer_reader-0.1.1-py3-none-any.whl.
File metadata
- Download URL: writer_reader-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca2e15e7cb7620e809a38c0831bc0b36c2331343a70c4a50cb9ca515c4cdc166
|
|
| MD5 |
bf2730c0634dc11767560c48590671b3
|
|
| BLAKE2b-256 |
da73d49a3f52ad12d3d62aa3e0b51ed8de2659c72cbd861d7ec579db14bef62b
|