A small local editor for projects following the wikisource-agent corpus
layout. It keeps wikitext and facsimiles on your machine while using the
project's configured MediaWiki API for read-only previews.
Licensed under the MIT License.
The default Compose configuration targets the sibling ../wikisource-agent
project:
docker compose up --buildOpen http://127.0.0.1:8080. To use another compatible project or port:
WIKISOURCE_PROJECT_PATH=/absolute/path/to/project \
WIKISOURCE_VIEWER_PORT=8081 \
docker compose up --buildCompose runs the application as UID/GID 1000:1000 so saved files belong to
the local user. Override these when needed:
WIKISOURCE_VIEWER_UID="$(id -u)" \
WIKISOURCE_VIEWER_GID="$(id -g)" \
docker compose up --buildThe project mount is read-only except for the nested
pages/corrected mount. The viewer never authenticates with or writes to
Wikisource.
- Previous, next, and direct view-number navigation follow
facsimile/CORPUS_MANIFEST.json. - Existing
pages/corrected/page-NNNN.txtfiles are edited as-is. - Missing corrected pages start as unsaved level-1 drafts seeded from the manifest's raw text file.
- Save uses a content revision hash and refuses to overwrite a file changed by another tool after it was loaded.
- Preview sends the current editor buffer to the configured MediaWiki parser. Successful renderings are cached in memory for 24 hours, with only the newest rendering retained for each of up to 256 pages. Page navigation uses the cache when the editor content is unchanged; Refresh preview bypasses and replaces it. Facsimiles and local editing continue to work when the network is unavailable.
Install dependencies and run the test suite:
python3 -m pip install -r requirements-dev.txt
python3 -m unittest discover -s tests -vRun the server directly against a project:
WIKISOURCE_PROJECT_ROOT=../wikisource-agent python3 app.pyPull requests are checked automatically with the test suite and Python syntax validation in GitHub Actions.
