mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 09:50:27 +00:00
Text-slicer: add support for document metadata fields
The metadata for each field is in a tiddler tagged `$:/tags/DocumentMetaData` with the field `caption` being the displayed caption for the field and `field` being the name of the field. `field-type` is the type of the field, and can be “string” or “list”.
This commit is contained in:
parent
ebb3a62d9a
commit
b30126ec22
@ -1,5 +1,21 @@
|
||||
title: $:/plugins/tiddlywiki/text-slicer/ui/document/header
|
||||
|
||||
\define metadatafield()
|
||||
<tr>
|
||||
<td>
|
||||
''<$transclude tiddler=<<listItem>> field="caption"/>''
|
||||
</td>
|
||||
<td>
|
||||
<$reveal type="match" state="""$(listItem)$!!field-type""" text="string">
|
||||
<$edit-text field={{$(listItem)$!!field}}/>
|
||||
</$reveal>
|
||||
<$reveal type="match" state="""$(listItem)$!!field-type""" text="list">
|
||||
<$edit-text tag="textarea" field={{$(listItem)$!!field}}/>
|
||||
</$reveal>
|
||||
</td>
|
||||
</tr>
|
||||
\end
|
||||
|
||||
<div class="tc-sliced-document-header">
|
||||
|
||||
''Exclude filter'': <$edit-text field="toc-exclude-filter"/>
|
||||
@ -11,4 +27,12 @@ title: $:/plugins/tiddlywiki/text-slicer/ui/document/header
|
||||
View document
|
||||
</$button>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<$list filter="[all[system+tiddlers]tag[$:/tags/DocumentMetaData]]" variable="listItem">
|
||||
<<metadatafield>>
|
||||
</$list>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user