A program to give color to gendered words and keep currently highlighted text from epub3 centered.
9.2K
π Overview
This Docker image processes Russian EPUB files to make them easier to follow while reading and listening. It automatically:
π¨ Colors nouns based on grammatical gender:
Blue β masculine
Red β feminine
Green β neuter
π Highlights case-governing words (prepositions, verbs) with different background colors for dative, genitive, accusative, instrumental, and prepositional cases
π₯ Keeps the current highlighted sentence centered on screen when reading, making it easier to track during synchronized audiobook playback
π― Ideal Use Case
Designed for EPUB3 books in Russian β especially those produced with Storyteller for synchronized reading and listening. With this enhancement, learners of Russian can visually connect grammar patterns to real reading context while following along with the audio. π How It Works
Mount your .epub file into the container.
The script scans all text inside the EPUB.
Morphological analysis (via pymorphy2) detects each wordβs gender and case.
HTML is updated with custom CSS for color-coding.
A small JavaScript snippet ensures the current selection stays centered as you read.
The output is saved as a new .epub.
π Usage
docker run --rm \
-v $(pwd)/input:/input \
-v $(pwd)/output:/output \
alebast/russian-epub-highlighter
Input: /input/input.epub
Output: /output/output.epub
π¦ Docker Compose Example
services:
epub-gender-highlight:
image: alebast/epub-gender-highlight:latest
container_name: epub-gender-highlight
volumes:
# Mount local folder with the original EPUB
- /path/to/input:/app/input
# Mount local folder where the processed EPUB will be saved
- /path/to/output:/app/output
restart: "no"
π How to Run
Create two folders:
mkdir input output
Put your Russian EPUB in input/ and name it input.epub.
Run:
docker compose up
Your processed EPUB will appear in output/output.epub.
π¨ Color Scheme
Feature Color
Masculine nouns Blue
Feminine nouns Red
Neuter nouns Green
Dative indicators Light blue background
Genitive indicators Light green background
Accusative indicators Light yellow background
Instrumental indicators Light purple background
Prepositional indicators Light cyan background
π Learning Benefit
By linking color cues to grammar, learners quickly internalize Russian gender and case structures in authentic reading contexts, without constant grammar-table lookup.
Content type
Image
Digest
sha256:307859282β¦
Size
151.1 MB
Last updated
about 1 year ago
docker pull alebast/epub-gender-highlight