====== Folded Plugin ====== ---- plugin ---- description: Foldable page sections author : Dokufreaks (previous authors: Michael Hamann, Fabian van-de-l_Isle, Christopher Smith, Esther Brunner) email : freaks@dokuwiki.org type : syntax lastupdate : 2023-07-22 compatible : Kaos, Jack Jackrum, Igor, Hogfather, Greebo, Frusterick Manners, Detritus, Hrun, Ponder Stibbons, Binky, Weatherwax, Adora Belle, Angua depends : conflicts : similar : hidden, outliner, inline_folding, inline_folding2, sectiontoggle, spoiler, htmldetailstag, stepbystep tags : section, hide, collapsible, fold downloadurl: https://github.com/dokufreaks/plugin-folded/archive/master.zip sourcerepo: https://github.com/dokufreaks/plugin-folded bugtracker: https://github.com/dokufreaks/plugin-folded/issues ---- ===== Description ===== This [[:plugins|plugin]] is based on the [[inline folding]] plugin by [[webmaster@lajzar.co.uk|ta' Lajżar]] and the [[inline_folding2|slightly changed version thereof]] by [[chris@jalakai.dot.co.uk|Christopher Smith]] and [[esther@kaffeehaus.ch|Esther Brunner]]. (A lot of the work was based on the older hacks by Chris Stoll. This one combines the features of all plugin variants in one.) ===== Usage ===== If you want to make additional information available that is hidden by default, you have two options with this plugin: **Inline:** This is example ++text | with some of it only shown when you unfold it++. And after that the text just continues to flow in the same paragraph. This is example ++text | with some of it only shown when you unfold it++. And after that the text just continues to flow in the same paragraph. **Block:** This is example text. ++++ Title | | This table | is only shown | when you unfold the block | {{page>some other wiki page&inline}} ++++ ^ ^ Inline ^ Block ^ | Syntax | ''%%++title| formatted text ++%%'' | ''%%++++title| any content ++++%%'' | | HTML | ''%%%%'' tag | ''%%
%%'' tag | | Can contain formatting | :-) | :-) | | Can contain block elements((like tables, lists, new paragraphs, included files, etc.)) | --- | :-) | | Can be used within a paragraph, table, list, etc. | :-) | --- | ^ Note: As of version 2005-09-02 the syntax has changed to allow linked titles to unfold and fold the section. The pipe char between title and text is mandatory. ^ ===== Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. :!: If you install this plugin manually (by copying the directory to the plugins directory) you need to clear DokuWikis cache in order to make this plugin working. Otherwise it won't fold/unfold correctly. To clear the cache open -> modify any character -> undo -> save -> close the file /conf/local.php. This causes DokuWiki to rebuild its cache. FIXME The previous is probably true for even more plugins, thus, a general important information. Alternatively open the configuration page and save it. To install the plugin manually: - download the source to your plugin folder, ''lib/plugins''. - extract the downloaded files contents. That should create a new folder ''lib/plugins/folded'' containing all the files required by the plugin. action.php action part for making the translated/configured titles available in the JavaScript code conf folder containing the configuration settings and their metadata conf/default.php default values for configuration settings conf/metadata.php configuration setting metadata used by [[plugin:config|Configuration Manger]] lang folder containing all the localised language folders lang/xx xx = language code, there maybe several of these, at least one being en for english lang/xx/lang.php language strings for language code "xx" lang/xx/settings.php configuration prompts used by [[plugin:config|Configuration Manger]] script.js JavaScript to handle hiding and revealing of folded content style.css styles for folding labels and folded content open.gif arrow image pointing right closed.gif arrow image pointing down syntax folder containing the plugin scripts syntax/span.php plugin script for inline folding (++) syntax/div.php plugin script for block folded (++++) The plugin is now installed. ===== Configuration ===== There are two configuration settings which can be used to override the folder link tooltips. These will be most useful for DokuWiki installations using a language not included with the plugin. **reveal** --- the title tooltip to be used by folding links when the folded content is hidden. If left empty the localised string will be used. **hide** --- the title tooltip to be used by folding links when the folded content is showing. If left empty the localised string will be used. **unfold_default** --- if this option is activated, then all sections will be unfolded per default. **show_fold_unfold_all_button** --- if this option is activated, then a button will be displayed in the toolbar. If it is clicked, the button folds or unfolds all sections at once. ===== Styling ===== The look of the folded sections can be customized by adding CSS code to [[devel:css#user_styles|userstyle.css]]. The following examples show the CSS selectors to be used to modify the style of the folded plugin: ==== Example 1 ==== Adding this CSS code to ''userstyles.css'' would give the clickable section a 2 pixel broad black border: .folder { border: 2px solid black; } .folder.open { border: 2px solid black; } The selector ''.folder'' can be used to control the style of the folded state and the selector ''.folder.open'' for controlling the unfolded state. ==== Example 2 ==== Adding this CSS code to ''userstyles.css'' would give the unfolded section a 2 pixel broad black border: div.folded { border: 2px solid black; } span.folded { border: 2px solid black; } The selector ''div.folded'' can be used to control the style of a block section and the selector ''span.folded'' for controlling the inline section. ===== Localization ===== Please feel free to add the strings for your own language here and I will add them to the next release of the plugin. If your language isn't included at present, you can override the strings that are shown using the plugin's configuration settings as described above. ^ Language ^ title string ^ title string ^ alt string ^ alt string ^ ^ English ^ reveal ^ hide ^ reveal hidden content ^ hide content ^ ^ French | révéler | cacher | révéler le contenu | cacher le contenu | ^ German | aufdecken | verstecken | versteckten Inhalt aufdecken | Inhalt verstecken | ^ Korean | 보이기 | 감추기 | 감춰진 내용 보이기 | 내용 감추기 | ^ Swedish | visa | dölj | visa dolt innehåll | dölj innehåll | ^ Italian | mostra | nascondi | mostra i contenuti nascosti | nascondi i contenuti | ^ Chinese | 显示 | 隐藏 | 显示隐藏的内容 | 将内容隐藏 | ^ Danish | vis | skjul | vis skjult indhold | skjul indhold | ^ Russian | показать | скрыть | показать содержимое | скрыть содержимое | ^ Spanish | muestra | oculta | muestra el contenido oculto | oculta el contenido | ^ Dutch | tonen | verbergen | toon verborgen inhoud | verberg inhoud | ^ Norwegian | vis | skjul | vis skjult innhold | skjul innhold | ^ Ukrainian | показати | приховати | показати вміст | приховати вміст | ^ Estonian | näita | peida | näita peidetud sisu | peida sisu | | Catalan | mostra | amaga | mostra el contingut amagat | amaga el contingut | There are also two strings used in the admin/configuration page. ^ Language ^ for hide string setting ^ for reveal string setting ^ | English | Folding tooltip to hide
(leave empty to use localized string) | Folding tooltip to reveal
(leave empty to use localized string) | | Korean | 감추기 위한 접기 풍선도움말
(현지화된 문자열을 사용하려면 공백으로 두세요) | 보이기 위한 접기 풍선도움말
(현지화된 문자열을 사용하려면 공백으로 두세요) | | Chinese | 将工具条折叠来隐藏
(要使用本地化的字符串则留空) | 展开工具条来显示
(要使用本地化的字符串则留空) | | Russian | Подсказка для отображения содержимого
(оставьте пустым для использования значения по умолчанию) | Подсказка для сокрытия содержимого
(оставьте пустым для использования значения по умолчанию) | | Ukrainian | Підказка для відображення вмісту
(залиште порожнім для використання значення за замовчуванням) | Підказка для приховування вмісту
(залиште порожнім для використання значення за замовчуванням) | | Estonian | voltimise vihje peitmiseks
(jäta tühjaks, et kuvataks lokaliseeritud vaikimisi väärtust) | voltimise vihje näitamiseks
(jäta tühjaks, et kuvataks lokaliseeritud vaikimisi väärtust) | | Catalan | Etiqueta d'indicador de funció per amagar
(deixeu-la en blanc per utilitzar la cadena traduïda) | Etiqueta d'indicador de funció per mostrar
(deixeu-la en blanc per utilitzar la cadena traduïda) | | ... | [...] | [...] | ===== Nested Folds ===== With the help of the [[plugin:wrap|Wrap plugin]] you can create nested folds: ++++ Outer Fold | The trick is to wrap the inner fold: ++++ Inner Fold | This is the content of the inner fold. ++++ ++++ Another method to achieve nesting is the [[plugin:include|Include plugin]]. ===== Bugs / Feature Requests ===== Please report bugs or feature requests at the [[https://github.com/dokufreaks/plugin-folded/issues|Bug tracker]]. ===== Revision List ===== [[https://github.com/dokufreaks/plugin-folded/commits/master.atom|{{https://img-fotki.yandex.ru/get/4809/85226599.c/0_b4b8a_66849a66_orig.png?16x16&recache |Recent commits to Folded Plugin (RSS feed)}}]]{{rss>https://github.com/dokufreaks/plugin-folded/commits/master.atom date}} * 2008-08-13 --- Update plugin URL * --- add Dutch and Russian language strings * --- add support for unknown render formats (uses standard render functions for output, no folding) * 2007-05-30 --- Language strings updated, **RC2007-05-24 & [[devel:develonly]] only** * --- hide & hidelong strings added for all those languages missing them * --- Danish & Turkish strings added * --- Turkish strings added * 2007-01-24 --- Italian strings added, **darcs version only** * 2006-12-15 --- Swedish strings added, **darcs version only** * 2006-12-10 --- Updated release files for DokuWiki 2006-11-06 * --- [[devel:develonly]] darcs version updated for removal of domLib functions (DW patched 2006-11-10) * 2006-05-22 --- [[devel:develonly]] zh-tw strings added, **darcs version only** * 2006-05-04 --- [[devel:develonly]] Major revision * JavaScript made unobtrusive * fix hidden folded sections for browsers without JavaScript and for printing * localised title tooltip prompts embedded in HTML comments where JavaScript can access them * title tooltips can be overridden using config settings allowing wiki admins to use languages missing from the plugin. * toggle graphic moved to background * 2006-01-06 --- remove trim() from UNMATCHED rendering * 2005-12-31 --- package update with language strings for cs (Czech), ja (Japanese), ko (Korean), po (Polish) & zh (Chinese). No source changes. * 2005-09-18 --- source updated and initial release on darcs (see link above) ===== Old Releases ===== Previous releases can be found on [[https://github.com/dokufreaks/plugin-folded/releases|GitHub]]. ===== Requested Features / To Do ===== * support inline LaTex/MathJax and simple syntax like ... for subscripts, etc. * allow usage of ++++ in the sidebar * I'd also like to request nesting/nested folds. We use dokuwiki for our workplace, its great. Nested folds would be fantastic. // Alex C 31/7/2013 // * allow title formatting --- //[[grokwik@free.fr|Fred]] 2007-06-20 15:54// * Nesting folding sections... can be use for tree display and maybe other stuff ---- // Stephane Chamberland 2006-01-09 // * When displaying search results, folded text needs to be displayed if it contains a search hit --- //[[henry.olders@mcgill.ca|Henry Olders]] 2006-04-08 // * Make HTML id easier to understand. (for example I can put a link [[#requested_features_to_do|here]] based on the name, but the folded plugin ids are ''#folded_n'' - and if I link to that the folded section is not unfolded. This would make it much easier to do things for FAQs & such, like we are [[http://docs.blackfin.uclinux.org/doku.php?id=faq#folder_5|using]]. See? * Have an "unfold all" option on the page, to allow browser text searches for pages like [[http://docs.blackfin.uclinux.org/doku.php?id=faq|this]]. * Have "fold all" option as well Would it be possible to use an image instead of text? the idea is to have a small image "help.png" to open a local explanation in a box. Thank you. //[[emache47@gmail.com|Michel]] 2011-12-30// ===== Discussion ===== Please see the separate [[plugin:folded:discussion|discussion]] page.