Skip to content

Commit

Permalink
Update-docs-Getting-started-vs-code (#1459)
Browse files Browse the repository at this point in the history
## Description

Current: Docs steps for adding schema validation was confusing to follow

Changes:

- Clarification of steps for adding schema validation
- added code example for adding schema version to a yaml file

## Related Issue

Fixes #


## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

---------

Co-authored-by: Wayne Starr <[email protected]>
  • Loading branch information
Madeline-UX and Racer159 authored Mar 21, 2023
1 parent c8a65f5 commit 4ce7ef3
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions docs/4-user-guide/6-vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ Zarf uses its own [schema](https://github.com/defenseunicorns/zarf/blob/main/zar

## Adding schema validation

1. Open VS Code's `settings.json` file with `CTRL/CMD + SHIFT + P` and search for `Preferences: Open User Settings (JSON)`.
2. Add the below to your config, or modify the existing `yaml.schemas` object to include the Zarf schema.

:::note

The [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) by RedHat is a prerequisite for this feature.

:::
1. Open VS Code
2. Install the [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) by RedHat.
3. Open the VS Code command pallete by typing `CTRL/CMD + SHIFT + P`.
4. Type `Preferences: Open User Settings (JSON)`into the search bar to open the `settings.json` file.
5. Add the below to the settlings.json config, or modify the existing `yaml.schemas` object to include the Zarf schema.

```json
"yaml.schemas": {
"https://raw.githubusercontent.com/defenseunicorns/zarf/main/zarf.schema.json": "zarf.yaml"
}
```
:::tip

yaml.schema line turns the same color as other lines in the setting when installed succesfully!!

:::

## Specifying Zarf's schema version

Expand All @@ -30,3 +32,7 @@ This can be accomplished by adding the below to the **first** line of any given
```

Where `<VERSION>` is one of [Zarf's releases](https://github.com/defenseunicorns/zarf/releases).

### Code Example

![yaml schema](https://user-images.githubusercontent.com/92826525/226490465-1e6a56f7-41c4-45bf-923b-5242fa4ab64e.png)

0 comments on commit 4ce7ef3

Please sign in to comment.