Skip to content

Commit 22de4bb

Browse files
committed
Merge branch 'feature/dev-3182-add-pager-to-atmos-describe-affected-command' of https://github.com/cloudposse/atmos into feature/dev-3182-add-pager-to-atmos-describe-affected-command
2 parents 5c2701e + 94cc2ce commit 22de4bb

40 files changed

+2640
-27
lines changed

atmos.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,28 @@ settings:
383383
color: "${colors.muted}"
384384
italic: true
385385

386+
docs:
387+
generate:
388+
# Generate README in current working directory
389+
readme:
390+
base-dir: .
391+
input:
392+
- "./README.yaml"
393+
# To Do: template can be a remote URL/github, using this local for testing
394+
template: "https://raw.githubusercontent.com/cloudposse/.github/5a599e3b929f871f333cb9681a721d26b237d8de/README.md.gotmpl"
395+
# The final README
396+
output: "./README.md"
397+
terraform:
398+
source: src/
399+
enabled: false
400+
format: "markdown"
401+
show_providers: false
402+
show_inputs: true
403+
show_outputs: true
404+
sort_by: "name"
405+
hide_empty: false
406+
indent_level: 2
407+
386408
version:
387409
check:
388410
enabled: true

cmd/describe_component.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import (
99
u "github.com/cloudposse/atmos/pkg/utils"
1010
)
1111

12-
var (
13-
errInvalidFlag = errors.New("invalid arguments. The command requires one argument `component`")
14-
)
12+
var errInvalidFlag = errors.New("invalid arguments. The command requires one argument `component`")
1513

1614
// describeComponentCmd describes configuration for components
1715
var describeComponentCmd = &cobra.Command{

cmd/docs_generate.go

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package cmd
2+
3+
import (
4+
"github.com/spf13/cobra"
5+
6+
e "github.com/cloudposse/atmos/internal/exec"
7+
)
8+
9+
// docsGenerateCmd is the subcommand under docs that groups generation operations.
10+
var docsGenerateCmd = &cobra.Command{
11+
Use: "generate",
12+
Short: "Generate documentation artifacts",
13+
Long: `Generate documentation by merging YAML data sources and applying templates.
14+
Supports native terraform-docs injection.`,
15+
Example: `Generate the README.md in the current directory:
16+
atmos docs generate readme`,
17+
Args: cobra.ExactArgs(1),
18+
ValidArgs: []string{"readme"},
19+
RunE: func(cmd *cobra.Command, args []string) error {
20+
if len(args) != 1 {
21+
return ErrInvalidArguments
22+
}
23+
err := e.ExecuteDocsGenerateCmd(cmd, args)
24+
if err != nil {
25+
return err
26+
}
27+
return nil
28+
},
29+
}
30+
31+
func init() {
32+
docsCmd.AddCommand(docsGenerateCmd)
33+
}

go.mod

+12-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)