Compatible with DokuWiki
This plugin lists pages and namespaces recursively as a multilevelled list. You can exclude pages, namespaces and their elements with regex. There are multiple options to personalize headlines and links. Elements can be sorted and put in columns. New pages can be quickly created in a given namespace with Add page...
buttons.
Example page here.
<catlist namespace: -option1 -option2...>
Here, namespace:
represents the full path to the namespace. The trailing colon is optional.
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.
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
<catlist %%CURRENT_NAMESPACE%%>
Here are some examples about exclusion :
<catlist -exclupage>
dirty_page
relative to current namespace :<catlist -excludeOnName -exclupage:"^dirty_page$">
<catlist -exclupage:"dirty_page">
.:foo_namespace:
, except pages whose name begins with a number :<catlist .:foo_namespace -excluPage:“^foo_namespace:[0-9]”>
<catlist .:foo_namespace -excludeOnName -excluPage:"^[0-9]">
mynamespace
except page1
and page2
(without excluding these pages in sub-namespaces) :<catlist mynamespace: -excluPage:"mynamespace:[^:]*(?<!mypage1|mypage2)$">
<catlist mynamespace: -excluPage:{mynamespace:mypage1 mynamespace:mypage2}>
Legend: [needed]
, (optional)
Display options | |
---|---|
[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 are some display bugs in it. |
-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] |
-noHeadTitle | Don't use the title (first heading) of pages as displayed name (overwrites global option useheading ). |
-forceHeadTitle | Force the use of the page title as displayed name (overwrites useheading ). |
-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 |
Exclude options (can be used multiple time and combined) | |
-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. |
-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 |
-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 |
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 implicitly / . |
|
[Default] -excludeOnID | Exclusion based on full page IDs (namespace:subnamespace:page ) |
-excludeOnName | Exclusion based on name, without namespaces (page ) |
-excludeOnTitle | Exclusion based on the first title of the page (The Page ) |
-maxDepth:depth | Don't recurse deeper than depth |
Headline | |
-noHead | Don't display headline |
-smallHead | Display headline as a simple <span> , not as a title <h_> |
-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] |
-titleHead:"Title" | Replace startpage title of listed namespace by specified Title |
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] |
Create page buttons options (takes into account user rights) | |
-noAddPageButton | Don't display Add page… button for listed namespace |
-addPageButtonEach | Display Add page… button for each namespace |
Default : shows an Add page… button only for listed namespace. If you want Add page… buttons only for subnamespaces, use both options. |
|
Sort options | |
-sortAscending | Ascending sort (alphabetically : 1→9→A→Z→a→z) |
-sortDescending | Descending sort |
-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 |
Note : there is no sorting by default, -sortAscending , -sortDescending or default_sort must be set before using -sortByTitle , -sortByType or -sortByWhateverDate |
|
ACL options | |
-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. |
These options can be found in the DokuWiki configuration manager.
useheading | Default use of page title vs page ID for item display. Enabled by default. |
default_sort | Default sort order. none (filesystem order, by default), ascending , descending |
sort_collator_locale | Locale used to sort page names. When not empty, 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 |
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. |
index_priority | Priority order of pages used as index pages. Combination of start , inside and outside . [Default start,outside ]Example with the namespace foo:bar: :start ≡ foo:bar:<start> outside ≡ foo:bar inside ≡ foo:bar:bar |
hide_acl_nsnotr | Hide namespaces for which the user doesn't have ACL Read permission. Disabled by default (entry is shown, but no link). Global version of -ACLhideNs . show_leading_ns prevails. |
show_acl | Ignore ACLs (show everything, regardless of the user) and show user permissions for each item. Intended for fixing permission issues. |
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 replacement_patterns. ( |
pagename_sanitize | Sanitize the page name of pages created by the Add page… button. When this is enabled, the feature respects the deaccent, userewrite, useslash and 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
.
It is recommended to use the nocache
global option or to add the NOCACHE
directive if Add page…
buttons are used, in order to force rescan of the namespace after creating a page.
Decision made when showing a namespace base on permissions and options :
You can stylize the columns of the -columns:
option by a small CSS code :
<html><style> .catlist_columns { -webkit-column-rule: 1px solid #BBB; -moz-column-rule: 1px solid #BBB; column-rule: 1px solid #BBB; } </style></html>
Here are the CSS classes you can use to modify the appearance :
catlist-head
: the strong
or span
of the headlinecatlist-nshead
: the strong
or span
of namespace headscatlist-nslist
: ul
of namespace sub-listscatlist-ns
: li
that warp namespace sub-listscatlist-page
: li
that warp page linkscatlist_addpage
: li
that warp Add page…
buttonsSearch and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually. Alternatively, install from http://dev.xif.fr:7979/catlist/.
Source code is available on 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.
-noLinkStartHead
now works.txt
-maxDepth
option-noNSHeadTitle
-nsLinks
option and deprecated -forceLinks
.index_priority
and hide_index
global options<catlist :>
)maxDepth
nocache
option addedhide_acl_nsnotr
optionshow_acl
optionuserewrite=2
fnencode
(thanks to @shioyadan)userewrite=2
useheading
/noHeadTitle
/forceHeadTitle
noNSHeadTitle
⇒ nsLinks=none
show_leading_ns
option (thanks to @kevans91)showhead
global option (thanks to @FosseWay)nswildcards
global optionhideNotFoundMsg
optiondeaccent
is enabled when using the Add page…
button; romanization still not supported (thanks to @shioyadan & @hrko99)strnatcasecmp
(thanks @susnux and @hurzilein)-ACLhideNs
and -ACLshowPage
options-exclude:{}
optionpagename_sanitize
optionRefer to the GitHub issue tracker.
Please send me an e-mail at xcodexif [at] xif [dot] fr