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

Add docs for the View#template convention. #2716

Merged
merged 4 commits into from
Sep 11, 2013
Merged

Add docs for the View#template convention. #2716

merged 4 commits into from
Sep 11, 2013

Conversation

braddunbar
Copy link
Collaborator

It was pointed out on the mailing list that there is no documentation for View#template, despite being a rather strong convention. Perhaps it's worth including, perhaps not. I'd love to hear some thoughts about it.

@jdalecki
Copy link

jdalecki commented Aug 9, 2013

Brad,
I agree 100% with you. Are we alone? Surely there must be some other people asking for that. I just hope we get somewhere with it for the good of the other lost developers out there.
Regards,
Janusz

While not provided by the library, <b>template</b> is an oft-used
convention. It is usually defined as a function that takes an optional
data argument and returns an html string. In other words, it conforms to
the api of Underscores
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML, API and Underscore's

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks Casey!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wookiehangover
Copy link
Collaborator

Maybe this would be better as something that's folded into the documentation for render, where templates are more or less already explained and shown in the example?

At very least this should come after render in the docs.

@braddunbar
Copy link
Collaborator Author

@wookiehangover Huh...I thought exactly the opposite. Currently, the docs for #render use #template without introduction or explanation and I had thought of it as "required reading".

data argument and returns an HTML string. In other words, it conforms to
the API of Underscore's
<a href="http://underscorejs.org/#template"><b>template</b></a> function.
While this convention is common, it's certainly not required and not used
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'and not' could be 'nor'

@jashkenas
Copy link
Owner

Nice idea, but needs a bit of rewording. Should explain what template is in the first sentence, instead of just "a convention".

@braddunbar
Copy link
Collaborator Author

Reworded above. Prose is not my strong suit so feel free to suggest other changes. :)

jashkenas added a commit that referenced this pull request Sep 11, 2013
Add docs for the View#template convention.
@jashkenas jashkenas merged commit 476e764 into jashkenas:master Sep 11, 2013
jashkenas added a commit that referenced this pull request Sep 11, 2013
@braddunbar braddunbar deleted the template-docs branch April 4, 2014 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants