From bb033118942371e838170cf3ea064d0f5a72b1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 19 Sep 2024 20:47:43 +0200 Subject: [PATCH] [docs] rewrite Field Names table in formatting.md as HTML should fix the '\|' in '{empty\|title}' in https://gdl-org.github.io/docs/formatting.html --- docs/formatting.md | 60 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/docs/formatting.md b/docs/formatting.md index 97801653..15631013 100644 --- a/docs/formatting.md +++ b/docs/formatting.md @@ -11,16 +11,56 @@ Field names select the metadata value to use in a replacement field. While simple names are usually enough, more complex forms like accessing values by attribute, element index, or slicing are also supported. -| | Example | Result | -| -------------------- | ------------------- | ---------------------- | -| Name | `{title}` | `Hello World` | -| Element Index | `{title[6]}` | `W` | -| Slicing | `{title[3:8]}` | `lo Wo` | -| Slicing (Bytes) | `{title_ja[b3:18]}` | `ロー・ワー` | -| Alternatives | `{empty\|title}` | `Hello World` | -| Attribute Access | `{extractor.url}` | `https://example.org/` | -| Element Access | `{user[name]}` | `John Doe` | -| | `{user['name']}` | `John Doe` | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExampleResult
Name{title}Hello World
Element Index{title[6]}W
Slicing{title[3:8]}lo Wo
Slicing (Bytes){title_ja[b3:18]}ロー・ワー
Alternatives{empty|title}Hello World
Attribute Access{extractor.url}https://example.org/
Element Access{user[name]}John Doe
{user['name']}John Doe
All of these methods can be combined as needed. For example `{title[24]|empty|extractor.url[15:-1]}` would result in `.org`.