Quick tables for groups of tags stating with list-x:
<<forEachTiddler where 'tiddler.tags.join("]]").contains("list-x")&&
tiddler.tags.length'
sortBy
'getSortedTagsText(tiddler)+"###"+tiddler.title'
script
'function getSortedTagsText(tiddler) {var tags = tiddler.tags; if (!
tags) return ""; tags.sort(); var result = ""; for (var i = 0; i <
tags.length;i++) {result += tags[i]+ " ";} return result;} function
getGroupTitle(tiddler, context) {if (!context.lastGroup ||
context.lastGroup != getSortedTagsText(tiddler)) { context.lastGroup =
getSortedTagsText(tiddler); return "|{{{"+(context.lastGroup?
context.lastGroup:"no tags")+"}}}|h\n";} else return "";} '
write
'getGroupTitle(tiddler, context)+"|[[" + tiddler.title+"]]|\n"'
>>
Cheers Måns Mårtensson
On 9 Dec., 17:34, Måns <[email protected]> wrote:
> Hi googlepilot
>
> We could try to construct it in javascript (Then we might get some
> help from someone who knows the language ;-)):
>
> Install Eric's
> InlineJavaScriptPlugin:http://www.tiddlytools.com/#InlineJavascriptPlugin
>
> Write sth like this (seems to work some of the way):
>
> <script>
> var prefix ="list-x" ;
> var out = "" ;
> var tags= store.getTags() ;
> //wikify(tags,place) ;
> for(var i=0;i<tags.length;i++) {
> str = new String(tags[i]) ;
> if(! str.startsWith(prefix)) continue ;
> out+="* <<tag [["+tags[i][0]+"]]>> ("+tags[i][1]+")"+"\n";
>
> }
>
> return out ;
> </script>
>
> If we want to create tables - sth like this should be possible (there
> are some errors in this attempt and we need HELP*!!):
>
> <script>
> var prefix ="list-x" ;
> var out = "" ;
> var hdr="|sortable|k\n| !Tiddler&Tagged | !Number of tagged |h"
> out.push(hdr);
> var tags= store.getTags() ;
> //wikify(tags,place) ;
> for(var i=0;i<tags.length;i++) {
> str = new String(tags[i]) ;
> if(! str.startsWith(prefix)) continue ;
> out.push('|<<tag [["+tags[i][0]+"]]>>| ("+tags[i][1]+")"+" |"+'');
> }
> return out.join('\n');
> </script>
>
> *Please correct my mistakes - @eric, @mike, @mark, @cmari ....??
>
> Cheers Måns Mårtensson
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.