<feed xmlns='http://www.w3.org/2005/Atom'>
<title>askama/testing, branch main</title>
<subtitle>added poem support</subtitle>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/'/>
<entry>
<title>Add ui test for `extends` error</title>
<updated>2024-01-22T16:13:01+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2024-01-22T15:18:47+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=585a992246bf0602bd81b922eee8c7a6d27e9317'/>
<id>585a992246bf0602bd81b922eee8c7a6d27e9317</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix support for mixed case variables</title>
<updated>2024-01-18T10:23:18+00:00</updated>
<author>
<name>Dirkjan Ochtman</name>
<email>dirkjan@ochtman.nl</email>
</author>
<published>2024-01-18T09:47:37+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=79738ff2388a6f15cd28690a3d276ee5086fb44f'/>
<id>79738ff2388a6f15cd28690a3d276ee5086fb44f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow included templates to `extend`, `import`, and `macro`</title>
<updated>2024-01-17T16:58:53+00:00</updated>
<author>
<name>max</name>
<email>gmx.sht@gmail.com</email>
</author>
<published>2023-12-11T14:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=5cad82f38e800a42717284f20e7e0923add1e32f'/>
<id>5cad82f38e800a42717284f20e7e0923add1e32f</id>
<content type='text'>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Generator: make `normalize_identifier` faster (#946)</title>
<updated>2024-01-12T19:41:46+00:00</updated>
<author>
<name>René Kijewski</name>
<email>Kijewski@users.noreply.github.com</email>
</author>
<published>2024-01-12T19:41:46+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=3cddb918897383402a58a5d74b49500571144056'/>
<id>3cddb918897383402a58a5d74b49500571144056</id>
<content type='text'>
`normalize_identifier` is called quite often in the generator, once for
every variable name or path element that is written.

This PR aims to speed up the function by

* using a per-length input string length replacement map
* binary searching the replacement map instead of a linear search

Diffent, but functionally equivalent implementations were compared:

```text
* linear search in one big map:      348.44 µs
* binary search in one big map:      334.46 µs
* linear search in a per-length map: 178.84 µs
* binary search in a per-length map: 154.54 µs
* perfect hashing:                   170.87 µs
```

The winner of this competition is "binary search in a per-length map".
It does not introduce new dependencies, but has the slight disadvantage
that it uses one instance of `unsafe` code. I deem this disadvantage
acceptable, though.

Nb. It was also tested if a variant that only stores the replaced string
would be faster. This "optimization" proved to be slower for all
implementations except "binary search in a per-length map", for which it
has the same runtime. Without a clear advantage to use the "optimized
version", I chose to use the more easy to read slice of tuples variant.

Obviously, for all measurements: YMMV.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`normalize_identifier` is called quite often in the generator, once for
every variable name or path element that is written.

This PR aims to speed up the function by

* using a per-length input string length replacement map
* binary searching the replacement map instead of a linear search

Diffent, but functionally equivalent implementations were compared:

```text
* linear search in one big map:      348.44 µs
* binary search in one big map:      334.46 µs
* linear search in a per-length map: 178.84 µs
* binary search in a per-length map: 154.54 µs
* perfect hashing:                   170.87 µs
```

The winner of this competition is "binary search in a per-length map".
It does not introduce new dependencies, but has the slight disadvantage
that it uses one instance of `unsafe` code. I deem this disadvantage
acceptable, though.

Nb. It was also tested if a variant that only stores the replaced string
would be faster. This "optimization" proved to be slower for all
implementations except "binary search in a per-length map", for which it
has the same runtime. Without a clear advantage to use the "optimized
version", I chose to use the more easy to read slice of tuples variant.

Obviously, for all measurements: YMMV.</pre>
</div>
</content>
</entry>
<entry>
<title>Add test for `as_ref` builtin filter</title>
<updated>2024-01-12T09:38:15+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2024-01-10T14:10:06+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=12e178ce405225f2cd65ab4f68b67fefc89dec2b'/>
<id>12e178ce405225f2cd65ab4f68b67fefc89dec2b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Add automatic borrowing to let statement"</title>
<updated>2024-01-10T09:42:31+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2024-01-03T14:20:50+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=1ee067f2b62a994fe1200fba8898e8909acd0ce0'/>
<id>1ee067f2b62a994fe1200fba8898e8909acd0ce0</id>
<content type='text'>
This reverts commit 3d52283b74573af509deb3c47cbabf7b7b58b1dd.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 3d52283b74573af509deb3c47cbabf7b7b58b1dd.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make the `markdown` filter compatible with `String`</title>
<updated>2024-01-09T20:23:47+00:00</updated>
<author>
<name>Jakub Stachurski</name>
<email>jakub@wilkuu.xyz</email>
</author>
<published>2024-01-09T16:24:11+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=50c64bc8650574d1e9243a50477eb7dbd36e36c4'/>
<id>50c64bc8650574d1e9243a50477eb7dbd36e36c4</id>
<content type='text'>
This commit solves issue #719.

This is done by making the markdown filter borrow the string and
simplifying the filter to accept `&amp;str` instead of `AsRef&lt;str&gt;`

Add test for the markdown filter using  as input

Revert markdown filter changes

Revert unnecessary changes

Improve test_markdown_owned_string test

Use cargo fmt
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit solves issue #719.

This is done by making the markdown filter borrow the string and
simplifying the filter to accept `&amp;str` instead of `AsRef&lt;str&gt;`

Add test for the markdown filter using  as input

Revert markdown filter changes

Revert unnecessary changes

Improve test_markdown_owned_string test

Use cargo fmt
</pre>
</div>
</content>
</entry>
<entry>
<title>Add automatic borrowing to let statement</title>
<updated>2023-12-13T15:47:02+00:00</updated>
<author>
<name>max</name>
<email>gmx.sht@gmail.com</email>
</author>
<published>2023-12-13T13:34:54+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=3d52283b74573af509deb3c47cbabf7b7b58b1dd'/>
<id>3d52283b74573af509deb3c47cbabf7b7b58b1dd</id>
<content type='text'>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bugfix in `is_attr_self()`</title>
<updated>2023-12-13T15:47:02+00:00</updated>
<author>
<name>max</name>
<email>gmx.sht@gmail.com</email>
</author>
<published>2023-12-13T13:33:34+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=28182a1549a6546750d3f9834cb35686b89c3cf9'/>
<id>28182a1549a6546750d3f9834cb35686b89c3cf9</id>
<content type='text'>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: max &lt;gmx.sht@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow trailing comma in macro definition and call</title>
<updated>2023-12-07T10:03:26+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2023-12-06T16:20:53+00:00</published>
<link rel='alternate' type='text/html' href='https://bunny.garden/forks/askama/commit/?id=e4b8ca3c44b5ede192700d0e4c9ed1c58338c1b6'/>
<id>e4b8ca3c44b5ede192700d0e4c9ed1c58338c1b6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
