<commit_before># Introduction to Selmer

Selmer is an attempt at bringing the nice, convenient, productive templating experience the Django template language provides to the unwashed Clojure masses. Ideally, there should also be opportunities to improve upon it.

## Design Goals

### Performance

This is going to be an unusually high priority. Templating performance issues have been substantial enough in the past to force us to start this repository. Ideally, the line should end here and performance issues shouldn't be a problem for virtually all web applications.

### Why

Server-side templating still matters. Server-side rendered content is still useful and necessary and not every website is destined to be a single-page application. Even in cases where a SPA is presumed, having partially rendered content can improve the experience for your users.

### API

The idea behind Django style templates is to have the templates be predictable and understandable without going on a fishing expedition through too many other templates or especially by having to trace server-side code.

The context provided for the rendering of the template should be in the form of a map or other associative collection. We're going with maps for now.

(render-file "template/filename.html" {:key val}) is the essence of it.

### Basic functionality

{:title "my value"} and a template looking like:

    <h1>{{title}}</h1>

Should render:

    <h1>my value</h1>

Given a template like:

    <p>Trolololololololol</p><br><br><br><br><br><br><br><br><br>
    <!-- Do your eyes burn from un-semantic markup yet? -->
    {% if blah %}
    LET'S ROCK
    {% else %}
    <p>or not.</p>
    {% endif %}

Provided a context of {:blah false}, it should render:

    <p>Trolololololololol</p><br><br><br><br><br><br><br><br><br>
    <!-- Do your eyes burn from un-semantic markup yet? -->
    <p>or not.</p>

You should be able to test if the for loop block you're inside of is "first" or not. In future, we may want to allow arbitrary index checks:

    <ul>
    {% for item in coll %}
    {% if forloop.first %}
    <h1>Beginning of list</h1>
    {% endif %}
    <li>WHEEEEEE</li>
    {% endfor %}
    </ul>
<commit_msg>PHRASING<commit_after># Introduction to Selmer

Selmer is an attempt at bringing the nice, convenient, productive templating experience the Django template language provides to the unwashed Clojure masses. Ideally, there should also be opportunities to improve upon it.

## Design Goals

### Performance

This is going to be an unusually high priority. Templating performance issues have been substantial enough in the past to force us to start this repository. Ideally, the line should end here and performance issues shouldn't be a problem for virtually all web applications.

We're currently aiming for Stencil'ish performance and seem to be within range of that at the moment.

### Why

Server-side templating still matters. Server-side rendered content is still useful and necessary and not every website is destined to be a single-page application. Even in cases where a SPA is presumed, having partially rendered content can improve the experience for your users.

### API

The idea behind Django style templates is to have the templates be predictable and understandable without going on a fishing expedition through too many other templates or especially by having to trace server-side code.

The context provided for the rendering of the template should be in the form of a map or other associative collection. We're going with maps for now.

(render-file "template/filename.html" {:key val}) is the essence of it.

### Basic functionality

Given context {:title "my value"} and a template looking like:

    <h1>{{title}}</h1>

Should render:

    <h1>my value</h1>

Given a template like:

    <p>Trolololololololol</p><br><br><br><br><br><br><br><br><br>
    <!-- Do your eyes burn from un-semantic markup yet? -->
    {% if blah %}
    LET'S ROCK
    {% else %}
    <p>or not.</p>
    {% endif %}

Provided a context of {:blah false}, it should render:

    <p>Trolololololololol</p><br><br><br><br><br><br><br><br><br>
    <!-- Do your eyes burn from un-semantic markup yet? -->
    <p>or not.</p>

You should be able to test if the for loop block you're inside of is "first" or not. In future, we may want to allow arbitrary index checks:

    <ul>
    {% for item in coll %}
    {% if forloop.first %}
    <h1>Beginning of list</h1>
    {% endif %}
    <li>WHEEEEEE</li>
    {% endfor %}
    </ul>

{'fraction_non_alphanumeric': 0.09141212926073485, 'fraction_numerical': 0.0026560424966799467, 'mean_word_length': 3.7870762711864407, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 79, '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': '3041131', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1222, 'n_words': 609}