type: decision
status: active
timestamp: 2026-06-21
tags: [decision, books, publishing, markua, pandoc, oriz-book-build, leanpub, kdp, gumroad, lemonsqueezy, draft2digital]

Book publish pipeline — Markua .md → 5 channels via @chirag127/oriz-book-build + omni-publish

Books written as Markua Markdown and published via pipeline (Leanpub-compatible), built by the new @chirag127/oriz-book-build npm package\ (17th family package) which wraps Pandoc to emit EPUB3 + PDF + MOBI artefacts.\ omni-publish takes those artefacts and fans out to 5 channels: Leanpub (Markua\ git push, 80% royalty) + Draft2Digital aggregator (manual upload, documented)\ + Gumroad (API auto, 10%) + LemonSqueezy (API auto, 5%+50\xA2 MoR) + Amazon KDP\ (browser-uploader bot, no API). Plus Google Play Books Partner Center (manual\ upload, ISBN-recommended). 5 first books locked, all brand-first naming. Prose\ licensed CC-BY-NC-ND 4.0 + code samples MIT.

Book publish pipeline

Decision

Books are written in .md files using Markua-flavoured Markdown (a Leanpub-friendly Markdown superset). The new npm package @chirag127/oriz-book-build (v0.1.0, 17th family package) wraps Pandoc to emit EPUB3 + PDF + MOBI from manuscript/*.md into dist/. On every tag push (v*.*.*) in a book repo, @chirag127/omni-publish takes the dist artefacts and fans out to 5 channels:

  1. Leanpub — Markua git push to manuscript branch, 80% royalty - 50¢/sale
  2. Draft2Digital — aggregator distributing to B&N / Kobo / Apple Books / Scribd; no API — manual upload, documented in book.json
  3. Gumroad — REST API automated, 10% flat fee
  4. LemonSqueezy — REST API automated, 5% + 50¢ Merchant-of-Record (handles EU VAT)
  5. Amazon KDPno public API ever existed; browser-uploader bot via Playwright on Linux CI

Plus Google Play Books Partner Center (manual upload, ISBN-recommended; tracked in book.json but flagged as manual, not auto).

Book repo layout

Standard layout for every chirag127/<slug>-book repo:

<slug>-book/
+-- manuscript/
¦   +-- 00-frontmatter.md
¦   +-- 01-introduction.md
¦   +-- 02-chapter-one.md
¦   +-- ...
¦   +-- 99-backmatter.md
+-- assets/
¦   +-- cover-2560x1600.png
¦   +-- cover-1600x2560.jpg     # KDP front cover
¦   +-- figures/
+-- book.json                    # metadata + per-channel publish toggles
+-- LICENSE                      # CC-BY-NC-ND 4.0 (prose) + MIT (code samples)
+-- README.md                    # cover + sample chapter excerpt + buy links
+-- .github/workflows/
    +-- release.yml              # tag-push ? oriz-book-build ? omni-publish

book.json shape:

{
  "title": "Oriz Stack",
  "subtitle": "Astro 6 + Cloudflare + Firebase Spark for the indie developer",
  "author": "Chirag Singhal",
  "isbn_print": null,
  "isbn_ebook": null,
  "price_base_usd": 19,
  "price_pro_usd": 39,
  "price_base_inr": null,
  "price_pro_inr": null,
  "channels": {
    "leanpub": { "enabled": true, "slug": "oriz-stack" },
    "gumroad": { "enabled": true, "product_id": null },
    "lemonsqueezy": { "enabled": true, "variant_id": null },
    "draft2digital": { "enabled": true, "manual": true, "note": "no API; upload EPUB+cover from dist/ after each release" },
    "kdp": { "enabled": true, "manual_bot": true, "asin": null },
    "google_play_books": { "enabled": false, "manual": true, "note": "ISBN required" }
  }
}

Naming convention

Mixed by audience. Three patterns are valid:

  1. Brand-first (Oriz <Topic>) — tool-companion and family-aligned books. The 5 locked first books all use this.
  2. Descriptive — general SEO-bait books not tied to the Oriz brand. Reserved for future.
  3. Author-first — personal essays. Currently unused; could surface in future.

For now: all 5 locked books are brand-first.

Slug suffix

Repo slug: chirag127/<slug>-book (matches family <role>-suffix convention per repo-naming-suffixes). On-disk path: repos/oriz/own/content/books/<slug>-book/.

Pricing

Tiered by category to match buyer purchasing power:

CategoryBasePro / extendedExamples
Technical (English-speaking audience)$19$39 (Pro bundle = book + code repo access + Discord)Oriz Stack, Oriz PWA Playbook
Indian-market finance/education?499?999 (Pro = book + spreadsheet templates + 1-month support)Oriz Paisa, Oriz NCERT, Oriz Janaushdhi
Personal essays$9 PWYW from $0 floorn/aOriz Me
Tool-companion (single-product walkthrough)$14n/aOriz PDF

PWYW handled by Gumroad’s “pay what you want” toggle + LemonSqueezy custom pricing. Leanpub’s variable-pricing minimum is set to $0 with suggested at the base price.

The locked 5 books

1. Oriz Stack

2. Oriz Paisa: Credit Cards India 2026

3. Oriz PDF: From Browser to Native

4. Oriz Janaushdhi: Generic Medicines India

5. Oriz Me: 100-Year Strategy

License

Dual license — CC-BY-NC-ND 4.0 (prose) + MIT (code samples). Source-available for transparency; commercial rights retained on prose. Code samples are MIT so readers can copy them into their own projects without further attribution beyond the standard MIT notice.

LICENSE file format:

# License

## Prose (manuscript/**)

Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International
(CC-BY-NC-ND 4.0).
<https://creativecommons.org/licenses/by-nc-nd/4.0/>

## Code samples (any fenced code block, plus examples/**)

MIT License — Copyright (c) 2026 Chirag Singhal
<https://opensource.org/licenses/MIT>

Build CLI

@chirag127/oriz-book-build v0.1.0 stub published 2026-06-21 alongside this decision.

omni-publish integration

Book repo’s .github/workflows/release.yml on v*.*.* tag push:

jobs:
  build-and-publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - run: pnpm install
      - run: pnpm oriz-book build
      - uses: chirag127/omni-publish-npm-pkg/.github/workflows/cross-post.yml@main
        with:
          title: "${{ github.event.head_commit.message }}"
          body_path: "RELEASE_NOTES.md"
          canonical_url: "https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}"
          type: "book"
          dist_dir: "dist"
        secrets: inherit

omni-publish reads book.json from repo root, then dispatches each channel’s adapter with the relevant dist artefact (EPUB to Leanpub/D2D/KDP/Google, PDF to Gumroad/LemonSqueezy, MOBI optional). Channels marked enabled: false or manual: true skip auto-publish but log a Telegram drafts-channel message with the dist file path + upload-URL reminder.

Cross-refs


Edit on GitHub · Back to index