From 164e9e082731644f081f861c4a54134849d0c7ce Mon Sep 17 00:00:00 2001 From: guido Date: Fri, 27 Oct 2023 13:27:53 +0200 Subject: [PATCH] Reorganize Documentation Make the main README as simple as possible to give an overview of the project and structure the documentation. --- README.md | 48 ++++++----------------------------------- docs/app-integration.md | 29 +++++++++++++++++++++++++ docs/development.md | 12 +++++++++++ 3 files changed, 48 insertions(+), 41 deletions(-) create mode 100644 docs/app-integration.md create mode 100644 docs/development.md diff --git a/README.md b/README.md index 9d148c1..1e1eed8 100644 --- a/README.md +++ b/README.md @@ -2,53 +2,19 @@ [![PHP Quality Assurance](https://github.com/inpsyde/gutenberg-versions-manager/actions/workflows/php-qa.yml/badge.svg)](https://github.com/inpsyde/gutenberg-versions-manager/actions/workflows/php-qa.yml) -The Gutenberg Version Manager is a Wp App Container Package which allow Themes to specify a list of -compatible Gutenberg Versions and load the first compatible one. +The Gutenberg Version Manager is a [Wp App Container](https://github.com/inpsyde/wp-app-container) Package allowing themes to specify a list of compatible Gutenberg Versions and load the first compatible one. -The Package will look into the current theme `config/gutenberg.php` file to retrieve the list of the compatible Gutenberg -versions. +The package is served as a WordPress Mu Plugin and is installed under the appropriate WP directory. -This package depends on [Gutenberg Versions Mirror](https://github.com/inpsyde/gutenberg-versions-mirror) to load the compatible version of Gutenberg. - -Here an example of how the file looks like - -```php - [ - '13.9.0', - '12.8.0', - '11.14.1', - ], -]; -``` - -## Application Integration - -Just add the Package to the application. +## Documentation -```php -\Inpsyde\App\Bootstrap\app()->addPackage( - \Inpsyde\GutenbergVersionManager\Package::new() -); -``` - -## Development - -The project rely on `@wordpress/env` and it contains all the necessary configuration to have the development environment up and running. - -Simply run `yarn wp-env start` or `yarn wp-env start --xdebug` and you're good to go. - -The development configuration includes - -- A small theme which is configured to require a compatible Gutenberg version -- A Mu Plugin which is configured to load the Gutenberg Version Manager Package +[Development]('./docs/development.md') +[App Integration]('./docs/app-integration.md') ## Requirements +This package depends on [Gutenberg Versions Mirror](https://github.com/inpsyde/gutenberg-versions-mirror) to load the compatible version of Gutenberg. + * PHP >= 8.0 * WordPress >= 6.2 diff --git a/docs/app-integration.md b/docs/app-integration.md new file mode 100644 index 0000000..3d386d5 --- /dev/null +++ b/docs/app-integration.md @@ -0,0 +1,29 @@ +# Application Integration + +The Mu Plugin is a Wp App Container Package and as such shall be consumed at application level. + +Whatever way you boot your application what you need to do is simply add the Package to the application. + +```php +\Inpsyde\App\Bootstrap\app()->addPackage( + \Inpsyde\GutenbergVersionsManager\Package::new() +); +``` + +The Package will read the current theme `config/gutenberg.php` file to retrieve the list of the compatible Gutenberg versions. + +Here an example of how the file looks like + +```php + [ + '13.9.0', + '12.8.0', + '11.14.1', + ], +]; +``` diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 0000000..c80d421 --- /dev/null +++ b/docs/development.md @@ -0,0 +1,12 @@ +# Development + +The project rely on [@wordpress/env](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/), and it contains all the necessary configuration to have the development environment up and running. + +Simply run `yarn wp-env:start` or `yarn wp-env:start --xdebug` and you're good to go. + +To stop the environment run `yarn wp-env:stop` + +The development configuration includes the followings within the `.development` directory at the root of the project. + +- A small theme which is configured to require a compatible Gutenberg version +- A Mu Plugin which is configured to load the Gutenberg Version Manager Package