I think this is quite an interesting problem. I don't have it worked out 
yet, but I think it's possible.

If you want to play around with this I suggest you be VERY CAREFUL! because 
there is a good chance of getting the wiki into an infinite loop, which 
will crash it. Obviously, don't do this with your 'real' wiki.

A tiddler with this code
 

> \define getsnaptitle()
> $(currentTiddler)$ Snapshot
> \end 
>
> <$wikify name="outputter" text={{!!text}} output="html">
>
> <$button>
> <$set name=snaptitle value=<<getsnaptitle>>>
> <$action-sendmessage $message="tm-new-tiddler" title=<<snaptitle>> 
> tags="Snapshot" text=<<outputter>>/>
> SNAP
> </$set>
> </$button>
>
> </$wikify>


and tagged with $:/tags/ViewToolbar 
<http://127.0.0.1:8081/#%24%3A%2Ftags%2FViewToolbar> will add a (big, ugly) 
button to the view toolbar that, when clicked will generate a new tiddler 
(in edit mode) which contains the text of the original one, but encoded in 
static html.

The reason you need to be careful (afaict) is that, if THAT tiddler is open 
anywhere it will try to generate a wikified copy of itself, which will 
generate a wikified copy of itself which will.... overflow the stack and 
crash your wiki.

I ended up creating the tiddler I needed through an edit text widget in 
another tiddler...

<$edit-text tiddler="$:/core/ui/Buttons/snapshot"/>


All a bit hacky and sub-optimal but it might get you going in the right 
direction. Obviously it can be neatened up and brought into line with the 
other page controls (an icon, ability to show/hide it etc.). Not sure how 
we preclude the possibility of a recursive loop (this problem must be 
solved elsewhere, right?)

I was trying to get it to save the tiddler after creating it, something 
like 

<$action-sendmessage $message="tm-save-tiddler" title=<<snaptitle>>/>



But I couldn't get this to work and I'm not sure why.

Regards,
Richard 
<http://127.0.0.1:8081/#%24%3A%2Ftags%2FViewToolbar>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a0b1ea26-e164-4109-952c-f70a89d24816%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to