[formatter] implement 'S' format specifier (#3266)

to Sort lists
This commit is contained in:
Mike Fährmann
2022-11-21 21:44:42 +01:00
parent 8a021e4ee4
commit 42481aed59
4 changed files with 40 additions and 1 deletions

View File

@@ -172,6 +172,12 @@ Format specifiers can be used for advanced formatting by using the options provi
<td><code>{foo:Ro/()/}</code></td>
<td><code>F()()&nbsp;Bar</code></td>
</tr>
<tr>
<td><code>S&lt;order&gt;/</code></td>
<td>Sort a list. <code>&lt;order&gt;</code> can be either <strong>a</strong>scending or <strong>d</strong>escending/<strong>r</strong>everse. (default: <strong>a</strong>)</td>
<td><code>{tags:Sd}</code></td>
<td><code>['water', 'tree', 'sun']</code></td>
</tr>
<tr>
<td><code>D&lt;format&gt;/</code></td>
<td>Parse a string value to a <code>datetime</code> object according to <a href="https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes"><code>&lt;format&gt;</code></a></td>