cli/templateinit: add links to template READMEs (#2576)

- template init: add links to template docs
- examples: add URL field to examples, ensure that example fields are always non-empty
- cliui: bump wrap width to 80 from 58
This commit is contained in:
Cian Johnston
2022-06-22 14:15:04 +00:00
committed by GitHub
parent 34222b2260
commit 92bcacebde
4 changed files with 25 additions and 9 deletions
+2 -1
View File
@@ -25,9 +25,10 @@ func templateInit() *cobra.Command {
exampleByName := map[string]examples.Example{}
for _, example := range exampleList {
name := fmt.Sprintf(
"%s\n%s\n",
"%s\n%s\n%s\n",
cliui.Styles.Bold.Render(example.Name),
cliui.Styles.Wrap.Copy().PaddingLeft(6).Render(example.Description),
cliui.Styles.Keyword.PaddingLeft(6).Render(example.URL),
)
exampleNames = append(exampleNames, name)
exampleByName[name] = example