On Friday, March 3, 2017 at 2:23:18 PM UTC-8, David Gifford wrote:
>
> I have two stylesheets, one for editing and one for publishing. Is there a
> plugin or macro that creates one button that when pressed, adds the
> $:/tags/Stylesheet tag from one of them and adds the $:/tags/Stylesheet tag
> to the other? Then when pushed again, does the reverse?
>
Here's a general method I've used for toggling between styles, based on a
single checkbox control:
1) Let's assume the two stylesheet tiddlers are named [[EditorStylesheet]]
and [[PublishedStylesheet]]
2) Remove the $:/tags/Stylesheet tag from *both* of those stylesheet
tiddlers.
3) Create a tiddler, [[CommonStylesheet]], tagged with
"$:/tags/Stylesheet", containing:
<$reveal state="$:/state/allowedit" type="match" text="">
{{PublishedStylesheet}}
</$reveal>
<$reveal state="$:/state/allowedit" type="nomatch" text="">
{{EditorStylesheet}}
</$reveal>
4) Place the following checkbox control anywhere you like:
<$checkbox tiddler="$:/state/allowedit" field="text"
checked="yes" unchecked="" default="">
allow editing
</$checkbox>
The checkbox toggles a $:/state value between "" and "yes" to control which
styles are transcluded in the [[CommonStylesheet]].
Note: [[CommonStylesheet]] could also contain other "common" CSS directives
that are shared between both Editor and Published styles, thus allowing
those "stylesheets" to contain only the differences between the two modes
of viewing.
enjoy,
-e
Eric Shulman
TiddlyTools: Small Tools for Big Ideas (tm)
InsideTiddlyWiki: The Missing Manuals
--
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 post to this group, send email to [email protected].
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/a257f548-e750-43bc-86a6-5a7593abc3a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.