mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[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
This commit is contained in:
parent
2c7a0c3ca8
commit
bb03311894
@ -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.
|
While simple names are usually enough, more complex forms like accessing values by attribute, element index, or slicing are also supported.
|
||||||
|
|
||||||
| | Example | Result |
|
<table>
|
||||||
| -------------------- | ------------------- | ---------------------- |
|
<thead>
|
||||||
| Name | `{title}` | `Hello World` |
|
<tr>
|
||||||
| Element Index | `{title[6]}` | `W` |
|
<th></th>
|
||||||
| Slicing | `{title[3:8]}` | `lo Wo` |
|
<th>Example</th>
|
||||||
| Slicing (Bytes) | `{title_ja[b3:18]}` | `ロー・ワー` |
|
<th>Result</th>
|
||||||
| Alternatives | `{empty\|title}` | `Hello World` |
|
</tr>
|
||||||
| Attribute Access | `{extractor.url}` | `https://example.org/` |
|
</thead>
|
||||||
| Element Access | `{user[name]}` | `John Doe` |
|
<tbody>
|
||||||
| | `{user['name']}` | `John Doe` |
|
<tr>
|
||||||
|
<td>Name</td>
|
||||||
|
<td><code>{title}</code></td>
|
||||||
|
<td><code>Hello World</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Element Index</td>
|
||||||
|
<td><code>{title[6]}</code></td>
|
||||||
|
<td><code>W</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Slicing</td>
|
||||||
|
<td><code>{title[3:8]}</code></td>
|
||||||
|
<td><code>lo Wo</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Slicing (Bytes)</td>
|
||||||
|
<td><code>{title_ja[b3:18]}</code></td>
|
||||||
|
<td><code>ロー・ワー</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Alternatives</td>
|
||||||
|
<td><code>{empty|title}</code></td>
|
||||||
|
<td><code>Hello World</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Attribute Access</td>
|
||||||
|
<td><code>{extractor.url}</code></td>
|
||||||
|
<td><code>https://example.org/</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="2">Element Access</td>
|
||||||
|
<td><code>{user[name]}</code></td>
|
||||||
|
<td><code>John Doe</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>{user['name']}</code></td>
|
||||||
|
<td><code>John Doe</code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
All of these methods can be combined as needed.
|
All of these methods can be combined as needed.
|
||||||
For example `{title[24]|empty|extractor.url[15:-1]}` would result in `.org`.
|
For example `{title[24]|empty|extractor.url[15:-1]}` would result in `.org`.
|
||||||
|
Loading…
Reference in New Issue
Block a user