diff --git a/README.md b/README.md index 0620bf5..7989926 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,13 @@ The skeleton documents what it provides and how to build on it. The framework's ## Get started -Follow [Getting Started](docs/getting-started.md): prerequisites, cloning, installing, naming the plugin, and seeing it running in a local WordPress site. It takes about fifteen minutes. +Create a new plugin with Composer, or clone this repository: + +```bash +composer create-project rtcamp/plugin-elementary my-plugin +``` + +Then follow [Getting Started](docs/getting-started.md): prerequisites, getting the skeleton, installing, naming the plugin, and seeing it running in a local WordPress site. It takes about fifteen minutes. ## What is included diff --git a/docs/getting-started.md b/docs/getting-started.md index a42d738..1646b5e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -14,7 +14,19 @@ An existing local WordPress installation can replace the `wp-env` site; Docker i ## 1. Get the skeleton -Clone it into the folder that will become your plugin directory: +Download it into the folder that will become your plugin directory. Composer gives you a copy without the skeleton's Git history and installs the Composer dependencies: + +```bash +composer create-project rtcamp/plugin-elementary acme-content-features +cd acme-content-features +git init +git add . +git commit -m "chore: start from plugin-elementary" +nvm install +nvm use +``` + +Or clone the repository: ```bash git clone https://github.com/rtCamp/plugin-elementary.git acme-content-features @@ -23,6 +35,8 @@ nvm install nvm use ``` +The first commit gives the Composer copy a baseline to review init's changes against, and the repository lets `npm install` in step 2 set up the Git hooks. + The folder name is the plugin's directory in WordPress and is what you pass to `wp plugin activate`. Name it after the main plugin file init will create (`acme-content-features`), so the local copy matches the release zip. ## 2. Install dependencies