143d2073cStracker-user# Annotations Plugin for DokuWiki 243d2073cStracker-user 38d8701f5Stracker-userWord- and sentence-level annotations on wiki pages, stored separately from the page text with threaded replies. Inspired by [Hypothes.is](https://hypothes.is/) and [ep_comments_page](https://github.com/ether/ep_comments_page). 443d2073cStracker-user 543d2073cStracker-user## Features 643d2073cStracker-user 78d8701f5Stracker-user- **Text-quote anchoring** — select any word or sentence; the annotation is tied to the quoted text plus its surrounding context, so it survives minor edits to the page. 8ee9dbf15Stracker-user- **Threaded replies** — any logged-in reader can reply to an annotation, or reply to another reply for a nested discussion. 98d8701f5Stracker-user- **Open / Resolved status** — mark a discussion closed; resolved annotations turn green. 1043d2073cStracker-user- **Gutter markers** — small icons in the left margin show at a glance where annotations live. 118d8701f5Stracker-user- **Orphan detection** — when the annotated text is removed from the page, the annotation is flagged as orphaned and stays reachable via the counter. Admins can bulk-delete orphans. 128d8701f5Stracker-user- **Per-user toggle** — turn the annotation overlay on or off from your user preferences. 138d8701f5Stracker-user- **No page revisions** — annotations live in a separate file per page; the wiki changelog is never touched. 14da56206cStracker-user- **Localised interface** — English, German, Russian and Japanese, falling back to English for any untranslated string. 1543d2073cStracker-user 1643d2073cStracker-user## Requirements 1743d2073cStracker-user 188d8701f5Stracker-user- DokuWiki Librarian 2025-05-14b (or a compatible release) 198d8701f5Stracker-user- PHP 8.0 or later with the `mbstring` extension 208d8701f5Stracker-user- [usersettings plugin](https://github.com/tracker-user/dokuwiki-usersettings) *(optional — adds the per-user on/off toggle)* 218d8701f5Stracker-user 228d8701f5Stracker-userWorks in current browsers and as far back as Firefox 78 ESR. 2343d2073cStracker-user 2443d2073cStracker-user## Installation 2543d2073cStracker-user 2643d2073cStracker-user1. Copy the `annotations/` directory into `{DokuWiki}/lib/plugins/`. 2743d2073cStracker-user2. If you want the per-user toggle, install the usersettings plugin too. 28*86c7806dStracker-user3. The defaults work out of the box; tune them in the Configuration Manager if you like (see below). 29*86c7806dStracker-user 30*86c7806dStracker-user## Configuration 31*86c7806dStracker-user 32*86c7806dStracker-userAll settings live under **Admin → Configuration Settings → annotations**: 33*86c7806dStracker-user 34*86c7806dStracker-user| Setting | Default | What it does | 35*86c7806dStracker-user|---------|---------|--------------| 36*86c7806dStracker-user| `color_open` | `#f59e0b` | Highlight colour for open (unresolved) annotations. One hex value; lighter fills, gutter markers and status-pill tints are derived from it automatically. | 37*86c7806dStracker-user| `color_resolved` | `#4ade80` | Highlight colour for resolved annotations. | 38*86c7806dStracker-user| `embed_max_bytes` | `131072` | Largest annotation list (bytes) shipped inline with the page. Bigger lists load via a separate AJAX request instead, keeping every page view lean. | 39*86c7806dStracker-user| `context_length` | `64` | Characters of surrounding text stored on each side of a quote, used to re-locate it after edits and to disambiguate repeated quotes. `0` disables context. | 40*86c7806dStracker-user| `body_cap` | `10000` | Maximum length (characters) of an annotation or reply body; longer input is truncated. | 4143d2073cStracker-user 4243d2073cStracker-user## Usage 4343d2073cStracker-user 4443d2073cStracker-user### Reading annotations 4543d2073cStracker-user 4643d2073cStracker-userAnnotated text is highlighted in **amber** (open) or **green** (resolved). Click any highlight to open the thread panel inline below that paragraph. 4743d2073cStracker-user 488d8701f5Stracker-userThe counter bar above the page content shows how many annotations the page has. If some are orphaned (their text was deleted), a clickable "N orphaned" link opens a drawer at the bottom of the page with those threads. 4943d2073cStracker-user 5043d2073cStracker-user### Creating an annotation 5143d2073cStracker-user 5243d2073cStracker-user1. Select any text on the page. 5343d2073cStracker-user2. Click the **Annotate** button that appears. 5443d2073cStracker-user3. Type your comment and click **Annotate** to save. 5543d2073cStracker-user 568d8701f5Stracker-user> You only need to be logged in and able to *read* the page — edit access is **not** required. If you can read a page, you can annotate it. 5743d2073cStracker-user 58*86c7806dStracker-userThe **Annotate** button only appears over real page prose. Selecting inside the table of contents, the page-info line, section-edit buttons, or the annotation panels does nothing. If your selection touches an existing annotation — even by a single character — that annotation opens instead of starting a new, overlapping one. 59*86c7806dStracker-user 6043d2073cStracker-user### Replying 6143d2073cStracker-user 62ee9dbf15Stracker-userOpen the thread panel for any annotation and use the **Reply** field at the bottom. Each individual reply also has its own **Reply** button, so conversations can nest. Any logged-in reader can reply. 6343d2073cStracker-user 648d8701f5Stracker-user### Resolving / reopening 6543d2073cStracker-user 668d8701f5Stracker-userClick **Resolve** on an annotation to mark its discussion closed, or **Reopen** to undo that. Any logged-in reader can resolve or reopen. 6743d2073cStracker-user 6843d2073cStracker-user### Editing and deleting 6943d2073cStracker-user 708d8701f5Stracker-user- You can edit or delete your own annotations and replies. 718d8701f5Stracker-user- Admins can edit or delete anyone's. 7243d2073cStracker-user 7343d2073cStracker-user### Admin: bulk operations 7443d2073cStracker-user 7543d2073cStracker-userAdmins see two extra buttons in the counter bar: 7643d2073cStracker-user 7743d2073cStracker-user| Button | Effect | 7843d2073cStracker-user|--------|--------| 7943d2073cStracker-user| **Clear resolved** | Permanently deletes all resolved annotations on the page | 808d8701f5Stracker-user| **Clear orphaned** | Re-checks the page, then permanently deletes the orphaned annotations | 8143d2073cStracker-user 828d8701f5Stracker-user### Turning the overlay off 8343d2073cStracker-user 848d8701f5Stracker-userIn **User Preferences** (provided by the usersettings plugin), uncheck **Enable annotations**. The overlay is then hidden for you; your annotations are still stored and remain visible to everyone else. 8543d2073cStracker-user 8643d2073cStracker-user## License 8743d2073cStracker-user 8843d2073cStracker-userGPL 2, matching DokuWiki. 898d8701f5Stracker-user 908d8701f5Stracker-user--- 918d8701f5Stracker-user 928d8701f5Stracker-user**Developers & AI agents:** see **[DESIGN.md](DESIGN.md)** for the full technical reference — architecture, the text-quote anchoring algorithm, the JSON storage format, the JSINFO-injection mechanism, the permission model, the AJAX API, browser/PHP constraints, and known gaps. 93