Name Date Size #Lines LOC

..--

conf/H27-Sep-2025-66

LICENSEH A D27-Sep-202517.7 KiB340281

READMEH A D27-Sep-2025979 2819

README.mdH A D27-Sep-20254.3 KiB8159

action.phpH A D27-Sep-20256.9 KiB176108

manager.datH A D27-Sep-2025116 32

plugin.info.txtH A D27-Sep-2025226 87

README

1dokudrawingboard plugin for DokuWiki
2
3to create a a drawingboard by using drawingboard.js library
4
5All documentation for this plugin can be found at
6https://github.com/edwardcodelab/dokudrawingboard
7
8If you install this plugin manually, make sure it is installed in
9lib/plugins/dokudrawingboard/ - if the folder is called different it
10will not work!
11
12Please refer to http://www.dokuwiki.org/extensions for additional info
13on how to install extensions in DokuWiki.
14
15----
16Copyright (C) dodotori <dodotori@localhost>
17
18This program is free software; you can redistribute it and/or modify
19it under the terms of the GNU General Public License as published by
20the Free Software Foundation; version 2 of the License
21
22This program is distributed in the hope that it will be useful,
23but WITHOUT ANY WARRANTY; without even the implied warranty of
24MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25GNU General Public License for more details.
26
27See the LICENSING file for details
28

README.md

1
2# bookmark2wiki
3
4A DokuWiki plugin to save bookmarks from your browser to configurable wiki pages using a bookmarklet. Forked from `post2wiki.php` by riny [at] bk [dot] ru.
5
6## Overview
7
8This plugin allows users to bookmark webpages by sending the URL, title, and optionally highlighted text to a specified DokuWiki page. The bookmark can be added either after the first heading (prepend) or at the end of the page (append), as configured in DokuWiki's Admin > Configuration. The plugin uses DokuWiki's standard functions (`rawWiki` and `saveWikiText`) to append content without direct file system access, ensuring compatibility with DokuWiki's security model.
9
10- **Version**: 1.0
11- **License**: GPL 2 (http://www.gnu.org/licenses/gpl.html)
12- **Author**: edwardcodelab (https://github.com/edwardcodelab)
13- **Todo**: Enhance input validation for security (e.g., stricter sanitization of URL, title, and text).
14
15## Features
16
17- Save bookmarks to user-defined wiki pages via a dropdown selection in a popup.
18- Configurable insertion point: after the first heading (prepend) or at the end of the page (append).
19- Supports highlighted text from the webpage, appended as part of the bookmark entry.
20- Uses DokuWiki's permission system to ensure only authorized users can edit pages.
21- Simple bookmarklet for easy browser integration.
22
23## Installation
24
251. Clone or download the repository to your DokuWiki plugin directory:
26   ```
27   /lib/plugins/bookmark2wiki/
28   ```
29   Ensure the directory contains:
30   - `action.php`
31   - `conf/default.php`
32   - `conf/metadata.php`
33   - `plugin.info.txt`
34
352. Clear DokuWiki's cache if needed
36
373. Configure the plugin:
38   - In **Admin > Configuration**, find the `bookmark2wiki` settings.
39   - Set `pages`: Enter page IDs (e.g., `new_bookmarks`, `namespace:bookmarks`) one per line.
40   - Set `position`: Choose "After Heading (prepend)" or "End of Page (append)" from the dropdown.
41
424. Create the bookmarklet:
43   - Copy the JavaScript below, replacing `https://myserver/doku.php` with your DokuWiki base URL.
44   - Drag the bookmarklet to your browser's toolbar or add it manually.
45
46   **Bookmarklet**:
47   ```javascript
48   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'));})();
49   ```
50
51## Usage
52
531. Navigate to a webpage you want to bookmark.
542. Optionally, highlight text on the page to include in the bookmark.
553. Click the bookmarklet in your browser toolbar.
564. In the popup, select a target page from the dropdown (configured in Admin > Configuration).
575. Click "Save" to add the bookmark.
58   - If set to "After Heading (prepend)", the bookmark appears after the first heading (e.g., `====== New Articles ======`) in the page.
59   - If set to "End of Page (append)", the bookmark is added at the page's end.
606. The popup confirms the save and closes automatically after 3 seconds.
61
62**Bookmark Format**:
63```
64  * [[URL|Title]] \\ HighlightedText -- YYYY:MM:DD:HH:MM:SS
65```
66
67## Notes
68
69- **Security**: The plugin includes basic input sanitization (e.g., URL validation, HTML escaping). Further security enhancements are planned (e.g., rate limiting, stricter input checks).
70- **Permissions**: Users must be logged into DokuWiki with edit permissions for the target page. The plugin checks this using `auth_quickaclcheck`.
71- **Configuration**: Ensure pages listed in the `pages` setting exist or are editable, and verify the `position` setting in Admin > Configuration.
72- **Debugging**: If issues occur, check `conf/local.php` for correct `position` value (`'top'` or `'bottom'`) and clear cache after changes.
73
74## Troubleshooting
75
76- **Bookmarklet fails**: Ensure the URL in the bookmarklet matches your DokuWiki installation (e.g., `https://myserver/doku.php`).
77- **Wrong insertion point**: Verify the `position` setting in Admin > Configuration is set to "After Heading (prepend)" for top insertion.
78- **No pages in dropdown**: Check that `pages` in Admin > Configuration contains valid page IDs (e.g., `new_bookmarks`).
79- **Contact**: Report issues at https://github.com/edwardcodelab/bookmark2wiki.
80
81