Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor documentation of default_content() #87

Open
paran1 opened this issue Oct 24, 2017 · 3 comments
Open

Poor documentation of default_content() #87

paran1 opened this issue Oct 24, 2017 · 3 comments
Labels
docs Improvements or additions to documentation needs-help Extra attention is needed

Comments

@paran1
Copy link

paran1 commented Oct 24, 2017

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?

@juniorsysadmin juniorsysadmin added the docs Improvements or additions to documentation label Oct 25, 2017
@ekohl
Copy link
Member

ekohl commented Oct 27, 2017

You're right that the current documentation is poor. Would you be willing to submit a PR to improve it?

@paran1
Copy link
Author

paran1 commented Nov 10, 2017

I usually try to contribute fixes. However, in this case you would likely get far better documentation from somebody who actually uses the function. I might be missing something, but currently I can't think of many use cases.

@alexjfisher alexjfisher added the needs-help Extra attention is needed label Nov 10, 2017
@alexjfisher
Copy link
Member

It was some time ago, but perhaps the original author might be able to help with a sentence or two? @alvagante Sorry, I know it was 3 years ago! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation needs-help Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants