# DokuWiki Plugin: Priority List
**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 : `+`, `++`, `+++`

It is particularly useful for highlighting priority blog posts, important announcements, or "featured" articles without having to maintain a manual list.

## Features

- **Automatic Detection**: Recursively scans a namespace (and all its subdirectories) to find pages whose H1 title (`======`) starts with `+`, `++`, or `+++`.
- **Smart Sorting**: Displays results by last modification date, from newest to oldest.
- **Tag Support**: Automatically detects and displays tags associated with each page (using `{{tag>...}}` syntax).
- **Universal Compatibility**: Works regardless of your DokuWiki `savedir` configuration (custom data directory names are supported).
- **Customizable**: Allows you to define the target namespace and limit the number of results.

## Installation

1. Download this plugin or copy the `prioritylist` folder into the `lib/plugins/` directory of your DokuWiki installation.
   ```bash
   mkdir -p lib/plugins/prioritylist
   # Copy the syntax.php file into this folder

    Ensure the folder permissions allow read access by the web server.
    No additional registration is required; the plugin is detected automatically.
    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.

## Usage

Insert the following syntax into any wiki page to display the list:
Basic Usage

Displays priority posts from the default namespace (billets):

    <prioritylist />

Specify a Namespace

To target a different folder (e.g., my:custom:namespace):


    <prioritylist ns=my:custom:namespace />

### Limit Results

To display only the 10 most recent priority posts:

    <prioritylist ns=billets limit=10 />

### Required Page Format

For a page to appear in the list, it must meet two conditions:

The Title: The first level-1 heading must start with at least one + sign.

    dokuwiki
    ====== + My Important Post ======

    or

    dokuwiki
    ====== ++ Major Announcement ======

Tags (Optional): If you use standard DokuWiki tag syntax, they will be automatically extracted and displayed next to the title.

    {{tag>thriller reviews important}}

Example Output:

    + Alberto Vignati, Hedonia (thriller; reviews)

## File Structure


prioritylist/
├── syntax.php      # Plugin core (scanning logic, sorting, and rendering)
└── README.md       # This file

## Technical Notes

- 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.
- 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.
    Compatibility: Tested on DokuWiki "Hogfather" and newer versions.

## Author & Support

This plugin was custom-developed for the Radeff.red blog.

Author: Frédéric Radeff

Email: fradeff@akademia.ch

Website: https://radeff.red/blog/

## License

This plugin is provided "as is" for personal or internal use. You are free to modify and redistribute it according to your needs.

