alias plugin and stylesheets

88 views
Skip to first unread message

Bob Paige

unread,
Feb 3, 2008, 10:54:23 PM2/3/08
to tiddl...@googlegroups.com
I am trying to make an alias (using alias plugin) that displays text
from the tidder macro in a given style sheet.

The normal syntax would be :

{{myStyle{<<tiddler [[some tiddler name##heading name]]>>}}}

But I want to create an alias. I know I could create a macro, but an
alias would be quicker/easier if I want to do this in the future.

I've tried this:

<<alias myStyle "{{myStyle{<<tiddler [[%0]]>>}}}">>

But this doesn't work. The "}}}" is displayed, and calling the alias
doesn't work.

Is there some way to escape these characters properly, or should I
just write a one-line macro?

--
Bobman

Eric Shulman

unread,
Feb 4, 2008, 12:30:17 AM2/4/08
to TiddlyWiki
> <<alias myStyle "{{myStyle{<<tiddler [[%0]]>>}}}">>
> Is there some way to escape these characters properly

<<alias myStyle {{"{{myStyle{<<tiddler [[%0]]\>\>\}\}\}"}}>>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

Bob Paige

unread,
Feb 4, 2008, 9:14:33 AM2/4/08
to Tiddl...@googlegroups.com
Eric,

Thanks for the syntax! Now I don't get the artifacts on screen for the
tiddler in which I define the alias (I use MainMenu for alias
definitions).

However, it still isn't working.

My style displays a floating box on the right, 50% the width of the
tiddler. If I use this:

{{myStyle{<<tiddler [[SomeTiddler]]>>}}}

Then the tiddler macro is called and the contents appear in the floating box.

If I use the alias as you gave it to me, I get the floating box (only
one line tall) with no content.

If I redefine the alias to not call the tiddler macro but insert the
text directly, all I get is the passed text in the box:

<<alias myStyleNoTiddler {{"{{myStyle{%0\}\}\}"}}>>

So it appears there is some odd interaction with the tiddler macro.

Incidentally, I tried to write my own macro that functions the same as
this alias, but I get the same results; floating box with no content,
as if the tiddler macro is never called.

If we can't get some form of macro working on this, I can continue to
insert the CSS call myself, but I'd rather abstract it behind some
sort of macro (alias or otherwise).

--
Bobman

Eric Shulman

unread,
Feb 4, 2008, 9:28:15 AM2/4/08
to TiddlyWiki
> {{myStyle{<<tiddler [[SomeTiddler]]>>}}}
> Then the tiddler macro is called and the contents appear in the floating box.
>
> If I use the alias as you gave it to me, I get the floating box (only
> one line tall) with no content.

Very odd... I just tried this in an empty TW (with AliasPlugin
installed, of course), and it works as expected!

Here's what I did:

1) Create a tiddler [[SomeTiddler]] and put some content into it
2) In [[StyleSheet]] (empty by default), put:
.green { color:green; }
3) Create another tiddler, [[SetAlias]], containing
<<alias myStyle {{"{{green{<<tiddler [[%0]]\>\>\}\}\}"}}>>
4) Create [[TestTiddler]], containing:
<<myStyle SomeTiddler>>

result: the content from [[SomeTiddler]] is displayed in green.

Perhaps you have installed some other plugin that it messing things
up? (note: the above test also worked directly in TiddlyTools, so if
there IS a plugin-interaction occurring, it would have to be with a
non-TT plugin...)

-e

Bob Paige

unread,
Feb 4, 2008, 9:37:01 AM2/4/08
to Tiddl...@googlegroups.com
I found the conflict: it was AutoWeavePlugin.

When I passed the name of my other tiddler as an argument to the
alias, AutoWeavePlugin was inserting square brackets around it, which
was resulting in non-functional arguments. If I insert the square
brackets myself, AutoWeave does not come into play, and I'm good to
go.

I wonder how hard it would be to update AutoWeavePlugin to ignore text
within macro calls?

--
Bobman

AviMar

unread,
Feb 17, 2008, 1:49:23 AM2/17/08
to TiddlyWiki
I ran into this "bug" when running sitemap macro - the plugin would
bracket the name of the term I was trying to sitemap.
I couldn't find where to contact AutoWeavePlugin's author, Laurence
Man.
Could this be looked at?
-Avi

On Feb 4, 4:37 pm, "Bob Paige" <bobpa...@gmail.com> wrote:
> I found the conflict: it was AutoWeavePlugin.
>
> When I passed the name of my other tiddler as an argument to the
> alias, AutoWeavePlugin was inserting square brackets around it, which
> was resulting in non-functional arguments. If I insert the square
> brackets myself, AutoWeave does not come into play, and I'm good to
> go.
>
> I wonder how hard it would be to update AutoWeavePlugin to ignore text
> within macro calls?
>
> --
> Bobman
>
Reply all
Reply to author
Forward
0 new messages