Skip to content

Commit 21646a2

Browse files
committed
update docs
1 parent a6c5074 commit 21646a2

File tree

2 files changed

+52
-39
lines changed

2 files changed

+52
-39
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/README.md

website/docs/cli/commands/docs/docs-generate.mdx

+51-39
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,40 @@ import Screengrab from '@site/src/components/Screengrab'
1010
:::note Purpose
1111

1212
Use this command to generate one of your documentation artifacts (e.g. a README) as defined by the **named** section under `docs.generate.<KEY>` in `atmos.yaml`.
13+
1314
Replace `<KEY>` with the name of the section you want to run (for example, `readme`, `release-notes`, etc.).
1415

1516
:::
1617

1718
In `atmos.yaml`, you can define **one or more** documentation‐generation blocks under `docs.generate`. Each top‐level key becomes a CLI argument:
1819

19-
```yaml
20-
docs:
21-
generate:
22-
readme:
23-
base-dir: .
24-
input:
25-
- "./README.yaml"
26-
template: "https://…/README.md.gotmpl"
27-
output: "./README.md"
28-
terraform:
29-
source: src/
30-
enabled: false
31-
format: "markdown"
32-
show_providers: false
33-
show_inputs: true
34-
show_outputs: true
35-
sort_by: "name"
36-
hide_empty: false
37-
indent_level: 2
38-
39-
release-notes:
40-
base-dir: .
41-
input:
42-
- "./CHANGELOG.yaml"
43-
template: "./release-notes.gotmpl"
44-
output: "./RELEASE_NOTES.md"
45-
46-
```
20+
```yaml
21+
docs:
22+
generate:
23+
readme:
24+
base-dir: .
25+
input:
26+
- "./README.yaml"
27+
template: "https://.../README.md.gotmpl"
28+
output: "./README.md"
29+
terraform:
30+
source: src/
31+
enabled: false
32+
format: "markdown"
33+
show_providers: false
34+
show_inputs: true
35+
show_outputs: true
36+
sort_by: "name"
37+
hide_empty: false
38+
indent_level: 2
39+
40+
release-notes:
41+
base-dir: .
42+
input:
43+
- "./CHANGELOG.yaml"
44+
template: "./release-notes.gotmpl"
45+
output: "./RELEASE_NOTES.md"
46+
```
4747
4848
For each CLI argument the command combines all local or remote YAML files specified at `input` and template file then generates the documentation artifact at the respective `output` folder. In case the template contains `terraform_docs` key, e.g.
4949

@@ -66,8 +66,6 @@ Extra info: {{ $data.extra_info }}
6666
```
6767
the resultant file will also have a corresponding section rendered. By default `terraform.format` is set to `markdown table`, and can also be `markdown`, `tfvars hcl`, and `tfvars json`.
6868

69-
:::
70-
7169
## Dynamic Keys
7270

7371
If you add a new key under docs.generate—say readme2 or release-notes —you simply pass that key to the CLI:
@@ -78,37 +76,51 @@ atmos docs generate readme2
7876
atmos docs generate release-notes
7977
```
8078

81-
:::
82-
8379
## Usage
8480

8581
<Screengrab title="atmos docs generate --help" slug="atmos-docs-generate--help" />
8682

8783
```shell
8884
atmos docs generate readme
89-
9085
```
86+
9187
## Supported Sources for README.yaml and template
9288

9389
### Local Sources
9490

9591
It supports the following local file sources:
92+
9693
- Absolute paths
94+
9795
```yaml
98-
input: - /Users/me/Documents/README.yaml
99-
template: /Users/me/Documents/README.md.gotmpl
96+
docs:
97+
generate:
98+
readme:
99+
input:
100+
- "/Users/me/Documents/README.yaml"
101+
template: "/Users/me/Documents/README.md.gotmpl"
100102
```
101103

102104
- Paths relative to the current working directory
105+
103106
```yaml
104-
input: - ./README.yaml
105-
template: ./README.md.gotmpl
107+
docs:
108+
generate:
109+
readme:
110+
input:
111+
- "./README.yaml"
112+
template: "./README.md.gotmpl"
106113
```
107114

108115
- Paths relative to the `base_dir` defined in `atmos.yaml` CLI config file (then resolved as relative to cwd)
116+
109117
```yaml
110-
input: - terraform/README.yaml
111-
template: terraform/README.md.gotmpl
118+
docs:
119+
generate:
120+
readme:
121+
input:
122+
- "terraform/README.yaml"
123+
template: "terraform/README.md.gotmpl"
112124
```
113125

114126
### Remote Sources

0 commit comments

Comments
 (0)