Skip to content

Poor documentation of default_content() #87

@paran1

Description

@paran1

Current documentation states that the function:
"Takes an optional content and an optional template name and returns the contents of a file."

It does not return "the contents of a file". It returns the first argument (if not empty or undef) otherwise it uses the second argument as the file name of a template, and returns the evaluated template. If both arguments are empty or undef, the function returns undef.

The example show that one intended use case is to use the result as the content attribute of a file type. Maybe this is why the documentation ended up like it is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentationneeds-helpExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions