Skip to main content

text-forge

Text Forge is a toolkit for working with long-form Markdown as a living text: a website, a book, an editable workspace, an AI-readable corpus, and a source model for agent memory and future meaning graphs.

It grew out of the whattodo / WTD approach — Жизнь как Текст (“Life as Text”): important thinking should remain plain, readable, public, versioned, and useful to both humans and agents. Markdown stays the roots. Everything else is a projection.

Shared Goals Repository Map

Read the repositories in this order when you need the whole system context:

  1. shared-goals/prd — product decisions, acceptance criteria, implementation contract, history, and research.
  2. shared-goals/instance — platform API, persistence, authentication, and backend tests.
  3. shared-goals/skill — Hermes skill set and local client connector for agents.
  4. shared-goals/text-forge — Markdown tooling, Obsidian helpers, publishing, inventory, and Hindsight projection.
  5. bongiozzo/whattodo — public WTD Markdown text and laptop operator workflow.

This repository owns the text tooling and projection layer. It does not own platform goals, contracts, commits, or private Compass.md updates. The canonical component map lives in shared-goals/prd.

PyPI Python License

The idea

A meaningful text is not only a page to publish. It is also:

  • a book to read offline;
  • a website with stable public addresses;
  • an Obsidian workspace for continuous work;
  • a corpus for search, review, and AI feedback;
  • a memory substrate for agents;
  • a future graph of sections, concepts, references, aliases, and changes.

Text Forge keeps these roles connected through one source of truth:

plain Markdown + MkDocs navigation + Git history
        ↓
Text Forge source model
        ↓
website / EPUB / Obsidian helpers / AI-readable export
        ↓
inventory → memory projections → meaning graph projections

The key principle is: do not pollute the source text with infrastructure concerns. Keep Markdown readable. Put publication, memory, graph, and agent mechanics into generated layers.

Life as Text

The WTD approach treats life, work, product thinking, references, doubts, and decisions as a text that can be revised, linked, published, questioned, and remembered.

That creates a different kind of tooling requirement:

  • chapters can be published or still in draft, but both may be useful for feedback;
  • explicit anchors are public addresses for ideas, not just HTML implementation details;
  • source history matters because meanings evolve;
  • agents should cite sections, not vaguely “remember something”;
  • future tools should map meanings without forcing technical IDs into the Markdown.

Text Forge is the infrastructure layer for that workflow.

What Text Forge does today

Publish a MkDocs text as a website

Text Forge extends MkDocs Material with:

  • theme overrides;
  • custom partials and assets;
  • source links;
  • download/header integrations;
  • experimental browser editor integration;
  • custom content blocks used by long-form text projects.

Build an EPUB

The same source can become an EPUB:

  • chapters are combined from mkdocs.yml navigation;
  • PyMdown syntax is normalized for Pandoc;
  • assets are bundled;
  • metadata can include Git-derived dates/versioning;
  • output is compatible with normal e-readers;
  • every generated XHTML document is validated: a chapter that cannot be parsed fails the build instead of shipping a book whose pages silently disappear.

Embed a video

A video lives in the text as a marker, not as raw HTML:

![type:video](https://www.youtube.com/embed/LN6jA_brXXs "Webzavod 1997")

On the site the marker becomes a responsive player (16:9, loading="lazy", a proper referrer policy). In the EPUB it becomes a plain link — "▶ Webzavod 1997" — because e-readers ignore iframes and Pandoc would otherwise pull the page behind the URL into the book as a media file. The syntax is the one the mkdocs-video plugin uses, so the source stays portable. Switch it off with video_embeds: false.

Edit text in Obsidian

The primary editing workflow is local Markdown editing in Obsidian. Text Forge ships Obsidian helpers for block insertion, internal links, image insertion, and repeatable vault setup through content-repo Makefile targets such as make obsidian.

Browser editor experiment

The browser-based live editor is experimental and currently parked. It remains available as a code path for experiments, but it is not the main writing workflow. Prefer Obsidian for real text editing, then use Text Forge to publish, export, inventory, and project the text into agent memory.

Export for AI and agents

Text Forge can generate AI-readable material:

  • combined Markdown export;
  • normalized anchors and links;
  • privacy-first behavior: AI-readable export is opt-in.

Generate a source inventory

The next layer is a deterministic inventory of the text:

Markdown files + mkdocs.yml + Git metadata
        ↓
chapters, sections, anchors, line ranges, URLs, draft/published status

This inventory is the common input for downstream tools. They should not reimplement MkDocs parsing.

Current building block:

scripts/wtd-inventory.py

Despite the name, it is the first implementation of a broader pattern: derive a stable source model from a MkDocs text project.

Project text into agent memory

Text Forge also includes a public Hindsight adapter:

scripts/hindsight-ingest.py

It consumes inventory JSON and writes citable documents into Hindsight. This makes a text available to agents as structured memory while preserving public URLs, GitHub source links, chapter/section identity, and tags.

Recommended ownership framing for retain quality and attribution stability:

  • context should explicitly state ownership, for example: WTD roots corpus authored by User; Assistant is reader.
  • metadata should keep machine-readable provenance fields: text_author=User, reader=Assistant.

The public adapter is intentionally infrastructure-neutral. Private paths, hostnames, bank names, backups, and operational rituals belong in local Hermes skills or wrappers.

See:

The architecture

Text Forge is not meant to become a monolith. It should be the reusable source-model layer.

                  ┌────────────────────┐
                  │ plain Markdown text │
                  └─────────┬──────────┘
                            │
                  ┌─────────▼──────────┐
                  │ MkDocs + Git roots │
                  └─────────┬──────────┘
                            │
                  ┌─────────▼──────────┐
                  │ Text Forge model   │
                  └─────────┬──────────┘
                            │
        ┌───────────────────┼────────────────────┐
        │                   │                    │
┌───────▼────────┐  ┌───────▼────────┐  ┌────────▼─────────┐
│ Website / EPUB │  │ Agent memory   │  │ Meaning graph    │
│ EPUB / AI md   │  │ Hindsight etc. │  │ future layer     │
└────────────────┘  └────────────────┘  └──────────────────┘

For WTD specifically:

WTD roots
  = source Markdown, anchors, references, Git history

WTD Hindsight corpus
  = agent-memory projection of those roots

WTD graph
  = future meaning representation: concepts, mappings, aliases, splits, merges, evolution

The graph can eventually preserve anchor renames and section mappings without adding hidden metadata comments to the Markdown.

Drafts and public addresses

Text Forge distinguishes:

  • published chapters — included in mkdocs.yml navigation and released in the table of contents;
  • draft chapters — Markdown files under docs_dir but not in navigation yet.

Draft does not mean useless or private. A draft page may still have a stable preview/public URL and can be used for feedback, review, and memory. It is simply not part of the released table of contents.

Explicit heading anchors are treated as public addresses for ideas:

## Form of the Book {#book_form}

A chapter with no anchored headings still has a chapter-level address:

https://example.org/chapter-slug/

This is enough for the source. More complex identity mapping belongs in a generated graph layer, not in the Markdown.

Installation

Python package

pip install sg-text-forge

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

Quick start

Peer layout for local content repos

When using a local content repo such as whattodo, the default convention is to keep it as a peer directory:

work/
  text-forge/
  whattodo/

whattodo/Makefile uses:

TEXT_FORGE_DIR ?= ../text-forge

So local script routes resolve from the content repo to this toolkit repo without hardcoded machine-specific paths.

Add the plugin to mkdocs.yml:

plugins:
  - text-forge:
      editor_enabled: false
      nobr_emoticons_enabled: true
      downloads_enabled: false
      ai_readable_enabled: false
      epub_title: "My Book"
      epub_author: "Author Name"

Keep editor_enabled off unless you are explicitly testing the parked browser editor. For day-to-day writing, use the Obsidian helper workflow from the content repository.

Build EPUB:

text-forge epub --config=mkdocs.yml --build-dir=build

Build complete site:

text-forge build --config=mkdocs.yml --build-dir=build

Generate inventory:

python scripts/wtd-inventory.py --config mkdocs.yml --include-drafts --format json

Dry-run a Hindsight memory projection:

python scripts/wtd-inventory.py --config mkdocs.yml --include-drafts --format json \
  | python scripts/hindsight-ingest.py \
      --api-url http://localhost:8889 \
      --bank hermes \
      --strategy wtd-primary \
      --dry-run

CLI commands

text-forge epub

Build EPUB from a MkDocs project.

text-forge epub [OPTIONS]

Options:
  --config PATH      Path to mkdocs.yml (default: mkdocs.yml)
  --build-dir PATH   Build output directory (default: build)

text-forge build

Build complete site: EPUB + MkDocs site.

text-forge build [OPTIONS]

Options:
  --config PATH              Path to mkdocs.yml (default: mkdocs.yml)
  --build-dir PATH           Build directory (default: build)
  --site-dir PATH            MkDocs output (default: from mkdocs.yml)
  --strict/--no-strict       Fail on warnings (default: true)
  --copy-artifacts/--no-copy-artifacts
                             Copy EPUB to site root (default: true)
  --create-404-redirect/--no-create-404-redirect
                             Create 404.html for /ru/* redirects (default: true)

Plugin configuration

plugins:
  - text-forge:
      # Editor
      editor_enabled: false
      nobr_emoticons_enabled: true
      video_embeds: true

      # Downloads and AI-readable export
      downloads_enabled: false
      ai_readable_enabled: false

      # EPUB metadata
      epub_title: ""
      epub_subtitle: ""
      epub_author: ""
      epub_identifier: ""
      epub_publisher: ""
      epub_rights: ""

      # UI labels
      source_file_published_title: "Published"

      # Theme integration
      auto_configure_theme: true

Repository map

text-forge/
├── text_forge/                    # Python package
│   ├── plugin.py                  # MkDocs plugin
│   ├── build.py                   # Build pipeline
│   ├── cli.py                     # CLI commands
│   └── obsidian/                  # Obsidian-related templates/helpers
├── scripts/
│   ├── mkdocs-combine.py          # Chapter combiner / AI-readable export helper
│   ├── mkdocs_common.py           # Shared MkDocs helpers for scripts
│   ├── wtd-inventory.py           # Source inventory generator
│   ├── hindsight-ingest.py        # Public Hindsight adapter
│   ├── pymdown-pandoc.lua         # Pandoc Lua filter
│   └── process-epub-meta.py       # EPUB metadata processor
├── docs/
│   └── hindsight-memory/          # Example Hermes skill for memory projection
├── mkdocs/
│   ├── overrides/                 # Material theme overrides
│   └── hooks/                     # MkDocs hooks
├── epub/                          # EPUB templates and styles
└── tests/                         # Pytest tests

Example projects

  • whattodo — the WTD / “Жизнь как Текст” source project;
  • Live demo — published WTD site.

Development

git clone https://github.com/shared-goals/text-forge.git
cd text-forge
make install
make test

Useful commands:

make format      # Run Ruff check --fix and Ruff format
make test        # Run i18n check and tests with pytest
make check-i18n  # Validate translation keys
make release     # Interactive release: bump version, tag, push

Requirements

  • Python ≥ 3.11
  • Pandoc, for EPUB generation
  • MkDocs Material
  • Git, for version/date/source metadata

License

MIT License — see LICENSE.

Contributing

Contributions welcome. Please open issues or pull requests at github.com/shared-goals/text-forge.

Metadata

Release files for sg-text-forge 0.7.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sg-text-forge 0.7.10
File Size Uploaded Provenance Actions
sg_text_forge-0.7.10.tar.gz 255.0 kB With provenance Details for sg_text_forge-0.7.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sg-text-forge 0.7.10
File Interpreter ABI Platform Actions
sg_text_forge-0.7.10-py3-none-any.whl Python 3 none any Details for sg_text_forge-0.7.10-py3-none-any.whl

Total release size: 443.7 kB

Release files / sg_text_forge-0.7.10.tar.gz

Download URL sg_text_forge-0.7.10.tar.gz
Size 255.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0efd301c8411b0ced6c69078e73f67620ef25ad911c581c116723ec971dd9add
BLAKE2b-256 checksum
How to use checksums
f125dda6330a06bc797f6abbded1beae52a548e0659d769ac898909f20751fc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / sg_text_forge-0.7.10-py3-none-any.whl

Download URL sg_text_forge-0.7.10-py3-none-any.whl
Size 188.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3860a4d46b0b3d68b2e9440859f663accb32d9e172b9552926858c4159a2b6e
BLAKE2b-256 checksum
How to use checksums
e171f4fd6e99cc5491141b93a81c79d12f93996185f3815794e0fe6c8703c837
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for sg-text-forge 0.7.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sg_text_forge-0.7.10.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.10 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page