[formatter] support loading an f-string from a template file

"\fTF ~/path/to/file.txt"
This commit is contained in:
Mike Fährmann
2023-03-20 22:05:33 +01:00
parent 1a4d4a799b
commit 46fdf46f21
3 changed files with 51 additions and 14 deletions

View File

@@ -255,11 +255,6 @@ Starting a format string with '\f<Type> ' allows to set a different format strin
</tr>
</thead>
<tbody>
<tr>
<td align="center"><code>T</code></td>
<td>A template file containing the actual format string</td>
<td><code>\fT ~/.templates/booru.txt</code></td>
</tr>
<tr>
<td align="center"><code>F</code></td>
<td>An <a href="https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals">f-string</a> literal</td>
@@ -270,6 +265,16 @@ Starting a format string with '\f<Type> ' allows to set a different format strin
<td>An arbitrary Python expression</td>
<td><code>\fE title.upper().replace(' ', '-')</code></td>
</tr>
<tr>
<td align="center"><code>T</code></td>
<td>Path to a template file containing a regular format string</td>
<td><code>\fT ~/.templates/booru.txt</code></td>
</tr>
<tr>
<td align="center"><code>TF</code></td>
<td>Path to a template file containing an <a href="https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals">f-string</a> literal</td>
<td><code>\fTF ~/.templates/fstr.txt</code></td>
</tr>
<tr>
<td align="center"><code>M</code></td>
<td>Path or name of a Python module