This seemed to work in the title snippet:
<$vars myspan="<span class='gifford'>" myspanx="</span>" >
{{{ [all[tiddlers]removeprefix[Draft of
']removesuffix[']addprefix<myspan>addsuffix<myspanx>] }}}
</$vars>
You can see where to change the class name as needed.
On Sunday, November 17, 2019 at 11:52:36 AM UTC-8, David Gifford wrote:
>
> Wow, Mark, this is great! Thank you!
>
> Okay, next question: would there be a way for me to edit this so that the
> title gets wrapped in a span class? I tried editing"Snippet - Title of
> draft tiddler",
> but while it stamped regular text I had added, it did not stamp the span
> class.
>
> On Sunday, November 17, 2019 at 1:34:55 PM UTC-6, Mark S. wrote:
>>
>> I've been thinking for awhile that it would be neat to have a "dynamic"
>> stamp, that doesn't just paste text, but renders it first.
>>
>> Here's a first step towards that. Drag and drop the attached into your
>> backed-up TW. Reload.
>>
>> This will put a second stamp symbol in your editor. This stamp will
>> attempt to render your stamp snippets. I've provided two
>> stamps. One generates the current time. The other generates the current
>> title IF this is the only tiddler being edited
>> at the moment. I didn't have a way to grab the current title. Possibly
>> it's in the code somewhere. So ... first stab.
>>
>> A better approach would be to have snippets that could be tagged as
>> "dynamic". Then there would be only one stamp tool
>> in the toolbar. But that would require changing core code, so this will
>> have to do for now.
>>
>> Hope this is what you were looking for!
>>
>> -- Mark
>>
>> On Sunday, November 17, 2019 at 10:30:25 AM UTC-8, David Gifford wrote:
>>>
>>> Hi all
>>>
>>> Is it possible to create a stamp that
>>>
>>> 1) grabs the title of the current tiddler, and
>>> 2) stamps it as text?
>>>
>>> Use case: I take notes on reading in chapters of books, and in webpages,
>>> and would like to more quickly stamp their sources after the note or
>>> snippet in question. If the title of the tiddler is "https://..." or "Book
>>> (Author), ch 1", then by clicking on a button in the edittoolbar I could
>>> quickly add the source.
>>>
>>
--
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/31453a16-7df1-4284-8785-50e8561f1555%40googlegroups.com.