sqlalchemy / sqlalchemy/mako

mention defs can return data / better buffering explanation

Open
#111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation feature low priority
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.