Skip to content

Commit

Permalink
Reorganize Documentation
Browse files Browse the repository at this point in the history
Make the main README as simple as possible to give an overview of the
project and structure the documentation.
  • Loading branch information
widoz committed Oct 27, 2023
1 parent 1263bcd commit 164e9e0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 41 deletions.
48 changes: 7 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<?php

declare(strict_types=1);

return [
'versions' => [
'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

Expand Down
29 changes: 29 additions & 0 deletions docs/app-integration.md
Original file line number Diff line number Diff line change
@@ -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
<?php

declare(strict_types=1);

return [
'versions' => [
'13.9.0',
'12.8.0',
'11.14.1',
],
];
```
12 changes: 12 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 164e9e0

Please sign in to comment.