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`.