Skip to content

Commit

Permalink
docs(web): amend docs formatting for preset (#9129)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndcunningham authored Feb 25, 2022
1 parent eaeb826 commit 6c4c6cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/shared/nx-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,21 @@ A Preset is a customization option which you provide when creating a new workspa
At its core a preset is a generator, which we can create inside of a plugin.
If you **don't** have an existing plugin you can create one by running

```
```bash
npx create-nx-plugin my-org --pluginName my-plugin
```

To create our preset inside of our plugin we can run

```
```bash
nx generate @nrwl/nx-plugin:generator --name=preset --project=happynrwl
```

> Note: the word `preset` is required for the name of this generator
You should have a similar structure to this:

```
```treeview
happynrwl/
├── e2e
├── jest.config.js
Expand All @@ -220,7 +220,7 @@ The **generator.ts** provides an entry point to the generator. This file contain

Here is the sample generator function which you can customize to meet your needs.

```
```typescript
export default async function (tree: Tree, options: PresetGeneratorSchema) {
const normalizedOptions = normalizeOptions(tree, options);
addProjectConfiguration(
Expand Down Expand Up @@ -254,7 +254,7 @@ Before you are able to use your newly created preset you must package and publis

After you have published your plugin to a registry you can now use your preset when creating a new workspace

```
```bash
npx create-nx-workspace my-workspace --preset=my-plugin-name
```

Expand Down

1 comment on commit 6c4c6cd

@vercel
Copy link

@vercel vercel bot commented on 6c4c6cd Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.