-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Open
Listener430
wants to merge
41
commits into
main
Choose a base branch
from
DEV-2835
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 29 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
f6b4419
docs generate
Listener430 273a783
readme buildout using Gomplate 3.x with teml.Exec issue fixed
Listener430 d599ff4
readme generationggomplate 3.11.8 work,s no terrafor yet
Listener430 1077a1a
fix for windwos gomplate
Listener430 d051851
gomodtidy
Listener430 9a672dc
dependant acceptnace tests fix + draft test cases
Listener430 38060c9
Update internal/exec/docs_generate.go
Listener430 297e7b3
use go-getter to download files
Listener430 492fa72
atmos.yaml
Listener430 33545f5
Update cmd/docs_generate.go
Listener430 f48f17c
examples back
Listener430 50469c4
terrafrom test/mergo
Listener430 9268c2b
moving fixtures to tests and reverting back the comments in template …
Listener430 77db177
test cases
Listener430 6bad4f7
initial version of documentation
Listener430 7e7a8d7
mdx fixes
Listener430 87f7a56
mdx layout fix
Listener430 e385bad
typo fix
Listener430 b023067
defer removeTempDir move
Listener430 962e741
Update tests/test-cases/docs-generate.yaml
Listener430 b802e06
Update tests/test-cases/docs-generate.yaml
Listener430 ead222b
Update tests/test-cases/docs-generate.yaml
Listener430 a07feaf
Update tests/test-cases/docs-generate.yaml
Listener430 84f7938
Update tests/test-cases/docs-generate.yaml
Listener430 0a7092c
Update tests/test-cases/docs-generate.yaml
Listener430 c511012
Update tests/test-cases/docs-generate.yaml
Listener430 849ed76
comments from pr
Listener430 2a45a1e
deleted README.md.gotmpl from the root
Listener430 3426aeb
terraform test template
Listener430 711d791
local atmos.yaml
Listener430 b2cf200
Update pkg/schema/schema.go
Listener430 b548578
Update cmd/docs_generate.go
Listener430 50f7c36
Update internal/exec/template_utils.go
Listener430 43b0c35
Update internal/exec/file_utils.go
Listener430 142a094
Update internal/exec/template_utils.go
Listener430 47cedfb
Update internal/exec/file_utils.go
Listener430 b4b7579
changing func signatures
Listener430 eaf1f1e
test cases
Listener430 1c19bc2
Merge branch 'main' into DEV-2835
Listener430 8e1398c
Tidy go.mod and go.sum
Listener430 bbbaf4d
comments
Listener430 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
version: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
check: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
enabled: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 README.yaml data sources | ||
and then using templates to produce README.md files. Also supports terraform-docs injection.`, | ||
Listener430 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 { | ||
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.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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