Download the PHP package mccomaschris/parkour without Composer
On this page you can find all versions of the php package mccomaschris/parkour. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mccomaschris/parkour
More information about mccomaschris/parkour
Files in mccomaschris/parkour
Package parkour
Short Description A WP-CLI command to quickly scaffold ACF blocks for Timber themes. PARKOUR!
License MIT
Informations about the package parkour
🏃 Parkour
PARKOUR! A WP-CLI command to quickly scaffold ACF blocks for Timber themes.
Named after the iconic Office scene where Andy, Michael, and Dwight leap around the office yelling "PARKOUR!" - because creating blocks should be just as quick and fun.
Features
- 🚀 Interactive block creation with beautiful Laravel Prompts
- 📦 Generates all necessary files (block.json, callback.php, Twig template)
- 🎨 Optional JavaScript and CSS file generation
- ✅ Follows best practices for Timber + ACF blocks
- 🔧 Customizable templates based on your theme patterns
Requirements
- PHP 8.3+
- Timber
- ACF Pro
- WordPress with WP-CLI (optional - for WP-CLI mode)
Installation
From your theme directory, run:
Then use the standalone binary:
WP-CLI Setup (Optional)
If you prefer using WP-CLI instead of the standalone binary, create a wp-cli.yml file in your theme or project root:
For Bedrock/project-level installations, add the WordPress path:
Usage
Standalone Mode (Recommended)
Run from your theme directory:
The standalone binary:
- Detects your theme slug from
style.css"Text Domain:" header (or uses directory name) - Creates blocks in the current working directory
- Works without WordPress being loaded
WP-CLI Mode
If you set up the wp-cli.yml file, you can use WP-CLI commands:
Interactive Prompts
When running without --skip-prompts, you'll be prompted for:
- Block name
- Title
- Description
- Category
- Icon
- Keywords
- Whether to include JS/CSS files
What Gets Created
When you create a block named hero-section, Parkour generates:
File Structure
block.json
Standard WordPress block metadata following ACF block conventions.
callback.php
Render callback with:
- Timber context setup
- Block and field data
- CSS class management
- Background color support
- Anchor support
- Optional JS/CSS enqueuing
{block-name}.twig
Twig template with:
- Block wrapper with classes
- Anchor ID support
- Preview mode detection
- Field usage examples
{block-name}.js (optional)
JavaScript with:
- Block initialization
- DOM ready handling
- Scoped to avoid conflicts
{block-name}.css (optional)
Styles with:
- Block-specific selectors
- Preview mode styles
Customization
Modify Templates
Templates are located in templates/ and use Mustache syntax. You can fork and customize:
block.json.mustachecallback.php.mustacheblock.twig.mustacheblock.js.mustacheblock.css.mustache
Block Patterns
The generated blocks follow this pattern:
- Theme prefix for all classes and functions
- Support for background colors via ACF field
- Automatic anchor and className support
- Filemtime-based cache busting for assets
- Preview mode detection in Twig