- Docker
- Node/npm
- Composer
-
Set up repo dependencies.
npm install composer install TEXTDOMAIN=wporg-book composer exec update-configs -
Build the theme.
npm run build
-
Start the local environment.
npm wp-env start
-
Visit site at localhost:8888.
-
Log in with username
adminand passwordpassword.
Chapters are imported from the Markdown in WordPress/library. Its manifest.json maps each chapter file to the slug of an existing post here, and inc/class-chapter-importer.php keeps those posts' content and titles in step with the repo. It never creates or deletes posts, and it leaves dates, slugs and the mb_* navigation meta alone.
It needs the wporg-markdown plugin from the Meta repo and Jetpack's Markdown library on the site. The scheduled import stays off until it's turned on:
wp book import --dry-run # lists each chapter and whether it would change
wp book import # imports once
wp option update wporg_book_import_enabled 1 # then imports hourlywp book import --force converts every chapter again, which is needed after changing the conversion code (or bump Chapter_Importer::TRANSFORM_VERSION).
To try it locally, add both plugins in .wp-env.override.json, pointing wporg-markdown at a checkout of WordPress/wordpress.org. To import from a branch of the library, filter wporg_book_manifest_url.