Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
tiddler slices: table row headings, spaces in labels
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
FND  
View profile  
 More options Dec 22 2007, 4:00 am
From: FND <Ace_No...@gmx.net>
Date: Sat, 22 Dec 2007 10:00:06 +0100
Local: Sat, Dec 22 2007 4:00 am
Subject: tiddler slices: table row headings, spaces in labels
Hi all,

I just came across two apparent limitations regarding tiddler slices.

My data looked like this:
     |!ID|200712220001|
     |!Last Name|Doe|
     |!First Name|John|
I expected the following code to return the respective slice's value:
     store.getTiddlerSlice(title, "ID");
     store.getTiddlerSlice(title, "Last Name");
     store.getTiddlerSlice(title, "First Name");
However, this didn't work (returned "undefined").

There seem to be two reasons for that:
1. table row headings
    Unlike bold and italic formatting, the "!" indicating a row heading
    seems not to be ignored.
2. spaces in labels
    It appears that a slice's label must not contain spaces.

So I had to resort to using much less appealing formatting instead:
     ''ID'': 200712220001
     ''~LastName'': Doe
     ''~FirstName'': John

Are these limitations known or even intentional, or should I create a
ticket for this? (I don't dare touching the slicesRE though... )

-- F.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lyall  
View profile  
 More options Dec 22 2007, 7:10 am
From: Lyall <Lyall.Pea...@gmail.com>
Date: Sat, 22 Dec 2007 04:10:14 -0800 (PST)
Local: Sat, Dec 22 2007 7:10 am
Subject: Re: tiddler slices: table row headings, spaces in labels
I created an improved slices plugin when I hit problems with slices.

http://remotely-helpful.com/TiddlyWiki/ImprovedSlicesPlugin.html

The regexps for slices are faulty, there is already a ticket
outstanding for it.

In the mean time, the above plugin fixes the problem pending the core
being fixed and also provides some nifty additions in a backward
compatible manner :-)

The code could, actually, be incorporated into the core.

...Lyall

On Dec 22, 7:00 pm, FND <Ace_No...@gmx.net> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FND  
View profile  
 More options Dec 22 2007, 8:07 am
From: FND <Ace_No...@gmx.net>
Date: Sat, 22 Dec 2007 14:07:39 +0100
Local: Sat, Dec 22 2007 8:07 am
Subject: Re: [twdev] Re: tiddler slices: table row headings, spaces in labels

> I created an improved slices plugin when I hit problems with slices.

Thanks, Lyall.
I know about your ImprovedSlicesPlugin - and while there's certainly a
raison d'ętre for it as a plugin*, I believe that the core slices should
remain simple label/value pairs.

Nevertheless, the core RegEx could do with some improvements, and your
ticket (http://trac.tiddlywiki.org/ticket/370) certainly deserves some
attention.
If you could submit a patch, that would make it much easier for Jeremy
or Martin to review the suggested changes and consider them for
inclusion in the core.

-- F.

* I would have called it ExtendedSlicesPlugin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lyall  
View profile  
 More options Dec 22 2007, 11:21 pm
From: Lyall <Lyall.Pea...@gmail.com>
Date: Sat, 22 Dec 2007 20:21:12 -0800 (PST)
Local: Sat, Dec 22 2007 11:21 pm
Subject: Re: tiddler slices: table row headings, spaces in labels
I have already provided patch info, as described in the ticket. Not an
actual 'patch' input file but given a revised regex to use.

Still, I think the ImprovedSlicesPlugin code could become core,
primarily because it is backward compatible (actually better than
backward compatible, cos it works) as well as providing some useful,
optional additional functionality.

...Lyall

On Dec 22, 11:07 pm, FND <Ace_No...@gmx.net> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
FND  
View profile  
 More options Dec 30 2007, 5:35 pm
From: FND <Ace_No...@gmx.net>
Date: Sun, 30 Dec 2007 23:35:20 +0100
Local: Sun, Dec 30 2007 5:35 pm
Subject: Re: [twdev] Re: tiddler slices: table row headings, spaces in labels

> I have already provided patch info, as described in the ticket. Not an
> actual 'patch' input file but given a revised regex to use.

An actual patch would greatly enhance the chances of this being given
another look (which is only natural; the easier you make it for the
maintainers, the quicker they can review and possibly commit the changes).

-- F.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
BubbleHead  
View profile  
 More options Jan 31 2008, 12:07 am
From: BubbleHead <r...@saragossa.net>
Date: Wed, 30 Jan 2008 21:07:29 -0800 (PST)
Local: Thurs, Jan 31 2008 12:07 am
Subject: Re: tiddler slices: table row headings, spaces in labels

On Dec 22 2007, 1:00 am, FND <Ace_No...@gmx.net> wrote:

I had similar probs, and don't know if it's koshur, but here's what my
solution is:
I delved into the core JS of Jeremy's Tiddlywiki after installing the
"forEachTiddler" plugin and found the line,
TiddlyWiki.prototype.slicesRE = /(?:[\'\/]*~?([\.\w]+)[\'\/]*\:[\'\/]*
\s*(.*?)\s*$)|(?:\|[\'\/]*~?([\.\w]+)\:?[\'\/]*\|\s*(.*?)\s*\|)/gm;

I edited that to,
TiddlyWiki.prototype.slicesRE = /(?:[\'\/]*~?([\.\w]+)[\'\/]*\:[\'\/]*
\s*(.*?)\s*$)|(?:\|[\'\/ \!]*~?([\.\w]+)\:?[\'\/]*\|\s*(.*?)\s*\|)/gm;

... and I now get data from tables such as:

| !Item|Pewter Cup, 14th century|
| !Purchased|2008-01-25|
| !Paid|195|
| !Value|290|

with code like:

<<forEachTiddler
where
  ' tiddler.tags.contains("vessels")'
script
 'function writeRow(index, tiddler, context) { var result = ""; if
(index == 0) {context.sum = 0; context.count = 0; result = "|!Item|!
Count|!Value|!Sum|\n";}   context.sum = context.sum +
parseInt(store.getTiddlerSlice(tiddler.title, "Value")); context.count+
+; result += "|" + tiddler.title + "| " + context.count + "| " +
store.getTiddlerSlice(tiddler.title, "Value") + "| " + context.sum + "|
\n"; return result;}'
write
 'writeRow(index, tiddler, context)'


Rik

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »