Adam Wight | 24 Mar 2012 18:09
Favicon

Template contains list items, but no start tag?

I found this task in [[mw:Parsoid/Todo]]:
* Move list handler from tokenizer to sync23 phase token
transformer to support list items from templates.

Does this mean, using a template like {{Foreach|delim=*}} can generate some
list items, and the calling page has control over
whether these items are in their own list, or continue
another list?  In this case, the attached tests describe the
feature correctly?

Regards,
Adam Wight
Attachment (list_tests.patch): text/x-diff, 962 bytes
_______________________________________________
Wikitext-l mailing list
Wikitext-l <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitext-l
Trevor Parscal | 26 Mar 2012 17:31
Picon
Gravatar

Re: Template contains list items, but no start tag?

I may not be understanding your question very well, but I this might help.


List items that come from different sources will be treated as separate lists in the editor (at least initially) even if they are rendered as a contiguous list in the final view. We may add some slick features to the editor to blend the native and generated portions of the document together better, but that will be something we work on adding down the road.

- Trevor

On Sat, Mar 24, 2012 at 10:09 AM, Adam Wight <spam <at> ludd.net> wrote:
I found this task in [[mw:Parsoid/Todo]]:
* Move list handler from tokenizer to sync23 phase token
transformer to support list items from templates.

Does this mean, using a template like {{Foreach|delim=*}} can generate some
list items, and the calling page has control over
whether these items are in their own list, or continue
another list?  In this case, the attached tests describe the
feature correctly?

Regards,
Adam Wight

_______________________________________________
Wikitext-l mailing list
Wikitext-l <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitext-l


_______________________________________________
Wikitext-l mailing list
Wikitext-l <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitext-l
Adam Wight | 27 Mar 2012 05:48
Favicon

Re: Template contains list items, but no start tag?

That makes sense.  Sorry if that "Foreach" example was misleading, it was a
more than a bit hackish.  It's still tough for me to envision how this blending
of lists will play out as wikitext, but I took a pass at implementing something
like I characterized in those parser test cases.  https://gerrit.wikimedia.org/r/3729

List items generated by a template are parsed as if the generated text had
appeared in that same location.

One problem that jumps out right away is that the inner template would have to
take into account the indentation level of its calling page.

Thanks,
Adam

tparscal <at> wikimedia.org:
> I may not be understanding your question very well, but I this might help.
> 
> List items that come from different sources will be treated as separate
> lists in the editor (at least initially) even if they are rendered as a
> contiguous list in the final view. We may add some slick features to the
> editor to blend the native and generated portions of the document together
> better, but that will be something we work on adding down the road.
> 
> - Trevor
> 
> On Sat, Mar 24, 2012 at 10:09 AM, Adam Wight <spam <at> ludd.net> wrote:
> 
> > I found this task in [[mw:Parsoid/Todo]]:
> > * Move list handler from tokenizer to sync23 phase token
> > transformer to support list items from templates.
> >
> > Does this mean, using a template like {{Foreach|delim=*}} can generate some
> > list items, and the calling page has control over
> > whether these items are in their own list, or continue
> > another list?  In this case, the attached tests describe the
> > feature correctly?
> >
> > Regards,
> > Adam Wight
> >
> > _______________________________________________
> > Wikitext-l mailing list
> > Wikitext-l <at> lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitext-l
> >
> >

> _______________________________________________
> Wikitext-l mailing list
> Wikitext-l <at> lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitext-l
Gabriel Wicke | 2 Apr 2012 11:24
Favicon

Re: Template contains list items, but no start tag?

On 03/26/2012 05:31 PM, Trevor Parscal wrote:
> I may not be understanding your question very well, but I this might help.
>
> List items that come from different sources will be treated as separate
> lists in the editor (at least initially) even if they are rendered as a
> contiguous list in the final view. We may add some slick features to the
> editor to blend the native and generated portions of the document
> together better, but that will be something we work on adding down the road.

IMHO it would make sense to treat lists with items coming from templates 
similar to tables produced by table start / row / end templates- as 
something partially constructed from templates. We can mark both tables 
and lists as being composed from templates in the parser, which should 
make it quite easy to initially protect those lists as opaque blobs in 
the editor, until advanced support for mixed-source structures is 
implemented.

Gabriel

Gmane