====== yalist Plugin ======
---- plugin ----
description: Simple universal list plugin
author : Mark Prins (previously Ben Slusky)
email : mprins@users.sf.net
type : syntax
lastupdate : 2023-06-30
compatible : Rincewind, Angua, Adora Belle, Weatherwax, Ponder Stibbons, Hrun, Binky, Detritus, Elenor of Tsort, Frusterick Manners, Greebo, Hogfather, Jack Jackrum
depends :
conflicts : indexmenu2, navi
similar : definitions, definitionlist, deflist, dl, lists, mllist
tags : list, definitions
downloadurl: https://github.com/mprins/dokuwiki-plugin-yalist/archive/master.zip
bugtracker : https://github.com/mprins/dokuwiki-plugin-yalist/issues
sourcerepo : https://github.com/mprins/dokuwiki-plugin-yalist
donationurl: https://github.com/sponsors/mprins
screenshot_img :
----
===== Overview =====
There are many list syntax plugins (see the list of similar plugins above), but this one is mine. I created it because I am not happy with any of the others:
* Only [[plugin:lists]] and [[plugin:deflist]] allow paragraph breaks within list items, but their syntax is radically different from the standard DokuWiki [[:wiki:syntax#lists|syntax for lists]]. Worse, the syntax that each plugin introduces for list item terminators differs from the other.((Which is especially strange, since they were written by the same author.))
* [[plugin:definitions]] and [[plugin:definitionlist]] do not allow nested definition lists.
* [[plugin:deflist]] and [[plugin:dl]] allow nested definition lists, and un/ordered lists nested in definition lists,(([[plugin:lists]] and [[plugin:deflist]] in combination allow arbitrary nesting of lists.)) but neither one properly uses the "class=level//N//" style to mark the depth of a list item, as the standard DokuWiki list handler does.
* [[plugin:deflist]] and [[plugin:dl]] automatically create a "bookmark" for each definition list term, which introduces a new requirement that definition list terms be unique within a document. This is IMO not a good idea.
My goal in creating yalist was to integrate definition lists into the existing nestable list handler, and to allow list items to contain multiple paragraphs, while maintaining syntax- and output-level compatibility with the existing list handler. yalist achieves this by preempting DokuWiki's list handler, replacing it with a new handler and renderer that render the standard list syntax exactly as DokuWiki would.
===== Install =====
Search and install the plugin using the [[plugin:extension|Extension Manager]].
===== Syntax =====
Ordered list item 3…
… in multiple paragraphs
Unordered list item…
… in multiple paragraphs
Back to second level
Quiet, you.
The style sheet provided with this plugin will render these paragraphs…
… to the left of the term being defined.
- ordered list item [
Lists can be nested within lists by indenting them further, just as in the standard DokuWiki syntax.
===== Example =====
** The following DokuWiki source: **
- Ordered list item 1
- Ordered list item 2
-- Ordered list item 3...
.. ... in multiple paragraphs
- Ordered list item 4
* Unordered list item
** Unordered list item...
.. ... in multiple paragraphs
- Ordered list, first level
- Second level
- Third level
- Fourth level
-- Back to second level
- //Second?! What happened to third?//
.. //Quiet, you.//
- Back to first level
- Still at first level
? Definition list
: Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content. [Source: W3C]
? Definition list w/ multiple paragraphs
:: The style sheet provided with this plugin will render these paragraphs...
.. ... to the left of the term being defined.
? Definition list w/ multiple "paragraphs"
: Another way to separate blocks of text in a definition...
: ... is to simply have multiple definitions for a term (or group of terms).
: This definition list has DD tags without any preceding DT tags.
: Hey, it's legal XHTML.
? Just like DT tags without following DD tags.
?? But DT tags can't contain paragraphs. That would __not__ be legal XHTML.
.. If you try, the result will be rendered oddly.
** ... is rendered in XHTML as follows: **
Executed as sample [[http://accesstoinsight.eu/external/yalist|here]].
===== Discussion =====
Updated with bugfixes and enhancements. In the unlikely event that anyone downloaded this plugin already, try it again now. --- //[[sluskyb@paranoiacs.org|Ben Slusky]] 2007-11-10 02:30//
FIXME Great idea but seems to be buggy. Once I installed the plugin all bullets are treated as new lists. Basically if I have
* Item 1
* Item 2
* Item 3
The plugin will interpret them as if I wrote
* Item 1
* Item 2
* Item 3
Worse than that, it seems to break all \[\[ \]\] interwiki links
> Bulleted lists and interwiki links both work for me... do you have a public site I can look at? --- //[[sluskyb@paranoiacs.org|Ben Slusky]] 2007-11-24 23:39//
FIXME Ben, this seems to be almost exactly the right solution, but there's one thing it doesn't do correctly. I want to write
* First level
** First level
* Second level
* Second level
.. continuing the last first level point
but this doesn't work: the .. isn't interpreted, and just becomes part of the last second-level bullet. It seems that the continuation context of the first level is lost in the transition to the second level. I can continue a second level bullet, but to go back to the first level I have to start a new bullet.
Any chance of this being corrected any time soon? Thanks, Andrew.
> Maybe the [[plugin:clearfloat|ClearFloat]] __**[[plugin:outdent|Outdent]]**__ plugin **can** do some good for this thingy you describe... It's just an idea LOL so please don't hang me on it. HTH\\ --- //[[http://www.the-evil.pointclark.net|Mischa The Evil]] 2008/06/11 18:38//
> Fixed in the latest version. --- //[[sluskyb@paranoiacs.org|Ben Slusky]] 2008-07-08 02:02//
> Works---thanks! Andrew
FIXME I also wanted to be able to use markup provided by DokuWiki Core (DWC) and some DokuWiki Plugins (DWP's) of the //[[devel:Syntax Plugins#mode_types|mode type]]// ''[[devel:Syntax Plugins#syntax_types|container]]''((ie. ([[plugin:blockquote|block-]])[[wiki:syntax#quoting|quotations]], [[wiki:syntax#tables|tables]], [[plugin:note|notes]], [[plugin:styler|styler styles]], [[plugin:contact|contacts]] and some types of [[plugin:bbcode|bbcode]])) but that wasn't possible due to the fact that yalist doesn't allow markup provided by DWC and DWP's which are of the //mode type// ''container''.
This can be changed easily by adding the ''container''-//mode type// as a new (additional) argument of the method ''getAllowedTypes()'', which itself returns an array of //mode types// that may be nested within yalist's own markup.\\
This change can be applied by modifying line 56 from
return array('substition', 'protected', 'disabled', 'formatting');
to
return array('container', 'substition', 'protected', 'disabled', 'formatting');
I haven't noticed any unwanted behaviour afterwards, but YMMV ;-)
--- //[[http://www.the-evil.pointclark.net|Mischa The Evil]] 2008/06/11 22:54//
> Hm... I think this would result in invalid XHTML, so it's not going in. Sorry. --- //[[sluskyb@paranoiacs.org|Ben Slusky]] 2008-07-08 02:14//
> A possible work-arround might to put such in what ever division (at least it works for tables in this case:
> ? text
::
--- [[user>Samana Johann|"Samana Johann"]] //2019-09-04 06:05//
Updated on 8 July 2008 to add support for LaTeX output (thanks to Michael Strey) and fix a formatting error when ".." is shallower than the preceding list markup. --- //[[sluskyb@paranoiacs.org|Ben Slusky]] 2008-07-28 02:25//
----
Where would I modify the code to allow the plugin to interpret "#" as an ordered list (ideally in addition to "-", but instead of will do too)? --- //Ashtagon// 2011-Aug-8.
----
==== Feature Request ====
I need very often line breaks (
) but not paragraph breaks (
), especially when inserting images inside lists. My current workaround is using ''%%\\ %%'' but it's not very readyble because of huge lines. Would it be somehow possible to have a line break syntax like e.g. ''.'' at the beginning of the line?