• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

conf/03-Sep-2024-3112

lang/03-Sep-2024-2812

LICENSED01-Sep-202417.7 KiB340281

READMED01-Sep-2024758 2114

README.mdD01-Sep-20243.4 KiB129101

action.phpD01-Sep-2024834 3716

plugin.info.txtD01-Sep-2024233 87

renovate.jsonD01-Sep-2024114 76

script.jsD01-Sep-20244.3 KiB13378

syntax.phpD01-Sep-20245.2 KiB15279

README

1foldablelist Plugin for DokuWiki
2
3collapse a list after a configurable number of items and/or at a configurable depth
4
5Please refer to http://www.dokuwiki.org/plugins for additional info
6on how to install plugins in DokuWiki.
7
8----
9Copyright (C) medmen <med-men@gmx.net>
10
11This program is free software; you can redistribute it and/or modify
12it under the terms of the GNU General Public License as published by
13the Free Software Foundation; version 2 of the License
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18GNU General Public License for more details.
19
20See the COPYING file in your DokuWiki folder for details
21

README.md

1# dokuwiki-plugin-foldablelist
2plugin that makes an unordered or ordered list invisible after n items
3
4## how to use?
5simply wrap the list into the tags
6
7```
8<foldablelist>
9  * list item 1
10  * list item 2
11  * list item 3
12</foldablelist>
13```
14this list can be generated via markup or dokuwiki plugins like the tag-plugin.
15
16#### Advanced use
17```
18<foldablelist>
19{{topic>ns1:sub-ns?tag}}
20</foldablelist>
21```
22uses the tag plugin (topic component) to generate the list from all pages in the namespace ns1/sub-ns tagged with "tag"
23
24## configuration
25this plugin can be configured via dokuwikis admin config page.
26These are the items to configure:
27
28`collapse_after: 5` the number of list items to be displayed before hiding the rest of the list, default value: 5, set to 0 to disable
29
30`collapse_level: 3` the number of list items to be displayed before hiding the rest of the list, default value: 3, set to 0 to disable
31
32`button_css: 'padding: 0.2em;'` css to style your button, feel free to colorize of move it around
33
34`button_up_value: ▲` the value shown in the button when clicking will collapse the list
35
36`button_down_value: ▼` the value shown in the button when clicking will unfold the list
37
38#### new in 2020:
39you can pass the config to every single instance:
40
41```
42<foldablelist collapse_after=2>
43  * list item 1
44  * list item 2
45  * list item 3
46</foldablelist>
47```
48this will show only the first 2 items
49
50#### new in 2022:
51
52added config-options for CSS and separate Button-Up and Button-Down
53
54foldablelist will now work with ordered lists (ol) too ;-)
55
56#### new in 2024:
57
58```
59<foldablelist collapse_level=2>
60  * item 1
61  * item 2
62  * item 3
63    * item 3.1
64    * item 3.2
65      - item 3.2.1
66      - item 3.2.2
67        * item 3.2.2.1
68        * item 3.2.2.2
69        * item 3.2.2.3
70      - item 3.2.3
71    * item 3.3
72    * item 3.4
73  * item 4
74  * item 5
75</foldablelist>
76```
77
78this will show only the first levels and will hide items like 3.2.1
79
80You can mix and match both settings too:
81
82```
83<foldablelist collapse_level=2&collapse_after=4>
84  * item 1
85  * item 2
86  * item 3
87    * item 3.1
88    * item 3.2
89      - item 3.2.1
90      - item 3.2.2
91        * item 3.2.2.1
92        * item 3.2.2.2
93        * item 3.2.2.3
94      - item 3.2.3
95    * item 3.3
96    * item 3.4
97    * item 3.5
98  * item 4
99  * item 5
100  * item 6
101</foldablelist>
102```
103
104this will hide levels deeper than 2 AND will hide items more than 4 at each level
105
106beware the syntax when using both settings inline:
107settings MUST be joined by ampersand '&', no blank spaces allowed !!
108
109
110## why use?
111people like to put "important stuff" on startpage and the department i work in is not different.
112Things considered "important" get written on startpage, usually as lists (upcoming meetings, changes in workflow, new orders by the boss ...)
113and each list naturally grows as new items are added on top but older items remain important enough to keep them..
114
115Our startpage has grown to a length of 4 screen-pages by now because of that, so sooner
116or later my boss asked me to reduce the visible number of items on those lists to
117a certain minimum.
118
119This plugin adresses the issue in a quick and cosmetic way:
120all information is still available, but (hopefully) less important stuff gets hidden by default.
121
122## great but i miss feature X
123Feel free to improve, share and debug!
124
125* send me feature requests
126* found a bug? please report at github
127* you are a programmer and want to improve the plugin?
128Go ahead --> fork, rewrite, enhance and extend..
129