mention defs can return data / better buffering explanation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 459
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
Migrated issue, originally created by Anonymous
Today I (finally) got how "buffering" works.
I think documentation could do better at explaining how this things work behind mako scenes.
First of all, all ${ call_some_function() } should be changed to <% call_some_function() %> for sake of understanding.
Secondly, it would be wise to mention that defs can return values. Example:
<%def name="hello_world()">
hello world
<% return True %>
<%/dev>
<%
success = hello_world() ## also renders the body because of buffering
%>
that's my two cents:)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the Mako documentation for the existing sections explaining buffering and defs, then read the surrounding examples and documentation structure. Update those explanations to address the requested syntax and that defs can return values while rendering their body, and verify the examples against the documented behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100