Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

WordPress Book

Development

Prerequisites

  • Docker
  • Node/npm
  • Composer

Setup

  1. Set up repo dependencies.

    npm install
    composer install
    TEXTDOMAIN=wporg-book composer exec update-configs
  2. Build the theme.

    npm run build
  3. Start the local environment.

    npm wp-env start
  4. Visit site at localhost:8888.

  5. Log in with username admin and password password.

Chapter import

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 hourly

wp 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages