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 624ab5d7..9b8372d7 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>/ - Adds <before> and <after> to the actual value if it evaluates to True. Otherwise the whole replacement field becomes an empty string. + ?<start>/<end>/ + Adds <start> and <end> to the actual value if it evaluates to True. Otherwise the whole replacement field becomes an empty string. {foo:?[/]/} [Foo Bar] @@ -170,3 +170,38 @@ For example `{foo:?//RF/B/Ro/e/> 10}` -> `   Bee Bar` - `RF/B/` - Replaces `F` with `B` - `Ro/e/` - Replaces `o` with `e` - `> 10` - Left-fills the string with spaces until it is 10 characters long + + +## Special Type Format Strings + +Starting a format string with '\f ' allows to set a different format string type than the default. Available ones are: + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescriptionUsage
TA template file containing the actual format string\fT ~/.templates/booru.txt
EAn 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
+