Skip to content

Commit

Permalink
WDSUS-46 - Update readme and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
khleomix committed Oct 11, 2023
1 parent d56bc1c commit 9d21fa4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,18 @@ Command | Action
`npm run format` | Fix all CSS, JS, MD, and PHP formatting errors automatically
`npm run report` | Gives detailed information on coding standards violations in PHP code

### Building a block with wpcli
### Scaffold a block

In order to build a block, run the following wpcli script.

Note: If you're using Local, you can open the shell from within Local to do this. `Sitename -> Open site shell`.
In order to scaffold a custom block, run the following script in the root of the theme.

```bash
wp wds create_portable_block myblock --title="This is myblock" --desc="This block is used for wds." --keyword="myblock" --icon="table-row-before" --namespace="wds"
npm run create-block myblock
```

This will scaffold out a block inside of the `blocks` folder in the theme. Replace `myblock` with the name of your block and update the other items `title`, `desc`, `keyword`, `icon`, `namespace` with the appropriate information.

Note: If you don't see your new block available under the block listing in the editor after following the above steps, try changing the namespacing in your block's `block.json` to the following format `your-namespace/blockname` and check again.
This will scaffold out a block inside of the `blocks` folder in the theme. Replace `myblock` with the name of your block and run `npm run build` to build the block.

## Contributing and Support

Your contributions and [support tickets](https://github.com/WebDevStudios/wd_f/issues) are welcome. Please see our [contributing guidelines](https://github.com/WebDevStudios/wd_f/blob/main/CONTRIBUTING.md) before submitting a pull request.

wd_f is free software, and is released under the terms of the GNU General Public License version 2 or any later version. See [LICENSE.md](https://github.com/WebDevStudios/wd_f/blob/main/LICENSE.md) for complete license.
`wd_f` is free software, and is released under the terms of the GNU General Public License version 2 or any later version. See [LICENSE.md](https://github.com/WebDevStudios/wd_f/blob/main/LICENSE.md) for complete license.
14 changes: 4 additions & 10 deletions docs/developers/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@
## Custom Functions

<details>
<summary>Building a block with wpcli</summary>
<summary>Scaffolding a block</summary>

<p>In order to build a block, run the following wpcli script.</p>

<p>Note: If you're using Local, you can open the shell from within Local to do this.
<code>Sitename -> Open site shell</code>.</p>
<p>In order to build a block, run the following script.</p>

<code>
wp wds create_portable_block myblock --title="This is myblock" --desc="This block
is used for wds." --keyword="myblock" --icon="table-row-before" --namespace="wds"
npm run create-block myblock"
</code>

<p>This will scaffold out a block inside of the <code>blocks</code> folder in the
theme. Replace <code>myblock</code> with the name of your block and update the
other items <code>title</code>, <code>desc</code>, <code>keyword</code>, <code>icon</code>,
<code>namespace</code> with the appropriate information.</p>
theme. Replace <code>myblock</code> with the name of your block and run <code>npm run build</code> to build the block.</p>
</details>

0 comments on commit 9d21fa4

Please sign in to comment.