Its a little unclear whether you want the links to appear in place, or
be placed into some other tiddler, or if you want actual links vs.
displayed links. This script creates the links in place. The displayed
links are arrayed horizontally at the top, and the live links are
listed one after the other. You can comment out the one you don't
want.
<script>
var t=store.getTiddlerText('SomeTiddler','');
// var target = store.getTiddler('TargetTiddler') ;
var taglist = t.split('\n') ;
taglist.sort() ;
var tagout = new Array ;
for(var i=0 ; i < taglist.length ; i++) {
if ( taglist[i] ) tagout.push('[[' + taglist[i] + ']]') ;
}
wikify('{{{' + tagout.join("\n") + '}}}',place) ;
wikify('\n',place) ;
wikify(tagout.join("\n"),place) ;
//target.tags = tagout ;
// return 'Mischief Managed' ;
</script>
On Apr 12, 2:42 pm, Måns <[email protected]> wrote:
> Hi
> I have a script that turns a list into a tagline with bracketed tags..
>
> I'd like a simpler script that "only" converts the list into
> wikilinks
> like this:
> word nr1
> word nr 2
>
> converted into:
>
> [[word nr1]]
> [[word nr2]]
>
> The script I have (from Mark S):
> <script>
> var t=store.getTiddlerText('SomeTiddler','');
> var target = store.getTiddler('TargetTiddler') ;
> var taglist = t.split('\n') ;
> var tagout = new Array ;
> for(var i=0 ; i < taglist.length ; i++) {
> if ( taglist[i] ) tagout.push('[[' + taglist[i] + ']]') ;
> }
> target.tags = tagout ;
> return 'Mischief Managed' ;
> </script>
>
> What am I going to leave out? - what do I have to "get in"??
>
> YS 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
-~----------~----~----~----~------~----~------~--~---