I am using the ForEachTiddlerPlugin and I am trying to list the first
10 entries of the tag "journal" along with the first line of each
tiddler.  I can get it to work, but the first line ends up on the line
below the tiddler title.  How can I get the tiddler title and first
line all on the same line?

Code from tiddler List the first line of all tiddlers with the tag
"basic"
http://tiddlywiki.abego-software.de

[code]
<<forEachTiddler
 where
 'tiddler.tags.contains("basic")'
 script
 '
 function getFirstLine(s) {
 var m = s.match(/\s*(.*)/);
 return m != null && m.length >= 1 ? m[1] : "";
 }
 '
 write
 '"*[["+tiddler.title+"]] &rarr; "+getFirstLine(tiddler.text)+"\n"'
>>
[/code]

Code from tiddler List the first 10 tiddlers that have the tag 'basic'
http://tiddlywiki.abego-software.de

[code]
<<forEachTiddler
    where
        'tiddler.tags.contains("basic")'
    write
        '(index < 10) ? "* [["+tiddler.title+"]]\n" : ""'
>>
[/code]

My combined code:

[code]
Recent [[Journal]] entries:
<<forEachTiddler
    where
        'tiddler.tags.contains("journal")'
        script
 '
function getFirstLine(s) {
 var m = s.match(/\s*(.*)/);
 return m != null && m.length >= 1 ? m[1] : "";
}
 '
write
        '(index < 10) ? "* [["+tiddler.title+"]]\n  &rarr;
"+getFirstLine(tiddler.text)+"\n": "" '
>>
[/code]

Output:

Recent Journal entries:
18 October 2008
→ Job celebration dinner
24 September 2008
→ Arrival in Ireland

What am I doing wrong?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to