-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support atmos docs generate feature natively #934
base: main
Are you sure you want to change the base?
Changes from 46 commits
f6b4419
273a783
d599ff4
1077a1a
d051851
9a672dc
38060c9
297e7b3
492fa72
33545f5
f48f17c
50469c4
9268c2b
77db177
6bad4f7
7e7a8d7
87f7a56
e385bad
b023067
962e741
b802e06
ead222b
a07feaf
84f7938
0a7092c
c511012
849ed76
2a45a1e
3426aeb
711d791
b2cf200
b548578
50f7c36
43b0c35
142a094
47cedfb
b4b7579
eaf1f1e
1c19bc2
8e1398c
bbbaf4d
08a541e
996c256
8d80484
df53f6e
bb34ad2
8aa29a8
eae50f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -389,6 +389,26 @@ settings: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
color: "${colors.muted}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
italic: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
generate: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
input: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- "./README.yaml" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# To Do: template can be a remote URL/github, using this local for testing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
template: "https://raw.githubusercontent.com/cloudposse/.github/5a599e3b929f871f333cb9681a721d26b237d8de/README.md.gotmpl" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# The final README | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
output: "README.md" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
terraform: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
enabled: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
format: "markdown" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
show_providers: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
show_inputs: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
show_outputs: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sort_by: "name" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hide_empty: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
indent_level: 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+393
to
+409
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
https://github.com/cloudposse-terraform-components/aws-identity-center |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
version: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
check: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
enabled: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
e "github.com/cloudposse/atmos/internal/exec" | ||
) | ||
|
||
// docsGenerateCmd generates README.md | ||
Check failure on line 9 in cmd/docs_generate.go
|
||
var docsGenerateCmd = &cobra.Command{ | ||
Use: "generate [path]", | ||
Aliases: []string{"docs"}, | ||
Short: "Generate docs (README.md) from README.yaml data and templates", | ||
Long: `Generate documentation by merging multiple YAML data sources | ||
and then using templates to produce documentation files. Also supports native terraform-docs injection.`, | ||
Example: `Generate a README.md in the current path: | ||
atmos docs generate | ||
|
||
Generate a README.md for the VPC component: | ||
atmos docs generate components/terraform/vpc | ||
|
||
Generate all README.md (recursively searches for README.yaml to rebuild docs): | ||
atmos docs generate --all`, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
Check failure on line 24 in cmd/docs_generate.go
|
||
return e.ExecuteDocsGenerateCmd(cmd, args) | ||
}, | ||
} | ||
|
||
// generateDocsCmd is a new top-level command so we can do `atmos generate docs`. | ||
var generateDocsCmd = &cobra.Command{ | ||
Use: "generate", | ||
Short: "Generic generation commands (e.g. docs, scaffolding, etc.)", | ||
Long: `A collection of subcommands for generating artifacts such as documentation or code.`, | ||
} | ||
|
||
func init() { | ||
docsGenerateCmd.Flags().Bool("all", false, "Recursively rebuild README.md files from any discovered README.yaml") | ||
docsCmd.AddCommand(docsGenerateCmd) | ||
RootCmd.AddCommand(generateDocsCmd) | ||
generateDocsCmd.AddCommand(docsGenerateCmd) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not be modifying the root
atmos.yaml
for testing. Instead, please use fixtures