Skip to content

Optional include statement #599

@thomasfinstad

Description

@thomasfinstad

What problem are you facing?

Includes causes the execution to fail if the file doesn't exist.
Forcing either empty files where they are not needed, or custom templates for each situation.

This is especially annoying in a recursive setup with submodules where the template is only defined at the top level in .terraform-docs.yaml

How could terraform-docs help solve your problem?

An include statement that checks for the file first and skips it if it is missing.

Suggestions for syntax:

{{ optional_include "examples/example-1/main.tf" }}
{{ include_nofail "examples/example-1/main.tf" }}
{{ include "?examples/example-1/main.tf" }}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy