Thanks guys! Eric's trick should do the...trick...

On Fri, Mar 3, 2017 at 5:19 PM, Eric Shulman <[email protected]> wrote:

> 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 a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/tiddlywiki/KTiNEaxPRL8/unsubscribe.
> To unsubscribe from this group and all its topics, 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
> <https://groups.google.com/d/msgid/tiddlywiki/a257f548-e750-43bc-86a6-5a7593abc3a6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
David Gifford
Christian Reformed World Missions, Mexico City

-- 
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/CANE%3DBFLWVtWwkk2nL%3DrM-bqtAm4rhoib4XGDt3gLwrmS8Bg8Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to