# Gutenberg

 - Drupal Gutenberg brings the powerful content editing experience of Gutenberg
   to Drupal.

 - [Drupal](https://www.drupal.org/) +
   [Gutenberg](https://wordpress.org/gutenberg/) is a powerful combo. Drupal 8 is a rock solid CMS framework packed with powerful admin features.
   Our only complaint? Drupal 8 is missing a modern UI for rich content
   creation. Let’s change this!

 - More functionality wrapped in a smooth UI. Hundreds of hours with user
   testing. Decoupled. React.js. Clean output. Open source.

 - [Gutenberg on GitHub](https://github.com/WordPress/gutenberg/)

 - For a full description of the module, visit the
[project page](https://www.drupal.org/project/gutenberg)

 - To submit bug reports and feature suggestions, or to track changes
[issue queue](https://www.drupal.org/project/issues/gutenberg)

  - Also check [Gutenberg-JS](https://www.npmjs.com/package/@frontkom/gutenberg-js), a stand-alone Gutenberg editor for your custom sites or web apps.

## Contents of this file

 - Requirements
 - Installation
 - Configuration
 - Maintainers


## Requirements

No specific requirements.

## Installation

Install as you would normally install a contributed Drupal module. For further
information, see
[Installing Drupal Modules](https://www.drupal.org/docs/extending-drupal/installing-drupal-modules).


## Configuration

 - To test the module, simply download it from the
   [Drupal Gutenberg project page](https://www.drupal.org/project/gutenberg)
   and enable it.

 - Then go to any content type edit page and enable *Gutenberg Experience*.

 - Assign the `use gutenberg` permission and access to the "Gutenberg" text format to all desired user roles.

## Development

  Node.js 18+ is required.
  - `npm install`
  - Watching file while developing: `npm start`
  - Build: `npm run build`

For custom block development, check the `example_block` sub-module.

## Updating WordPress Gutenberg Packages

The `@wordpress/*` npm packages are pinned to specific versions that match a WordPress release. A helper script resolves the correct package versions from the npm dist-tag for a given WP version.

Steps to update:
 1. `node scripts/update-wp-packages.js <wp-version>` (e.g. `6.9`). Use `--dry-run` first to preview changes.
 2. `npm install`
 3. `npm run build:vendor` — compiles every `@wordpress/*` package into `js/vendor/gutenberg/`, copies third-party libraries, and regenerates `gutenberg.libraries.yml`.
 4. `npm run build` — builds the module's own packages under `build/`.
 5. Review the `gutenberg.libraries.yml` diff, clear the Drupal cache and test.

Steps 3 and 4 can be combined with `npm run release`.

If `@wordpress/block-editor` was updated, verify that the patch file in `patches/` still applies cleanly. If not, manually fix the patched file and run `npx patch-package @wordpress/block-editor`.
