plugin:bookmark2wiki
Table of Contents
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
Similar to highlight2wiki
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:
- Set `pages`: Enter page IDs (e.g., new_bookmarks, namespace:bookmarks) one per line. These are the selectable target pages for bookmarks.
- 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:
- Copy the JavaScript below, replacing https://myserver/doku.php with your DokuWiki URL.
- 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:
- Optionally highlight text.
- Click the bookmarklet.
- Select a page from the dropdown and submit.
- 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
- pages: Multiline field for target page IDs (e.g., `new_bookmarks`). Default: `new_bookmarks`.
- position: Dropdown to choose insertion point:
- “After Heading (prepend)”: Inserts after the first heading, skipping empty lines.
- “End of Page (append)”: Adds at the bottom, with a newline if needed.
- Default targeted namespace is `new_bookmarks`, but configurable via the `pages` setting.
Development
Change Log
- v1.0: Initial release with basic bookmark appending.
- v1.1: skipped
- v1.2: Added configurable pages and position (prepend/append).
Known Bugs and Issues
- Limited input validation; potential for unsanitized content (planned fix in next version).
- Assumes first line is the heading for prepend; may not handle pages without headings gracefully.
ToDo/Wish List
- Add rate limiting to prevent spam.
- Support for custom bookmark formats via config.
- Configuration page / admin page for changing targeted namespace (already implemented via standard Configuration Manager).
- Close this page from everyone edition (use DokuWiki ACLs for permissions).
FAQ
Discussion
plugin/bookmark2wiki.txt · Last modified: by dodotori

