MkDocs plugin and build pipeline for Markdown text projects with EPUB generation
Project description
text-forge
MkDocs plugin + GitHub Action + CLI tools для создания интерактивных текстовых сайтов с EPUB, live preview, и GitHub-based редактированием.
Originally developed for bongiozzo/whattodo, and later extracted as reusable tooling.
Quick Start
For Content Authors (Use GitHub Action)
# .github/workflows/publish.yml
- uses: shared-goals/text-forge@main
with:
mkdocs_config: mkdocs.yml
docs_dir: text/ru
site_dir: public/ru
For Local Development
# Install from PyPI
pip install text-forge
# Or with uv
uv pip install text-forge
# Build EPUB
text-forge epub --config=mkdocs.yml --build-dir=build
# Build site + EPUB
text-forge build --config=mkdocs.yml --build-dir=build
# Live preview (MkDocs dev server)
mkdocs serve
TODOs
- Publish to PyPI (ready! package built and tested)
- GitHub API Save and Commit (editor widget)
- Remove plugin with github edit buttons
- Update action.yml to use
@v1after first PyPI release
Target Use Cases (Specs)
Use Case 1: Edit Text on Site (Live Editor Widget)
Scenario: Content author wants to quickly fix typo or update content using in-browser editor
Flow:
- User visits published site (e.g.,
https://bongiozzo.github.io/whattodo/) - Clicks Edit button on any page
- Live markdown editor widget opens directly on site
- Edit content with real-time preview (Pyodide + pymdown-extensions)
- Clicks Save and Commit button
- Editor commits file via GitHub API (like standard GitHub web editor)
- GitHub Actions workflow (
publish.yml) automatically triggers - Site rebuilds and republishes with updated content
Requirements:
- ✅ Live editor widget with Pyodide (client-side markdown rendering)
- 🚧 Save and Commit button with GitHub API integration
- ✅ GitHub Actions workflow configured with
text-forgeaction - ✅ Proper permissions (
contents: read,pages: write)
User Permissions:
- Repo owner/collaborator: Can commit directly → auto-publish
- Authenticated user without write access: Creates fork and PR automatically
- Not authenticated: Read-only preview (no commit button)
Implementation Status: 🚧 In Progress
- ✅ Live editor widget (see editor.js)
- 🚧 GitHub API integration for Save and Commit
- ✅ GitHub Actions workflow (see
publish.yml)
Use Case 2: Edit Text Locally (Development Preview)
Scenario: User wants to preview site locally before publishing, edit content using browser editor widget
Flow:
-
Fork & Clone:
# Fork bongiozzo/whattodo on GitHub, then: git clone https://github.com/<username>/whattodo.git cd whattodo
-
One-Command Setup:
./install.sh # Installs uv + Python deps + text-forge plugin
-
Start Local Server:
make serve # Opens http://localhost:8000 with live reload
-
Edit Content:
- Open any page in browser at
http://localhost:8000 - Click Edit button to open editor widget
- Edit markdown with real-time preview (same as production site)
- Save changes → browser auto-refreshes instantly
- Test multiple edits before committing
- Open any page in browser at
-
Publish Changes:
git add . git commit -m "Update content" git push # Triggers GitHub Actions to rebuild site
Requirements:
- 📦
install.shscript (handles uv + pandoc installation, thenuv syncfor Python deps) - 📦
make(for development commands, pre-installed on macOS/Linux, needs manual install on Windows) - ✅
text-forgeinstalled automatically viauv sync(reads pyproject.toml) - ✅
pandocinstalled via install.sh (optional, only for EPUB generation)
Why Local Development:
- Test multiple changes before publishing
- Preview site appearance with custom CSS/themes
- Work offline
- Faster feedback loop (no waiting for GitHub Actions)
Target Users: Content authors who want to preview changes locally before publishing, using the same browser editor widget as production site.
Implementation Status: ✅ Complete (Local Dev Setup)
- ✅
install.shscript for universal installation (macOS/Linux/Windows) - ✅ Makefile with development targets (
serve,epub,build,clean,info) - ✅ Live editor widget works on local server
- ✅ CLI commands migrated (
text-forge epub,text-forge build) - ✅ Package ready for PyPI publication
- 🚧 GitHub API Save and Commit (in editor widget) - pending
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 sg_text_forge-0.1.0.tar.gz.
File metadata
- Download URL: sg_text_forge-0.1.0.tar.gz
- Upload date:
- Size: 81.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef9b1566b0dc522c67f10aff3a372d489a30591d2e9e7bd05732636701c0e53b
|
|
| MD5 |
647ab86dfc454e433b98e1c554673cff
|
|
| BLAKE2b-256 |
e9d3caed628462acb87eb42e6917cc1c9edfc8bc6b89d33548cc4474c53e657d
|
Provenance
The following attestation bundles were made for sg_text_forge-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on shared-goals/text-forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sg_text_forge-0.1.0.tar.gz -
Subject digest:
ef9b1566b0dc522c67f10aff3a372d489a30591d2e9e7bd05732636701c0e53b - Sigstore transparency entry: 870170810
- Sigstore integration time:
-
Permalink:
shared-goals/text-forge@39d5d4944ca7f20db8b82e39bb6424ab700043b7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shared-goals
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@39d5d4944ca7f20db8b82e39bb6424ab700043b7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sg_text_forge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sg_text_forge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 45.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb36bea6e54b9b064310e6857a6fb69f09f6c2852f5ff61c8ee27a1e025548fe
|
|
| MD5 |
59db1c755d0579720c7d574d8b78367c
|
|
| BLAKE2b-256 |
4378e80ebaf241f7b5194f796bd8bf69793262bb5bc84e13475a1bb56c076efa
|
Provenance
The following attestation bundles were made for sg_text_forge-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on shared-goals/text-forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sg_text_forge-0.1.0-py3-none-any.whl -
Subject digest:
cb36bea6e54b9b064310e6857a6fb69f09f6c2852f5ff61c8ee27a1e025548fe - Sigstore transparency entry: 870170813
- Sigstore integration time:
-
Permalink:
shared-goals/text-forge@39d5d4944ca7f20db8b82e39bb6424ab700043b7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/shared-goals
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@39d5d4944ca7f20db8b82e39bb6424ab700043b7 -
Trigger Event:
release
-
Statement type: