The ChatGPT idea is brilliant. I actually did the same to learn how to “write a global tiddlywiki macro accessible in other tiddlers”. It suggested the $:/tags/ViewTemplate
tag that I didn’t realize I needed.
Anyway, I haven’t had much time to play with this yet, but with your pointers I kludged together an example of how I’d like the behavior to work.
I created a tiddler for my two macros.
(Note, hard coded proof of concept at the moment)
\define readActions()
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" $field="text" $value="40em"/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" $field="text" $value="40em"/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" $field="text" $value="45em"/>
\end
\define editActions()
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/tiddlerwidth" $field="text" $value="80em"/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storywidth" $field="text" $value="80em"/>
<$action-setfield $tiddler="$:/themes/tiddlywiki/vanilla/metrics/storyright" $field="text" $value="85em"/>
\end
Then in the $:/core/ui/EditTemplate
I call readActions
when we close/discard a tiddler – to get back to my “reading view”.
In the $:/core/ui/EditorToolbar/preview
- When
open preview
is clicked, I call editActions()
→ to get me full size edit and full size preview
- When
close preview
is clicked, I call readActions()
→ to get back to just single full size edit
Basic idea does what I want, but needs cleanup.