mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
Add support for footer docs
Enables a footer to be appended to the end of a generated document sourced from tf files or documents in the same way as the header Adds the `footer-from` field to the config yml Adds the `--footer-from` flag to the cli Signed-off-by: Simon Clifford <siclifford@gmail.com> Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
This commit is contained in:
committed by
Khosrow Moossavi
parent
5fae473131
commit
aa1e6bbf59
@@ -164,20 +164,23 @@ func generateMarkdown(cmd *cobra.Command, weight int, w io.Writer) error {
|
||||
}
|
||||
|
||||
func example(ref *reference) error {
|
||||
flag := ""
|
||||
flag := " --footer-from footer.md"
|
||||
switch ref.Name {
|
||||
case "pretty":
|
||||
flag = " --no-color"
|
||||
flag += " --no-color"
|
||||
}
|
||||
|
||||
ref.Usage = fmt.Sprintf("%s%s ./examples/", ref.Command, flag)
|
||||
|
||||
settings := print.DefaultSettings()
|
||||
settings.ShowColor = false
|
||||
settings.ShowFooter = true
|
||||
options := &terraform.Options{
|
||||
Path: "./examples",
|
||||
ShowHeader: true,
|
||||
HeaderFromFile: "main.tf",
|
||||
ShowFooter: true,
|
||||
FooterFromFile: "footer.md",
|
||||
SortBy: &terraform.SortBy{
|
||||
Name: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user