Just wanted to say thank you and that I did use this.
A note: Instead of doing:
removeprefix[Draft of ']removesuffix[']
I think it is even better with:
get[draft.of]
<:-)
On Wednesday, July 1, 2020 at 8:25:52 PM UTC+2 Eric Shulman wrote:
> Here's an updated version that works as an EditTemplate:
>
> <style>.edit100 { width:100%; }</style>
> <$edit-text tiddler="temp" tag="textarea" minHeight="5em" class="edit100"
> default="" placeholder="Enter content to be transcluded" /><br>
> <$button actions="""
> <$vars target={{{ [<currentTiddler>removeprefix[Draft of
> ']removesuffix[']] }}}>
> <$vars transclusion={{{
> [prefix<target>!sort[created]first[]addprefix[{{]addsuffix[}}]]
> }}}>
> <$action-setfield $tiddler=<<currentTiddler>> text={{{ [
> <currentTiddler>{!!text}addsuffix<transclusion>] }}}/>
>
> <$action-deletetiddler $tiddler="temp"/>
> </$vars>
> </$vars>
> """>
> Insert as transclusion
> <$vars target={{{ [<currentTiddler>removeprefix[Draft of
> ']removesuffix[']] }}}>
> <$action-createtiddler $basetitle=<<target>> text={{temp}} />
> </$vars>
> </$button>
>
> 1) Put the above code into a tiddler (e.g., "MakeTransclusion")
> 2) Tag that tiddler with $:/tags/EditTemplate
> 3) Add a field named "list-after", with a value of
> "$:/core/ui/EditTemplate/body"
>
> Notes:
> * The "target" variable is the name of the tiddler to create, derived from
> the current *draft* title (e.g, "Draft of 'SomeTiddler'").
> * The "transclusion" variable finds the newest target tiddler and adds the
> "{{" and "}}" to make the transclusion syntax.
> * This is then appended to the current "Draft of 'SomeTiddler'" content.
> * I added a little CSS classname to the $edit-text widget so it would use
> 100% width (and have a minimum height of 5em)
> * The "list-after" field puts the textarea input and button following the
> normal body textarea input.
>
> I've tested this on http://TiddlyWiki.com, and it works.
>
> enjoy,
> -e
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/580622e9-ed4d-4743-aed0-d41fc301abd7n%40googlegroups.com.