generate tiddler name for transclusion

85 views
Skip to first unread message

Rustem

unread,
May 5, 2015, 1:10:24 AM5/5/15
to tiddl...@googlegroups.com
I'm trying to transclude one stylesheet or another based on an index value. This is the closest I could get:
```
\define p(name) $:/styles/$name$.css
{{<$macrocall $name="p" name={{$:/configurables##filename}}/>}}
```
The string is formed as desired, but the transclusion is not performed, all I see is
```
{{$:/styles/dark.css}}
```
which is exactly what I would enter if I just wanted to simply transclude...

Rustem

unread,
May 10, 2015, 2:37:32 AM5/10/15
to tiddl...@googlegroups.com

It's possible! After thorough RTFM:

<$list filter="[[$:/_ra/styles/highlight.js/solarized_]addsuffix{$:/_ra/styles/configurables##code-palette}addsuffix[.css]]"><$transclude/></$list>

Jed Carty

unread,
May 10, 2015, 11:13:24 AM5/10/15
to tiddl...@googlegroups.com
Sorry I didn't notice this when you posted it originally. In case you wanted a different method at some point in the future:


\define p() $:/styles/$(name)$.css

<$set name=name value={{$:/configurables##filename}}>
<<p>>
</$set>

I do not think that there is any benefit to using this over your solution, it is just a different way to accomplish the same task.
Reply all
Reply to author
Forward
0 new messages