<commit_before>Mako Sugar
===

A preprocessor that adds some syntactic sugar to Mako templates.

Write:

    % call foo():
        hi
    % endcall
        
instead of:

    <%call expr="foo()">
        hi
    </%call>
    
Install with:

        from mako_sugar import sugar
        
        # Any one of these options...
        t = Template(..., preprocessor=sugar())
        t = Template(..., preprocess=sugar(exclude=['def', 'call', 'import']))
        TemplateLookup(preprocessor=sugar())<commit_msg>Add to README<commit_after>Mako Sugar
===

A preprocessor that adds some syntactic sugar to Mako templates.

Write:

    % call foo():
        hi
    % endcall
        
instead of:

    <%call expr="foo()">
        hi
    </%call>
    
Also comes with nicer defs:
    
    % def foo():
        hi
    % enddef
    
And nicer imports:

    % import /components.html as comp
    % from /components.mako import link_to_modal
    % import customer.lib.presenters as p
    % import ${context['namespace_name']} as dyn
    
Install with:

        from mako_sugar import sugar
        
        # Any one of these options...
        t = Template(..., preprocessor=sugar())
        t = Template(..., preprocess=sugar(exclude=['def', 'call', 'import']))
        TemplateLookup(preprocessor=sugar())
{'fraction_non_alphanumeric': 0.12210200927357033, 'fraction_numerical': 0.0, 'mean_word_length': 2.1662591687041566, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4241553', 'n_tokens_mistral': 396, 'n_tokens_neox': 377, 'n_words': 115}