Migration and CI
Migrating from ibis-next
papyrus migrate-ibis
papyrus migrate-ibis -d /path/to/book
papyrus migrate-ibis --force
| Option | Short | Meaning |
|---|---|---|
--dir |
-d |
Book root |
--force |
-f |
Overwrite an existing papyrus.php |
This writes papyrus.php from ibis.php. If you still have custom
assets/theme*.html files from ibis, it rewrites <!-- IBIS:TOC --> to
<!-- PAPYRUS:TOC --> in those project files only. Bundled Papyrus
themes (used when assets/ has no theme override) already use the Papyrus
marker — migrate-ibis does not copy or rewrite vendor assets.
After migration:
- Remove
hi-folks/ibis-nextand any Composer patches for ibis/mPDF. - Point scripts at
papyrus(build,build:pdf,build:site, …). - Decide on themes: keep your ibis HTML under
assets/as overrides, or delete those copies and use Papyrus defaults (optionalpapyrus asset:publishlater if you want local copies to edit). - Run
papyrus doctorand a fullpapyrus build.
Continuous integration
Copy the stub workflow from the Papyrus package:
stubs/github/workflows/book-build.yml
A typical book job installs PHP with dom, gd, mbstring, zip, zlib,
runs composer install, papyrus doctor, optional papyrus lint, then
composer build.
To publish a build:site output on GitHub Pages, add a job that runs
papyrus build:site and deploys the site directory to a gh-pages branch
(see pages.yml
in this repository for a working example, including Chromium for Mermaid).
Programmatic use
use Milon\Papyrus\Config\Project;
$project = Project::load($bookDir);
$book = $project->bookConverter()->convertDirectory($project->contentDir);
Checklist before release
papyrus doctoris cleanpapyrus buildsucceeds for every themepapyrus build:sitelooks right on phone and desktop (try light and dark)- Sample ranges still make sense after reflows (
build:sample) - KDP EPUB opens in Kindle Previewer; print PDF matches trim/bleed
- Pin a Papyrus version in the book’s
composer.json
Report problems at github.com/milon/papyrus/issues.