From 69cd573809fb87e7137a924db4b6402eafa90de7 Mon Sep 17 00:00:00 2001 From: ImportTaste <53661808+ImportTaste@users.noreply.github.com> Date: Sat, 30 Oct 2021 14:46:26 -0500 Subject: [PATCH] add special type format strings to docs (#1987) --- docs/formatting.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/docs/formatting.md b/docs/formatting.md index 624ab5d7d8..9b8372d7c9 100644 --- a/docs/formatting.md +++ b/docs/formatting.md @@ -129,8 +129,8 @@ Format specifiers can be used for advanced formatting by using the options provi
?<before>/<after>/
<before>
and <after>
to the actual value if it evaluates to True
. Otherwise the whole replacement field becomes an empty string.?<start>/<end>/
<start>
and <end>
to the actual value if it evaluates to True
. Otherwise the whole replacement field becomes an empty string.{foo:?[/]/}
[Foo Bar]
Type | +Description | +Usage | +
---|---|---|
T |
+ A template file containing the actual format string | +\fT ~/.templates/booru.txt |
+
E |
+ An arbitrary Python expression | +\fE title.upper().replace(' ', '-') |
+
M |
+ Name of a Python module followed by one of its functions. + This function gets called with the current metadata dict as + argument and should return a string. | +\fM my_module:generate_text |
+