Table of Contents
Complex Lists Plugin
Compatible with DokuWiki
No compatibility info given!
Create complex multi-level lists with cross-references - suitable for writing legal documents such as contracts and statutes
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Extension name contains underscore, will not generate popularity points.
Similar to mllist
Description
This plugin actually consists of three parts:
- a plugin that provides a complex, multilevel list facility where the document author can specify the format of numbers at each level;
- a plugin that inserts cross-references to other numbered list elements inside other numbered elements; and
- a plugin that creates a “formatting” mode that does not do actual formatting - this can be used to assist keeping a paragraph together when DokuWiki wants to break it up.
This plugin can be used for creating legal documents such as contracts or statutes.
Available Syntax
The List
The list is started by the “beginning of list” sequence, which is a list of number formats for two or more levels separated by '|' and surrounded by '#' on a line of its own without leading or trailing spaces, for example:
#1|(1)|(a)|(i)|(A)|(I)#
In the number formats, some characters have a special meaning:
Character | Meaning |
---|---|
1 | Substitute the paragraph number as an integer |
a | Substitute the paragraph number as a lower case letter |
A | Substitute the paragraph number as an upper case letter |
i | Substitute the paragraph number as a lower case Roman numeral |
I | Substitute the paragraph number as an upper case Roman numeral |
The following sequences affect the list layout when they appear on a line on their own (if they appear without any intervening content, ensure that they are separated by blank lines):
Sequence | Meaning |
---|---|
## | End of list |
# | Next list item |
#+# | Commence a new sub-list |
#-# | End a sub-list |
Cross-References
The following sequences can occur anywhere inside a complex list:
Sequence | Meaning |
---|---|
#:name# | Define a bookmark with the given name that can be referenced using cross-references. |
#@name# | Insert the fully qualified list item number for the bookmark with the given name. |
#*name# | Insert the list item number for the bookmark with the given name, omitting any parts of the fully qualified item number that is common with the location of this sequence (that is, the number substituted is “relative” to the current position in the list). |
Dummy formatting range
Sometimes DokuWiki will want to break up paragraphs inside a block section (such as a complex list element) when you do not want it to. This feature allows you to prevent that by enclosing part or all of the paragraph in this dummy formatting sequence. The sequence is:
Sequence | Meaning |
---|---|
#( | Beginning of non-break sequence |
)# | End of non-break sequence |
Installing
Download the plugin from http://projects.troy.rollo.name/dokuwiki/dokuwiki-complex-lists.tar.gz and extract it in your lib/plugins directory. Touch the file “conf/dokuwiki.php” to persuade DokuWiki to rebuild its cached CSS file, and hit the “Refresh” button on your browser to remove its cache of the CSS file.
Example Wiki Text
Hello. #1|(1)|(a)|(i)|(A)|(I)# #( This is the //first// list item #@bkmk# / #*bkmk# )# #( We can still produce output containing special tokens #(#)#( )# #(It has an **extra** paragraph)# # #(This is the second __list__ item #@bkmk# / #*bkmk#)# #+# Abc test #+# #(Which has a subitem and another #@bkmk# / #*bkmk#)# # abc #-# oops # a middle item # And more #+# and even more # #:bkmk# And another with a bookmark # keep going #-# # And one more #@nosuch# #-# And some remainder text # #(And a third item #@bkmk# / #*bkmk#)# ##
Author
License
Modified BSD (BSD without the advertising clause).
Bugs
Hi. I tried to use the complex list plugin in my DokuWiki installation but I get the next error on it.
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in E:\DocumentosAcosta\Desarrollo\apache_http\dokuwiki\lib\plugins\syntax.php on line 131
I'm working with PHP5.
dacosta51@gmail.com
Solution
This bug can be fixed for PHP5, where parameters to array_merge *must* be arrays. The second parameter is liable to be null sometimes, but coercing it to array fixes the problem. Change the code to:
$this->allowedModes = array_merge($this->allowedModes, (array) $PARSER_MODES[$mt]);
Errors below seem to be for an earlier version?
counterpoint at aliro dot org
End of solution
Same problem here… I deleted the Plugin inblock_ranges than the error disappears… using DokuWiki 20070626b. Could you please fix it?
As far as I can see there is no way the plugin could be causing this problem - the variable in question is a global that is not touched by the plugin itself. More relevant than the version of PHP might be the version of DokuWiki.
I am experiencing the same problem after installing complex list plugin. I use 2006-11-06 i.e. last stable version of DokuWiki. The error information comes each time I edit a page. The preview works fine and the saving is done properly although the error message is produced. Other error lines coming:
Warning: array_search() [function.array-search]: Wrong datatype for second argument in ..../lib/plugins/syntax.php on line 137
Warning: in_array() [function.in-array]: Wrong datatype for second argument in ..../inc/parser/parser.php on line 159
Warning: Cannot modify header information - headers already sent by (output started at ..../lib/plugins/syntax.php:134) in ..../inc/actions.php on line 287
If I deactivate inblock_ranges plugin the error vanishes. I wonder if this may be incompatibility problem with for example bibtex plugin?
- Pegax
I'm not sure this is particularly a bug but I have experienced some unexpected behaviour with the plugin. If the first list item is not enclosed within brackets, the subsequent items in that list don't get numbered. It may be that it is that I'm not following the documentation exactly, but
#1.|(1)# # Text for item 1 # Text for item 2 # Text for item 3 ##
Puts an extra blank list item at the top
#1.|(1)# #(Text for item 1)# # Test for item 2 # Text for item 3 ##
Works fine with, but
#1.|(1)# #(Text for item 1)# #(Test for item 2)# #(Text for item 3)# ##
Inexplicably (to me) does the first item as expected but then indents the following items without list numbers - Extra explanation of how to do the syntax would be appreciated, especially as the plugin really neatly fixes an important little gap in DokuWiki for me. Thank,
I have experienced the same problem as dakosta and Pegax above. I had a fresh install and only added that plugin and I get the error. I remove the plugin and I do not get it anymore. I am running XAMMP on windows xp sp2 (latest version). If there is anything I can do to help fix this please let me know.
Thanks, James
Anyone have any hints on how to change the formatting so the full numeric sequence appears each at each level. My formatting for a project is 1., 1.1, 1.2, 1.2.1, 1.2.2, 1.3, etc. It's too hard to follow when 1, .2, and .2 are all on separate lines. Is there an easy place to modify the code for this? Thanks!
- BUG: will not display capital letter list elements (i.e. A, B, C). Instead it shows “???”
- Resolution: line 181 in complex_list/syntax.php should be:
- Right:
$type = strpos(“01aAiI”, substr($str, $loc, 1));
- Wrong:
$type = strpos(“01abiI”, substr($str, $loc, 1));
Thanks, Anders
The problem regrading the array_merge issue is because the getAllowedTypes() function in inblock_ranges.php has 'substitution' as an allowed type, but the dokuwiki inc/parser/parser.php only defines 'substition' (misspelled?) as a valid type. Change line 56 in inblock_ranges from 'substitution' to 'substition' and everything works. Changing parser.php would probably break other plugins.
- Blaine
Thanks Blaine, With the latest version of the files, the change from “substitution” to “substition” you mention above needs to be made in the syntax.php file that is found in plugins/inblock_ranges/syntax.php - Doug