xref: /plugin/prioritylist/README.md (revision 11c78ec4ad67770bbc5cf22df8dc8bf9d6cac349)
1*11c78ec4SZpartakov# DokuWiki Plugin: Priority List
2*11c78ec4SZpartakov**Priority List** is a custom DokuWiki plugin that automatically generates a reverse-chronological list (newest first) of pages whose titles start with one, two, or three plus signs : `+`, `++`, `+++`
32c12652dSZpartakov
4*11c78ec4SZpartakovIt is particularly useful for highlighting priority blog posts, important announcements, or "featured" articles without having to maintain a manual list.
52c12652dSZpartakov
6*11c78ec4SZpartakov## Features
72c12652dSZpartakov
8*11c78ec4SZpartakov- **Automatic Detection**: Recursively scans a namespace (and all its subdirectories) to find pages whose H1 title (`======`) starts with `+`, `++`, or `+++`.
9*11c78ec4SZpartakov- **Smart Sorting**: Displays results by last modification date, from newest to oldest.
10*11c78ec4SZpartakov- **Tag Support**: Automatically detects and displays tags associated with each page (using `{{tag>...}}` syntax).
11*11c78ec4SZpartakov- **Universal Compatibility**: Works regardless of your DokuWiki `savedir` configuration (custom data directory names are supported).
12*11c78ec4SZpartakov- **Customizable**: Allows you to define the target namespace and limit the number of results.
132c12652dSZpartakov
142c12652dSZpartakov## Installation
15*11c78ec4SZpartakov
16*11c78ec4SZpartakov1. Download this plugin or copy the `prioritylist` folder into the `lib/plugins/` directory of your DokuWiki installation.
17*11c78ec4SZpartakov   ```bash
18*11c78ec4SZpartakov   mkdir -p lib/plugins/prioritylist
19*11c78ec4SZpartakov   # Copy the syntax.php file into this folder
20*11c78ec4SZpartakov
21*11c78ec4SZpartakov    Ensure the folder permissions allow read access by the web server.
22*11c78ec4SZpartakov    No additional registration is required; the plugin is detected automatically.
23*11c78ec4SZpartakov    Important: Clear the DokuWiki cache after installation via the URL doku.php?id=admin:rebuild_cache or by adding ?purge=true to any page URL.
242c12652dSZpartakov
252c12652dSZpartakov## Usage
262c12652dSZpartakov
27*11c78ec4SZpartakovInsert the following syntax into any wiki page to display the list:
28*11c78ec4SZpartakovBasic Usage
292c12652dSZpartakov
30*11c78ec4SZpartakovDisplays priority posts from the default namespace (billets):
312c12652dSZpartakov
32*11c78ec4SZpartakov    <prioritylist />
332c12652dSZpartakov
34*11c78ec4SZpartakovSpecify a Namespace
352c12652dSZpartakov
36*11c78ec4SZpartakovTo target a different folder (e.g., my:custom:namespace):
372c12652dSZpartakov
38*11c78ec4SZpartakov
39*11c78ec4SZpartakov    <prioritylist ns=my:custom:namespace />
40*11c78ec4SZpartakov
41*11c78ec4SZpartakov### Limit Results
42*11c78ec4SZpartakov
43*11c78ec4SZpartakovTo display only the 10 most recent priority posts:
44*11c78ec4SZpartakov
45*11c78ec4SZpartakov    <prioritylist ns=billets limit=10 />
46*11c78ec4SZpartakov
47*11c78ec4SZpartakov### Required Page Format
48*11c78ec4SZpartakov
49*11c78ec4SZpartakovFor a page to appear in the list, it must meet two conditions:
50*11c78ec4SZpartakov
51*11c78ec4SZpartakovThe Title: The first level-1 heading must start with at least one + sign.
52*11c78ec4SZpartakov
53*11c78ec4SZpartakov    dokuwiki
54*11c78ec4SZpartakov    ====== + My Important Post ======
55*11c78ec4SZpartakov
56*11c78ec4SZpartakov    or
57*11c78ec4SZpartakov
58*11c78ec4SZpartakov    dokuwiki
59*11c78ec4SZpartakov    ====== ++ Major Announcement ======
60*11c78ec4SZpartakov
61*11c78ec4SZpartakovTags (Optional): If you use standard DokuWiki tag syntax, they will be automatically extracted and displayed next to the title.
62*11c78ec4SZpartakov
63*11c78ec4SZpartakov    {{tag>thriller reviews important}}
64*11c78ec4SZpartakov
65*11c78ec4SZpartakovExample Output:
66*11c78ec4SZpartakov
67*11c78ec4SZpartakov    + Alberto Vignati, Hedonia (thriller; reviews)
68*11c78ec4SZpartakov
69*11c78ec4SZpartakov## File Structure
70*11c78ec4SZpartakov
71*11c78ec4SZpartakov
72*11c78ec4SZpartakovprioritylist/
73*11c78ec4SZpartakov├── syntax.php      # Plugin core (scanning logic, sorting, and rendering)
74*11c78ec4SZpartakov└── README.md       # This file
75*11c78ec4SZpartakov
76*11c78ec4SZpartakov## Technical Notes
77*11c78ec4SZpartakov
78*11c78ec4SZpartakov- Performance: The plugin reads only the beginning of files (approx. 8 KB) to extract the title and tags, making the scan fast even on large document bases.
79*11c78ec4SZpartakov- Fallback Mechanism: If the native DokuWiki API fails to list pages (in rare complex configurations), the plugin uses a manual recursive scanner to ensure no pages are missed.
80*11c78ec4SZpartakov    Compatibility: Tested on DokuWiki "Hogfather" and newer versions.
81*11c78ec4SZpartakov
82*11c78ec4SZpartakov## Author & Support
83*11c78ec4SZpartakov
84*11c78ec4SZpartakovThis plugin was custom-developed for the Radeff.red blog.
85*11c78ec4SZpartakov
86*11c78ec4SZpartakovAuthor: Frédéric Radeff
87*11c78ec4SZpartakov
88*11c78ec4SZpartakovEmail: fradeff@akademia.ch
89*11c78ec4SZpartakov
90*11c78ec4SZpartakovWebsite: https://radeff.red/blog/
912c12652dSZpartakov
922c12652dSZpartakov## License
932c12652dSZpartakov
94*11c78ec4SZpartakovThis plugin is provided "as is" for personal or internal use. You are free to modify and redistribute it according to your needs.
95*11c78ec4SZpartakov
96