DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:catlist

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:catlist [2019-10-06 11:27] – [Options] xifplugin:catlist [2024-03-07 19:31] (current) – Tested OK with Jack + Kaos dregad
Line 6: Line 6:
 email      : xcodexif@xif.fr  email      : xcodexif@xif.fr 
 type       : Syntax type       : Syntax
-lastupdate : 2019-09-13 +lastupdate : 2023-12-16 
-compatible : "Frusterick Manners", Detritus, Elenor Of Tsort, Greebo+compatible : Detritus, Elenor of Tsort, Frusterick Manners, Greebo, Hogfather, Igor, Jack Jackrum, Kaos+
 depends    :  depends    : 
 conflicts  conflicts 
Line 24: Line 24:
 ===== Screenshots ===== ===== Screenshots =====
  
-Example page [[http://wiki.xif.fr|here]]. On the right, another example sidebar using Bootstrap.+Example page [[http://wiki.xif.fr|here]].
  
-{{http://dev.xif.fr:7979/catlist/screenshot_both.png?nolink}}+{{http://dev.xif.fr:7979/catlist/screenshot_test_cols.png?nolink}}
  
-Example using columns: 
-{{http://dev.xif.fr:7979/catlist/screenshot_columns.png?nolink}} 
  
 ===== Syntax ===== ===== Syntax =====
Line 37: Line 35:
 The namespace itself is optional. If not provided, the namespace of current page is used by default (equivalent to ''.:'').\\ The namespace itself is optional. If not provided, the namespace of current page is used by default (equivalent to ''.:'').\\
 Relative (''.:ns'') and parent (''ns1:..:ns2'') namespaces can be used. Relative (''.:ns'') and parent (''ns1:..:ns2'') namespaces can be used.
 +
 +==== More specific syntax ====
 +
 +Note that ''.'' refers to the page where the ''<catlist>'' tag is. **For use in a sidebar**, where the //displayed// page is what you want as the base namespace, use the syntax <code><catlist %%CURRENT_NAMESPACE%%></code>
  
 Here are some examples about exclusion : Here are some examples about exclusion :
   * List only namespaces relative to current namespace :\\ ''<catlist -exclupage>''   * List only namespaces relative to current namespace :\\ ''<catlist -exclupage>''
-  * List everything except ''dirty_page'' relative to current namespace :\\ ''<catlist -excludeOnName -exclupage:"^dirty_page$">''\\ (to be strict) but most of the time,\\ ''<catlist -exclupage:"dirty_page">''\\ will be ok +  * List everything except ''dirty_page'' relative to current namespace :\\ ''%%<catlist -excludeOnName -exclupage:"^dirty_page$">%%''\\ (to be strict) but most of the time,\\ ''%%<catlist -exclupage:"dirty_page">%%''\\ will be ok 
-  * List everything in ''.:foo_namespace:'', except pages whose name begins with a number :\\ ''<catlist .:foo_namespace -excluPage:"^foo_namespace:[0-9]">''\\ or equivalently\\ ''<catlist .:foo_namespace -excludeOnName -excluPage:"^[0-9]">'' +  * List everything in ''.:foo_namespace:'', except pages whose name begins with a number :\\ ''<catlist .:foo_namespace -excluPage:"^foo_namespace:[0-9]">''\\ or equivalently\\ ''%%<catlist .:foo_namespace -excludeOnName -excluPage:"^[0-9]">%%'' 
-  * Exclude all page in ''mynamespace'' except ''page1'' and ''page2'' (without excluding these pages in sub-namespaces) :\\ ''<catlist mynamespace: -excluPage:"mynamespace:[^:]*(?<!mypage1|mypage2)$">''\\ or, much more simply :\\ ''<catlist mynamespace: -excluPage:{mynamespace:mypage1 mynamespace:mypage2}>''+  * Exclude all page in ''mynamespace'' except ''page1'' and ''page2'' (without excluding these pages in sub-namespaces) :\\ ''%%<catlist mynamespace: -excluPage:"mynamespace:[^:]*(?<!mypage1|mypage2)$">%%''\\ or, much more simply :\\ ''<catlist mynamespace: -excluPage:{mynamespace:mypage1 mynamespace:mypage2}>''
  
 ==== Options ==== ==== Options ====
Line 50: Line 52:
 ^  Display options                    ^^ ^  Display options                    ^^
 |  **[Default]**  ''-displayList''    |  Display with ''<ul>'' and ''<li>''. Render is like on the first screenshot above.  | |  **[Default]**  ''-displayList''    |  Display with ''<ul>'' and ''<li>''. Render is like on the first screenshot above.  |
-|  ''-displayLine''                    Display pages and namespaces into a single line. The content of namespaces are warped with ''['' and '']''. **Warning** there is some display bugs with it.  |+|  ''-displayLine''                    Display pages and namespaces into a single line. The content of namespaces are warped with ''['' and '']''. **Warning** there are some display bugs in it.  |
 |  ''-noNSInBold''                    |  Don't display namespaces and head in bold (with ''<strong>'' | |  ''-noNSInBold''                    |  Don't display namespaces and head in bold (with ''<strong>'' |
 |  ''-columns:[0-∞]''                  Split the list into a certain number of columns. Uses the modern CSS features ''column-count''. **[Default 0]**  |  |  ''-columns:[0-∞]''                  Split the list into a certain number of columns. Uses the modern CSS features ''column-count''. **[Default 0]**  | 
Line 57: Line 59:
 |  ''-noNSHeadTitle''                  Don't use the title of the start pages as namespace displayed name (overwrites the above options).  | |  ''-noNSHeadTitle''                  Don't use the title of the start pages as namespace displayed name (overwrites the above options).  |
 |  ''-hideNotFoundMsg''                Don't show an error message when the namespace is not found  | |  ''-hideNotFoundMsg''                Don't show an error message when the namespace is not found  |
-^  Exclude options (can be used multiple time)                       ^^ +^  Exclude options (can be used multiple time and combined)                       ^^ 
-|  ''-exclude:{page1 ns1: page2 …}''  |  Exclude a list of pages/namespaces based on **full** IDs relative to the listed namespace ('':'' cannot be ignored on namespaces id). //Not implemented yet//+|  ''-exclude:{//page1 ns1(:) ns2:page2 …//}''  |  Exclude a list of pages/namespaces based on **full IDs relative** to the listed namespace. For namespaces, the optional trailing '':'' indicates that the content is excluded, but the namespace itself is shown (same behavior as ''exclunsall'' below).  
-|  ''-exclupage:((!)"//regex//")''        Exclude pages that match with //regex// if provided; otherwise exclude all pages. +|  ''-exclupage((!):%%"%%//regex//%%"%%)''        Exclude pages that match with //regex// if provided; otherwise exclude all pages. 
-|  ''-excluns((!):"//regex//")''          Exclude namespaces that match with //regex// if provided; otherwise exclude all namespaces +|  ''-excluns((!):%%"%%//regex//%%"%%)''          Exclude namespaces that match with //regex// if provided; otherwise exclude all namespaces 
-|  ''-exclunsall((!):"//regex//")''      |  Exclude all content of subnamespaces that match with //regex// if provided; otherwise don't show content of subnamespaces +|  ''-exclunsall((!):%%"%%//regex//%%"%%)''      |  Exclude all content of subnamespaces that match with //regex// if provided; otherwise don't show content of subnamespaces 
-|  ''-exclunspages((!):"//regex//")''    |  Exclude pages of subnamespaces that match with //regex// if provided; otherwise exclude all pages of subnamespaces +|  ''-exclunspages((!):%%"%%//regex//%%"%%)''    |  Exclude pages of subnamespaces that match with //regex// if provided; otherwise exclude all pages of subnamespaces 
-|  ''-exclunsns((!):"//regex//")''        Exclude subnamespaces of subnamespaces that match with //regex// if provided; otherwise exclude all subnamespaces of subnamespaces +|  ''-exclunsns((!):%%"%%//regex//%%"%%)''        Exclude subnamespaces of subnamespaces that match with //regex// if provided; otherwise exclude all subnamespaces of subnamespaces 
-|  If ''!'' is appended before the regex, the regex is **negated**. In other words, pages would be **filtered** based of //regex//, rather than excluded : only pages matching the regex would be included. //Not implemented yet//  || +|  If ''!'' is appended before the regex, the regex is **negated**. In other words, pages would be **filtered/whitelisted** based on //regex// : only pages matching the regex would be included. When multiple exclusion options are used, they combine in a //logical-or// way : one match is enough to exclude.  || 
-|  **Note :** don't add delimiters to //regex//, the delimiter is ''/''  ||+|  **Note :** don't add delimiters to //regex//. The delimiter is implicitly ''/'' ||
 |  **[Default]** ''-excludeOnID''      Exclusion based on **full** page IDs (''namespace:subnamespace:page'' | |  **[Default]** ''-excludeOnID''      Exclusion based on **full** page IDs (''namespace:subnamespace:page'' |
 |  ''-excludeOnName''                  Exclusion based on name, without namespaces (''page'' | |  ''-excludeOnName''                  Exclusion based on name, without namespaces (''page'' |
Line 75: Line 77:
 |  ''-noLinkStartHead''                Don't add link to the start page of listed namespace  | |  ''-noLinkStartHead''                Don't add link to the start page of listed namespace  |
 |  ''-h[1-5]''                        |  Display headline as a title of the specified level **[Default -h1]**  | |  ''-h[1-5]''                        |  Display headline as a title of the specified level **[Default -h1]**  |
-|  ''-titleHead:"//Title//"''          Replace startpage title of listed namespace by specified //Title//  |+|  ''-titleHead:%%"%%//Title//%%"%%''          Replace startpage title of listed namespace by specified //Title//  |
 ^  Namespaces                         ^^ ^  Namespaces                         ^^
 |  ''-nsLinks:''\\ ''none|**auto**|force''  |  Namespace links : disable, automatically detect the start page, or force links even if the start page doesn't exist. ACLs always prevail. **[Default auto]**  | |  ''-nsLinks:''\\ ''none|**auto**|force''  |  Namespace links : disable, automatically detect the start page, or force links even if the start page doesn't exist. ACLs always prevail. **[Default auto]**  |
Line 83: Line 85:
 |  Default : shows an ''Add page...'' button only for listed namespace. If you want ''Add page...'' buttons only for subnamespaces, use both options.  || |  Default : shows an ''Add page...'' button only for listed namespace. If you want ''Add page...'' buttons only for subnamespaces, use both options.  ||
 ^  Sort options                       ^^ ^  Sort options                       ^^
-|  ''-sortAscending''                  Ascending Sort (alphabetically : 1→9→A→Z→a→z)   | +|  ''-sortAscending''                  Ascending sort (alphabetically : 1→9→A→Z→a→z)   | 
-|  ''-sortDescending''                |  Descending Sort  |+|  ''-sortDescending''                |  Descending sort  |
 |  ''-sortByTitle''                    Use page title (not page ID, which is the **default**) for sorting  | |  ''-sortByTitle''                    Use page title (not page ID, which is the **default**) for sorting  |
 +|  ''-sortByModifDate''                Sort by (non-minor) modification date rather than by name  |
 +|  ''-sortByCreationDate''            |  Sort by creation date rather than by name  |
 |  ''-sortByType''                    |  Additionally, put all namespaces at the beginning  | |  ''-sortByType''                    |  Additionally, put all namespaces at the beginning  |
-|  **Note :** no sorting by default, ''-sortAscending'', ''-sortDescending'' or ''default_sort'' must be set before using ''-sortByTitle'' or ''-sortByType''  ||+|  **Note :** there is no sorting by default, ''-sortAscending'', ''-sortDescending'' or ''default_sort'' **must be set** before using ''-sortByTitle''''-sortByType'' or ''-sortByWhateverDate''  ||
 ^  ACL options                       ^^ ^  ACL options                       ^^
-|  ''-ACLshowPage''                    Force showing pages for which the user doesn't have read permission (entry would be shown, but without link). You then may want to enable ''show_leading_ns'' for these pages to effectively show.  |+|  ''-ACLshowPage''                    Force showing pages for which the user doesn't have read permission (entry would be shown, but without link). Not necessary to enable ''show_leading_ns'', but ''-ACLhideNs'' prevails.  |
 |  ''-ACLhideNs''                      Force hiding namespaces for which the user doesn't have read permission (entry is shown by default, but without link). ''show_leading_ns'' prevails.  | |  ''-ACLhideNs''                      Force hiding namespaces for which the user doesn't have read permission (entry is shown by default, but without link). ''show_leading_ns'' prevails.  |
- 
 ==== Global options ==== ==== Global options ====
  
Line 97: Line 100:
  
 |  ''useheading''  |  Default use of page title vs page ID for item display. **Enabled** by default.  | |  ''useheading''  |  Default use of page title vs page ID for item display. **Enabled** by default.  |
-|  ''default_sort''      |  Default sort order. ''none'' (filesystem sorting, by **default**), ''ascending'', ''descending''  |+|  ''default_sort''      |  Default sort order. ''none'' (filesystem order, by **default**), ''ascending'', ''descending''  | 
 +|  ''sort_collator_locale''  |  Locale used to sort page names. When not empty, [[https://www.php.net/manual/en/class.collator.php|PHP Collator class]] is used; should be a valid locale short code, for example ''fr_FR''. When empty, plain alphanumeric sorting is used (default behavior).  |
 |  ''nocache''            Disable the cache on pages where catlist is used  | |  ''nocache''            Disable the cache on pages where catlist is used  |
 |  ''hide_index''        |  Don't show index pages, namely pages which are used as main page (title and link) for a namespace in catlist. **Enabled** by default.  | |  ''hide_index''        |  Don't show index pages, namely pages which are used as main page (title and link) for a namespace in catlist. **Enabled** by default.  |
Line 105: Line 109:
 |  ''show_leading_ns''  |  Show leading namespaces to a page for which a user has ACL read permissions regardless of user ACLs on namespace. **Disabled** by default.  | |  ''show_leading_ns''  |  Show leading namespaces to a page for which a user has ACL read permissions regardless of user ACLs on namespace. **Disabled** by default.  |
 |  ''nswildcards''  |  Replace wildcards such as ''@USER@'' in the namespace string, as for page templates, using the ''parsePageTemplate'' function. For details, refer to [[:namespace_templates#replacement_patterns]]. (:!: Use at your own risk, could be used by malicious users to leak data).  | |  ''nswildcards''  |  Replace wildcards such as ''@USER@'' in the namespace string, as for page templates, using the ''parsePageTemplate'' function. For details, refer to [[:namespace_templates#replacement_patterns]]. (:!: Use at your own risk, could be used by malicious users to leak data).  |
 +|  ''pagename_sanitize''  |  Sanitize the page name of pages created by the ''Add page…'' button. When this is enabled, the feature respects the [[config:deaccent|deaccent]], [[config:userewrite|userewrite]], [[config:useslash|useslash]] and [[config:sepchar|sepchar]] configuration options. **Enabled** by default.  |
  
 To illustrate ''index_priority'' : if DokuWiki internal link would use ''index_priority'', the default value would be ''start,inside,outside''. To illustrate ''index_priority'' : if DokuWiki internal link would use ''index_priority'', the default value would be ''start,inside,outside''.
Line 140: Line 145:
 Source code is available on [[https://github.com/xif-fr/dokuwiki-plugin-catlist/|GitHub]]. Source code is available on [[https://github.com/xif-fr/dokuwiki-plugin-catlist/|GitHub]].
  
 +While this plugin is somewhat maintained, the author does not have much time to dedicate to it and does not use docuwiki presently. I would be happy to transfer the ownership to an actual user.
 ==== Change Log ==== ==== Change Log ====
  
Line 220: Line 226:
     * fixed and improved sorting with ''strnatcasecmp'' (thanks @susnux and @hurzilein)     * fixed and improved sorting with ''strnatcasecmp'' (thanks @susnux and @hurzilein)
     * fixed 'savedir' (thanks @fabienli)     * fixed 'savedir' (thanks @fabienli)
 +  * **2019-10-29**
 +    * added ''-ACLhideNs'' and ''-ACLshowPage'' options
 +    * fixed behavior when both show_pgnoread and show_leading_ns are enabled
 +    * fixed "namespace not found" issue on Windows platform
 +  * **2021-02-04**
 +    * added the "dynamic" namespace option (thanks to @fabienli and @fwolfst)
 +  * **2021-07-21**
 +    * implemented ''-exclude:{}'' option
 +    * implemented negation of regex exclusion options
 +  * **2022-06-25**
 +    * added ''pagename_sanitize'' option
 +    * added sorting by date
 +  * **2022-08-07**
 +    * added Collator sorting
 +    * bug fixing
 +  * **2023-12-16**
 +    * fix bug with the add page button in side bar
  
 ==== Known Issues and Wish List ==== ==== Known Issues and Wish List ====
Line 228: Line 251:
  
   * English   * English
 +  * Chinese (Simplified)
   * French   * French
-  * Chinese (Simplified)+  * German 
 +  * Italian 
 +  * Japanese
   * Russian   * Russian
-  * Japanese 
-  * German 
   * Spanish   * Spanish
-  * Italian 
  
-Help is welcome !+ 
 +[[https://translate.dokuwiki.org/plugin/catlist|Help is welcome!]]
  
 ===== Discussion ===== ===== Discussion =====
  
 **Please send me an e-mail at [[xcodexif@xif.fr]]** **Please send me an e-mail at [[xcodexif@xif.fr]]**
- 
-==== Create a page option ==== 
- 
-If my person has seen right, if using it to create a page it would not consider namespace ''_template'' but create an empty one. Is there a way to avoid it, if using this option? (Not having possibility to email, question raised here)  --- [[user>Samana Johann|Samana Johann]] //2018-08-20 20:08// 
- 
-Is this a documented DokuWiki feature or is it something provided by a plugin ? If it's a DokuWiki feature, please open an issue on the GitHub page or send an email to ask to add this, I can't come here ofter to check your answer. 
---- [[user>xif|xif]] //2018-09-10 00:27// 
->It's a documented (? probably) DokuWiki feature, Mr. Félix Faisant: [[..:namespace_templates]] "When a page is created, DokuWiki looks up whether a template file exists and it shows it within the editor window." If using the add a page opinion, it would not consider possible template-use. (my person pardons the late replay, just came across, not using email and trying to avoid to enter places not invited by the owner may limit Mr. Félix's wish.) --- [[user>Samana Johann|Samana Johann]] //2018-10-15 15:25// 
-==== Various incl. meta ==== 
- 
->Option list, for example ''-excluPage'': The syntax is not easy to see: "(", "{", since sometimes part of syntax, sometimes just an opinion. Trust it's of use and right gotten. --- [[user>Samana Johann|Samana Johann]] //2018-08-16 10:16// 
plugin/catlist.1570354040.txt.gz · Last modified: 2019-10-06 11:27 by xif

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki