Bionic Writing Lab is a Markdown-first static publishing system for long-form and short-form writing. The repository is designed to hold publication manifests, source Markdown, static site templates, and simple build scripts that turn writing into a website and downloadable artifacts.
Markdown is the source of truth. The website, downloadable files, and release artifacts are generated outputs.
This repo is the publishing layer, not another single-manuscript project. It is meant to support:
- books
- series
- essays
- fragments
- poems
- posts
- pamphlets
- collections
- web-native writing
The goal is to make each publication kind a first-class citizen without forcing every project into a book and chapter model.
Each publication lives in a JSON manifest inside publications/. A manifest defines the publication identity, kind, route, source content, descriptive metadata, and requested output formats.
The build scripts use manifests to:
- validate publication metadata
- validate site-level config in
site/site.json - resolve Markdown sources
- build HTML pages into
dist/site/ - create listing pages by publication kind
- build a static
/search/page backed bydist/site/search-index.json - connect series and collections to their member publications
- preserve section-level structure for multi-file publications
- add standalone section pages and previous/next reading links for multi-file publications
- export Markdown and optional pandoc-based downloads into
dist/site/downloads/ - generate a catalogue, static search data, RSS, JSON Feed, and a sitemap
- add canonical, Open Graph, and social preview metadata from site and publication config
The publication schema lives at schema/publication.schema.json.
content/holds Markdown source files and folderspublications/holds manifest JSON filesschema/holds the JSON schemasite/holds Jinja templates and CSS assetssite/site.jsonholds site metadata and navigation configscripts/holds the Python build and validation toolsdist/is generated output and is intentionally ignored in gitprovenance/holds ingestion records for work received from other repositoriestests/holds the regression suitedocs/holds planning notes for domains and future imports
Use the authoring scaffold when starting a new piece. It creates the Markdown source and matching manifest together, fills in sensible defaults from the site config, refuses to overwrite existing files, and validates the repo after creation.
make new kind=essay title="Capitalism Behaves Like Cancer"
make new kind=pamphlet title="The Freedom They Mean" tags="politics,freedom"
make new kind=book title="Empire Exposed"Supported kinds are book, series, essay, fragment, poem, post, pamphlet, and collection.
Single-file kinds create one Markdown file:
content/essays/capitalism-behaves-like-cancer.md
publications/capitalism-behaves-like-cancer.json
Folder-based kinds create a content folder with a starter file:
content/books/empire-exposed/00-introduction.md
publications/empire-exposed.json
Optional arguments can override defaults:
make new kind=essay title="Property Is Command" \
subtitle="Notes on ownership and coercion" \
description="A draft essay about property, command, and survival pressure." \
status=review \
tags="property,coercion"Every manifest must use one of these statuses: draft, imported, review, published, archived, superseded, or private.
Normal public builds are intentionally conservative:
make site
make downloads
make buildThese include only published publications in generated publication pages, listing pages, publications.json, feed.json, search-index.json, and downloads. GitHub Pages uses this safe public build path.
Use draft preview mode when you want to inspect everything locally:
INCLUDE_DRAFTS=1 make site
make site-drafts
make build-draftsPreview mode writes to dist/preview/ and includes all statuses, including private. It marks the entire preview and labels individual non-published works. Source committed to this public Git repository is world-readable at every status. See docs/publication-lifecycle.md for the recommended draft/imported -> review -> published -> archived/superseded/private workflow.
Bionic Writing Lab is an independent literary and intellectual publication founded by Matt Faherty. The Bionic Editorial design leads with the work, offers dark and light reading, and adds routes into forms and ideas as material becomes public. See Public Site for bylines, artwork, presentation, and contribution policy.
Reading paths are curated routes through existing publications. They live in paths/*.json, generate /paths/ and /paths/<slug>/, and add backlinks on publication pages when a publication appears in a visible path.
They are distinct from other organization layers: kind is publication form, tag is a loose topic, series and collection are publication structures, and a reading path is an ordered route through works. See docs/reading-paths.md.
Concepts are defined recurring ideas that can appear across publications. They live in concepts/*.json, generate /concepts/ and /concepts/<slug>/, and add backlinks on publication pages when a visible concept references that publication.
They are not tags. kind is form, tag is loose topic metadata, series and collection are publication structures, reading path is a curated route, and concept is a defined idea with a short definition, description, related concepts, and linked publications. See docs/concepts.md.
The first real draft concept map and import order are described in docs/content-map.md and docs/import-plan.md.
Fragments are first-class seed forms: argument shards, reply drafts, debate skeletons, concept stubs, AI-assisted notes, rough observations, and compressed ideas that may later mature into posts, essays, pamphlets, chapters, or books.
They obey the normal lifecycle and are not automatically public. Fragments can appear in reading paths, concepts, search, publication relationships, and generated indexes when visible in the current build. See docs/fragments.md.
Publication relationships describe provenance between pieces: expansion, response, supersession, related work, excerpts, and adaptations. They are optional manifest metadata under relationships, and backlinks are generated automatically on referenced publication pages.
Relationships are distinct from other organization layers: kind is form, tag is loose topic metadata, series and collection are publication structures, reading path is a curated route, concept is a defined recurring idea, and relationship is a provenance or evolution link between publications. See docs/relationships.md.
Use the import pipeline for a selected, cleared Markdown file or folder. Work from another Git checkout uses release-bundle ingestion. Imports copy Markdown into content/, create a manifest in publications/, mark the publication as imported by default, and write a report under reports/imports/.
Preview first:
make import source=/path/to/essay.md kind=essay dry_run=1Import a single essay:
make import source=/path/to/essay.md kind=essay title="Capitalism Behaves Like Cancer"Import a folder-based book:
make import source=/path/to/empire-exposed kind=book title="Empire Exposed"imported means the piece came from existing source and has not been reviewed for publication inside this repo yet. draft means new writing actively authored here. Normal public builds exclude imported material; draft preview builds include it. See docs/importing.md for details.
Longer work often lives in its own repository, with its own revision history and
often its own production machinery. That work arrives here as a release
bundle: a copied directory holding publication.json, provenance.json, and
canonical Markdown under content/. Neither repository depends on the other,
and nothing here reads a writing workspace during a build.
Preview first. A dry run is genuinely non-mutating:
make ingest-release source=/path/to/package dry_run=1
make ingest-release source=/path/to/packageIngestion is a merge, not an overwrite. The writing workspace owns the work —
identity, title, ordered sources, author — and those fields are replaced. This
repository owns the catalogue — description, tags, order, relationships,
editions, target_words — and those survive a re-ingest. Markdown the bundle no
longer carries is removed from that publication's own content root, and only
from there.
Three gates stand between a bundle and the public: the writing workspace's own
release gate, this repository's published-only rule, and a check on whether an
unreleased manuscript may enter a world-readable repository at all. See
docs/release-bundles.md.
This is a different operation from make import, which derives a manifest from
command-line flags and is right only for loose Markdown with no publishing
history.
A publication can optionally describe released editions: a web edition, an EPUB,
a paperback with an ISBN. Only format and status are required, so essays,
poems, and fragments never carry commercial metadata.
Nothing here invents an ISBN, price, date, URL, or distributor. The validator refuses wrong values rather than missing ones: a failed ISBN checksum, a price without a currency, an edition marked available with no way to reach it, or an edition marked available on a publication that is not published.
A PDF is not a print-ready interior. See docs/editions.md and docs/print-production.md.
- Create a Markdown file in
content/essays/, for examplecontent/essays/my-new-essay.md. - Add a manifest in
publications/, for examplepublications/my-new-essay.json. - Set
kindtoessay, give it a uniqueidandslug, and pointsourceat the Markdown file. - Run
make validateandmake site.
Minimal example:
{
"id": "my-new-essay",
"title": "My New Essay",
"author": "Matt Faherty",
"kind": "essay",
"slug": "my-new-essay",
"description": "A short description for the site and feeds.",
"status": "draft",
"tags": ["essay"],
"source": "content/essays/my-new-essay.md",
"web_route": "/essays/my-new-essay/",
"output_formats": ["site", "markdown"],
"downloadable": true
}- Create a folder such as
content/books/my-book/. - Put your Markdown files inside it in reading order, for example
01-opening.md,02-middle.md,03-ending.md. - Add a manifest in
publications/. - Set
kindtobook. - Use
sourcefor the directory andsourcesfor explicit ordering when needed.
Example:
{
"id": "my-book",
"title": "My Book",
"author": "Matt Faherty",
"kind": "book",
"slug": "my-book",
"description": "A longer work built from multiple Markdown files.",
"status": "draft",
"tags": ["book"],
"source": "content/books/my-book",
"sources": ["01-opening.md", "02-middle.md", "03-ending.md"],
"web_route": "/books/my-book/",
"output_formats": ["site", "markdown", "pdf", "epub", "docx"],
"downloadable": true
}Collections and series can have their own landing-page Markdown plus their own manifests.
- A
collectiongroups related pieces under one publication route. - A
seriesprovides a web-facing home for a sequence of related works. - Both can declare ordered
membersusing publication ids.
Member publications can also point back to a parent with series or collection, but the simplest pattern is to keep membership order in the parent manifest.
Create a local virtual environment and install dependencies:
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -r requirements.txtPandoc, XeLaTeX, and DejaVu Serif are required to verify requested document exports. The release workflow installs them.
Run the full local build:
make buildUseful individual commands:
make validate
make site
make downloads
make smoke
make cleanRun the test suite:
make testTests use Python's standard-library unittest, so there is no extra dependency.
They exercise release bundles, publishing boundaries, bylines, artwork, footnotes, poetry, and the edition model against synthetic fixtures. For browser and visual review, see Editorial Renaissance.
make serveThis serves the built public output on loopback at http://127.0.0.1:8000/. Use the local preview for editorial work.
make preview id=your-publication-slugThe preview rebuilds dist/preview/ when Markdown or metadata changes. Add with_downloads=1 to regenerate downloads from reviewed sources.
The fastest path is to use the scaffold:
make new kind=essay title="My New Essay"That creates a Markdown source under content/ and a matching manifest under publications/.
Write in the Markdown file, then use the manifest status to control visibility:
draft,imported,review, andprivatestay out of normal public builds.publishedappears in public listing pages, search, feeds, and downloads.
Before publishing, run:
make validate
make build
make smoke.github/workflows/publish-site.yml builds and deploys on main. Its build job also requires the main ref for manual runs. It verifies the public artifact before uploading dist/site/. .github/workflows/quality.yml runs pull request checks without deploying.
Before an approved release, run make test build smoke on the proposed revision and review its public output and publication statuses. Merging to main triggers production. After release, check the Pages run, canonical routes, feeds, and downloads at the configured domain. GitHub Pages is the configured host. Earlier Cloudflare documentation describes a historical option.
Every downloadable publication gets a Markdown download in dist/site/downloads/.
The full build generates requested PDF, EPUB, and DOCX files. Missing tools or failures are reported during generation. The release smoke check requires every requested public download. The generic PDF uses XeLaTeX and DejaVu Serif for Unicode text.
Pandoc exports use small kind-aware defaults in site/pandoc/defaults/ for books, collections, essays, pamphlets, poems, and series. See docs/downloads.md.
The site build also writes:
dist/site/publications.jsonfor later search/index workdist/site/feed.jsonas JSON Feed 1.1 anddist/site/rss.xmlas RSS 2.0dist/site/sitemap.xmlanddist/site/robots.txtfor public discoverydist/site/search-index.jsonfor the static client-side search page at/search/
The /search/ page uses plain browser-side JavaScript to load and filter search-index.json. If JavaScript is unavailable, the page still points readers directly at the raw index file.
Search facets are generated from the same visible publication metadata. Readers can filter by kind, tag, year, concept, and reading path while text search still covers titles, descriptions, tags, excerpts, routes, dates, concept titles, path titles, and relationship IDs. Different filter groups combine with AND; multiple choices inside one group match any selected choice. See docs/search.md.
Multi-file publications keep their full publication page as the canonical reading surface.
- The main publication page renders the full work with an on-page table of contents.
- Each section now gets previous/next reading links inside the full page.
- Multi-file publications can also emit simple standalone section pages with predictable routes based on source filenames, such as
/books/example-book/01-opening/.
This keeps long-form and grouped reading navigable without turning the site into a reader app.
The site builder uses site/site.json base_url to generate canonical URLs. Social preview image metadata comes from social_image, social_image_width, social_image_height, and social_image_alt; social_image may be a site-local path such as /assets/social-preview.jpg or an absolute URL.
- Index, listing, and search pages use site-level metadata.
- Publication pages use publication metadata.
- Standalone section pages point their canonical URL back to the full publication page so the full publication remains the canonical version.
- The build also writes
dist/site/CNAMEfrom the samebase_url, so the deployed Pages artifact declares the same custom domain used by the generated metadata.
Use make smoke after a build to confirm that core outputs exist, including the homepage, CNAME, custom-domain canonical metadata, JSON indexes, search page, example publication routes, multi-file section routes, and downloads directory.
The configured canonical domain is bionicwritinglab.com.
The repo handles the in-repo pieces:
site/site.jsonsetsbase_urltohttps://bionicwritinglab.com.make buildwritesdist/site/CNAME.- the quality and publish workflows smoke-check the generated artifact.
Outside the repo, point DNS and Pages settings at bionicwritinglab.com, then verify HTTPS after propagation.
For the GitHub Actions Pages workflow, the Pages custom-domain setting is still required outside the repo; the generated CNAME makes the built artifact reproducible and inspectable.
See docs/custom-domain.md for the domain checklist and docs/importing-villain.md for the future Villain import plan.