[tw] Re: Comma-separated lists in TW5

2017-12-01 Thread Mat
Rob Hoelz wrote:
>
> [...] render a list of items as a comma-separated list.
>


I had the same problem just some weeks ago. Solved it with CSS like so:

<$list filter="..."/>


.commas span:not(:last-child):after {content:", ";}
 


<:-)

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/86f70adc-7cf9-4289-b405-7975d1922cb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Comma-separated lists in TW5

2017-11-29 Thread Ste Wilson
If you tidy it up and save as a csv (text editor or excell) file you might find 
www.tablesgenerator.com/html_tables use full. 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/779e909d-b99a-4052-8821-9a936c035cc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Comma-separated lists in TW5

2017-11-29 Thread Jed Carty
The macro I made should be able to be modified. Just change the line <$link 
to=<>><> to whatever you want displayed 
for each item in the list.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f4402e60-fb24-4eb8-9b3a-f8868ef61e37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Comma-separated lists in TW5

2017-11-29 Thread Alex Hough
Hi Jed,

the use case from which this emerged was cut and pasting a comma separated
list from a PDF then wanting to create tiddlers for each in the list. Part
of a process of convering a PDF into an extensible document and
orgnaisational model.

I cut and paste the text into one side of the edit template, then use the
right hand side to crreate tiddlers.

I thought of an input resempling something like this

<<.macroName "music, food, art, gardening, performance" >>

It could be used to turn a sentence from a static text into an interface
for creating a model.

The marco could create tag pills, there could be a new here button at the
top.

The process would be taking annotation of a text one step further: the
annotation adds the capacity to build on lists within the existing text.

Alex

On 29 November 2017 at 12:45, Jed Carty  wrote:

> The first response is: Do you have to use comma separated lists for the
> input instead of using the native tiddlywiki list format? Because if you
> use the native format than you can just use normal filter operators.
>
> The actual answer to your question is to put this in a tiddler with the
> tag $:/tags/Macro then you can use the macro SplitCommaList:
>
> \define InnerSplitCommaList()
> <$list filter="""[splitbefore[,]removesuffix[,]]"""
> variable=CurrentItem emptyMessage="""<$link to=<>><<
> currentList>>""">
> <$link to=<>><>
> <$set name=CurrentList 
> filter='[removeprefixremoveprefix[,]]'
> emptyValue=<>>
> <>
> 
> 
> \end
>
> \define SplitCommaList(list)
> <$set name=CurrentList value="""$list$""">
> <$set name=CurrentList filter='[addsuffix[,]]'>
> <>
> 
> 
> \end
>
> Usage:
>
> Directly give the list:
>
> `<>`
>
> <>
>
> Using a text reference:
>
> `<>`
>
> <>
>
> the second set widget adds a comma to the end of the list because checking
> to see if you are on the last item and there is no trailing comma is a pain
> otherwise. This works with lists with and without trailing commas.
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/tiddlywiki/8179a850-9024-4125-a6d7-96eeddf17a3f%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CALc1hYeMuTMO7C3EL2S8ouq0U7xmk9hijyLhHJCqg-zMJ9pnvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Comma-separated lists in TW5

2017-11-29 Thread Jed Carty
The first response is: Do you have to use comma separated lists for the 
input instead of using the native tiddlywiki list format? Because if you 
use the native format than you can just use normal filter operators.

The actual answer to your question is to put this in a tiddler with the tag 
$:/tags/Macro then you can use the macro SplitCommaList:

\define InnerSplitCommaList()
<$list filter="""[splitbefore[,]removesuffix[,]]""" 
variable=CurrentItem emptyMessage="""<$link 
to=<>><>""">
<$link to=<>><>
<$set name=CurrentList 
filter='[removeprefixremoveprefix[,]]' 
emptyValue=<>>
<>


\end

\define SplitCommaList(list)
<$set name=CurrentList value="""$list$""">
<$set name=CurrentList filter='[addsuffix[,]]'>
<>


\end

Usage:

Directly give the list:

`<>`

<>

Using a text reference:

`<>`

<>

the second set widget adds a comma to the end of the list because checking 
to see if you are on the last item and there is no trailing comma is a pain 
otherwise. This works with lists with and without trailing commas.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8179a850-9024-4125-a6d7-96eeddf17a3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Comma-separated lists in TW5

2017-11-29 Thread Alex Hough
a related question...

I have a comma separated list, how could I make the phrases be converted to
wikilinks?

I was thinking of a macro which would take the list and output the links



Alex

On 28 November 2017 at 19:54, Rob Hoelz  wrote:

> Ah, good trick - thanks!
>
> On Tuesday, November 28, 2017 at 12:41:51 PM UTC-6, Jed Carty wrote:
>>
>> If you are using a list widget than you just go like this:
>>
>> <$list filter=<>>
>> <>,
>> 
>>
>> to prevent a trailing comma on the last item you can do this:
>>
>> <$list filter='[tag[HelloThere]]+[butlast[]]'>
>> <>,
>> 
>> <$list filter='[tag[HelloThere]]+[last[]]'>
>> <>
>> 
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/tiddlywiki/d9c68edf-14ff-48e9-a649-9cd43f294810%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CALc1hYdHjFzM%2BwWkH16TACjzc-GZ_xNdnpViNvcxWJQw-o%2BGww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Comma-separated lists in TW5

2017-11-28 Thread Rob Hoelz
Ah, good trick - thanks!

On Tuesday, November 28, 2017 at 12:41:51 PM UTC-6, Jed Carty wrote:
>
> If you are using a list widget than you just go like this:
>
> <$list filter=<>>
> <>,
> 
>
> to prevent a trailing comma on the last item you can do this:
>
> <$list filter='[tag[HelloThere]]+[butlast[]]'>
> <>,
> 
> <$list filter='[tag[HelloThere]]+[last[]]'>
> <>
> 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d9c68edf-14ff-48e9-a649-9cd43f294810%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Comma-separated lists in TW5

2017-11-28 Thread Jed Carty
If you are using a list widget than you just go like this:

<$list filter=<>>
<>,


to prevent a trailing comma on the last item you can do this:

<$list filter='[tag[HelloThere]]+[butlast[]]'>
<>,

<$list filter='[tag[HelloThere]]+[last[]]'>
<>


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0bddf769-b0b8-463f-bdf0-dc72bdc73747%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.