DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:bookmark2wiki

bookmark2wiki Plugin

Compatible with DokuWiki

  • 2025-05-14 "Librarian" yes
  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" yes

plugin to bookmark url to a targeted namespace

Provides
Action
Repository
Source

Similar to highlight2wiki

Tagged with bookmark, bookmarklet, weblog

This plugin was created based on the legacy code of post2wiki.

Installation

Examples/Usage

To use the bookmark2wiki plugin:

  • Configure the plugin in Admin > Configuration:
    1. Set `pages`: Enter page IDs (e.g., new_bookmarks, namespace:bookmarks) one per line. These are the selectable target pages for bookmarks.
    2. Set `position`: Choose “After Heading (prepend)” to add bookmarks after the first heading, or “End of Page (append)” to add at the bottom.
  • Install the bookmarklet:
    1. Copy the JavaScript below, replacing https://myserver/doku.php with your DokuWiki URL.
    2. Add it to your browser's bookmarks bar.

Bookmarklet:

 javascript:(function(){Q=document.selection?document.selection.createRange().text:document.getSelection();void(window.open('https://myserver/doku.php?do=bookmark2wiki&te='+encodeURIComponent(Q)+'&ur='+encodeURIComponent(location.href)+'&ti='+encodeURIComponent(document.title),'dokuwikiadd','scrollbars=yes,resizable=yes,toolbar=no,width=400,height=200,left=200,top=200,status=yes'));})();

3. On a webpage:

  1. Optionally highlight text.
  2. Click the bookmarklet.
  3. Select a page from the dropdown and submit.
  4. The bookmark is added as:
  * [[URL|Title]] \\ HighlightedText -- YYYY:MM:DD:HH:MM:SS 

Syntax

This is an action plugin triggered by `?do=bookmark2wiki` (via bookmarklet). No wiki syntax is required; it appends content directly to the target page.

Configuration and Settings

  1. pages: Multiline field for target page IDs (e.g., `new_bookmarks`). Default: `new_bookmarks`.
  2. position: Dropdown to choose insertion point:
    1. “After Heading (prepend)”: Inserts after the first heading, skipping empty lines.
    2. “End of Page (append)”: Adds at the bottom, with a newline if needed.
  3. Default targeted namespace is `new_bookmarks`, but configurable via the `pages` setting.

Development

Change Log

  1. v1.0: Initial release with basic bookmark appending.
  2. v1.1: skipped
  3. v1.2: Added configurable pages and position (prepend/append).

Known Bugs and Issues

  1. Limited input validation; potential for unsanitized content (planned fix in next version).
  2. Assumes first line is the heading for prepend; may not handle pages without headings gracefully.

ToDo/Wish List

  1. Add rate limiting to prevent spam.
  2. Support for custom bookmark formats via config.
  3. Configuration page / admin page for changing targeted namespace (already implemented via standard Configuration Manager).
  4. Close this page from everyone edition (use DokuWiki ACLs for permissions).

FAQ

Discussion

plugin/bookmark2wiki.txt · Last modified: by dodotori

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki