This bookmarklet takes the URL and title of the current page in your web-browser, plus any selected text on that page and sends it to DokuWiki to make a new wiki-page about it, using the current date/time as page-name.
2011/Dec/20: hatred has jumped aboard and updated the plugin to be compatible with latest dokuwiki. The plugin now uses the standard edit-form and the previously included tagentry plugin is now standalone.
To install the bookmarklet: drag this link to your bookmarks and edit the hostname afterwards.
The browser opens a popup-window connecting to DokuWiki..
Notes: Presets come in handy to quickly change the namespace or apply templates.
Direct-saving needs to be enabled in the configuration, it is identical to DokuWiki save (it even checks sectok) yet it is intended to close the popup-window after a successful save and redirect to edit/preview/draft-merge if some concurrency or permission error occurs.
see the DokuWiki built-in help in the configuration panel:
Placeholders (replaced in wiki-page-name and wiki-page-template:
@T@- title of the bookmarked page (as shown in browser title bar)
@U@- the URL of the page to bookmark
@D@- timestamp, now
@S@- text that was selected.
@F@- foo - the user who is making the change or 'anonymous'
@N@- title/page-name. Same as
@Sif it is a single word, otherwise
@T@. In both cases the value is stripped of non-alphanumerical characters and space is replaced with underscore.
If a _template.txt exists in the namespace of the page, the default DokuWiki placeholders (
@PAGE@, etc ) are also available for those wiki-pages.
Add a new bookmark in your browser with the text below. Edit it to match the hostname and protocol to match your DokuWiki server.
This bookmarklet will work with methods (2), (3) and (4) mentioned below.
There are a few options to semi-automatically interact with DokuWiki using a Bookmarklet.
Calling the bookmark could do either of
Each of those variants has it's merits.
All the examples here are based on Dokuwiki-Weblog, which implements method (4) and thus offers no possibility of authentication (unless provided by a 3rd party)
see bookmarklet for a method that does not require additional PHP code. it's a rather lengthy bookmarklet to directly http-post (1). - The DokuWiki hostname, namespace and wiki-template are all hardcoded in the bookmarklet.
(3) is an interesting solution because it is very flexible: interact with a bookmark-properties webpage which submits to DokuWiki (either as “fire and forget” save or followed by preview/edit) using the standard DokuWiki authentication mechanism.