=== BlockExpander ===
Contributors: tinkergrove
Tags: gutenberg, blocks, emmet, editor, productivity
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Quickly create multiple Gutenberg blocks at once using simple text expressions.

== Description ==

BlockExpander lets you build complex block layouts in seconds by typing short expressions instead of adding blocks one at a time. For example, type `columns>column*3>paragraph` to instantly create a 3-column layout with paragraphs inside each column.

If you've used [Emmet](https://emmet.io/) for writing HTML, you'll feel right at home. If not, don't worry - the syntax is intuitive and easy to learn.

**How It Works:**

1. Edit a page in Gutenberg.
2. Press `Ctrl+Shift+E` (or `Cmd+Shift+E` on Mac) to open the BlockExpander modal
3. Enter an Emmet expression (e.g., `columns>column*3>paragraph`)
4. Press Enter to expand the expression into blocks
5. Blocks are inserted at your cursor location

**Syntax Guide:**

* `>` - Nest blocks inside each other (parent>child)
* `*` - Create multiple blocks (block*3 = three blocks)
* `+` - Create sibling blocks (block1+block2)
* `()` - Group blocks for complex structures (div>(header+main+footer)+(div>p))
* `.` - Add a CSS class (block.classname)
* `#` - Add an anchor/ID (block#anchorname)
* `{}` - Set text content (block{Your text here})

**Syntax Examples:**

* `paragraph` - Creates a paragraph block (you can also use the shortcut `p`)
* `heading` - Creates a heading block (h2 by default)
* `h3` - Creates a heading block with level 3
* `columns>column*3` - Creates a columns block with 3 columns
* `group>paragraph*2` - Creates a group containing 2 paragraphs
* `div.container` - Creates a group block with class "container"
* `section#hero` - Creates a group block with anchor "hero" and section tag
* `paragraph{Hello World}` - Creates a paragraph with custom text
* `ul>li*3` - Creates a list with 3 list items

**Tag Mappings:**

Common HTML tags are mapped to appropriate blocks:

* `div`, `section`, `article` → `core/group`
* `p` → `core/paragraph`
* `h1`-`h6` → `core/heading`
* `img` → `core/image`
* `ul`, `ol` → `core/list`
* `li` → `core/list-item`
* `blockquote` → `core/quote`
* `pre`, `code` → `core/code`
* `hr` → `core/separator`

Any other tag becomes `core/<tagname>` (e.g., `columns` → `core/columns`).

**Features:**

* Familiar Emmet syntax for rapid block creation
* Keyboard-triggered modal for seamless workflow
* Supports nesting, multiplication, classes, IDs, and text content
* Automatic Lorem Ipsum placeholder text for content blocks
* Fully compatible with all core Gutenberg blocks

If you find this plugin useful, consider [buying me a coffee](https://buymeacoffee.com/tinkergrove).

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/blockexpander`, or install through the WordPress plugins screen
2. Activate the plugin through the 'Plugins' screen in WordPress
3. In the block editor, press `Ctrl+Shift+E` (or `Cmd+Shift+E`) to open the expander

== Frequently Asked Questions ==

= What is Emmet? =

Emmet is a toolkit for web developers that uses CSS-selector-like abbreviations to rapidly generate HTML structures. BlockExpander adapts this approach for Gutenberg blocks.

= What keyboard shortcut opens the modal? =

`Ctrl+Shift+E` on Windows/Linux or `Cmd+Shift+E` on Mac.

= Can I use any block name? =

Yes! Any tag name becomes `core/<tagname>`. For example, `paragraph` becomes `core/paragraph`, `columns` becomes `core/columns`, etc.

== Changelog ==

= 0.1.0 =
* Initial release
* Emmet expression parsing via @emmetio/abbreviation
* Modal UI with keyboard shortcut
* Support for nesting, multiplication, classes, IDs, and text content
