xref: /plugin/bureaucracytoolbar/README.md (revision e1e734d34b2cd522b0552b828ff3eff868b5c890)
1### Bureaucracy Toolbar Plugin for DokuWiki
2
3The Bureaucracy Toolbar plugin enhances DokuWiki's [Bureaucracy plugin](https://www.dokuwiki.org/plugin:bureaucracy) by adding a simple toolbar above forms, allowing users to easily insert common Dokuwiki syntax (e.g., bold, italic, links) into textarea fields. This is particularly useful for forms with rich text inputs, such as those for creating pages, emails, or structured content.
4
5#### Features
6- **Buttons for Common Syntax**: Includes buttons for:
7  - **Bold** (`**text**`)
8  - *Italic* (`//text//`)
9  - __Underline__ (`__text__`)
10  - `Code` (`<code>text</code>`)
11  - List Item (` * text`)
12  - Link (`[[text]]`)
13- **Smart Textarea Targeting**: When a button is clicked, the syntax is inserted into the currently focused textarea (or the last focused one) in the bureaucracy form. This supports forms with multiple textareas without always defaulting to the first.
14- **Selection Handling**: If text is selected in the textarea, the syntax wraps around it. The cursor is then repositioned inside the inserted markup for easy editing.
15- **Styling**: The toolbar has basic CSS for a clean, modern look (light gray background, rounded corners).
16
17#### Installation
181. Download the plugin files (`syntax.php` and `script.js`).
192. Place them in your DokuWiki's plugin directory: `lib/plugins/bureaucracytoolbar/`.
203. Ensure the Bureaucracy plugin is already installed and enabled, as this toolbar depends on it.
214. Refresh your DokuWiki plugin manager to activate it.
22
23#### Usage
24To add the toolbar to a page with a bureaucracy form:
25- Insert the syntax `<bureaucracytoolbar>` anywhere on the page (typically above the form definition for better placement).
26