note plugin by Olivier Cortes
This plugin allows you to create nice «notes» like this in your DokuWiki pages.
Last updated on 2008-02-17. Provides Syntax.
No compatibility info given!
Similar to boxes, boxes_mod, side_note, tip, userannotations.
⇒ lisez la version française
2008-02-17: Thanks to Aurélien Bompard, this plugin supports ODT export now. Your notes will be beautifully included in the exported ODT document.
2006-03-29: Thanks to Eric Hameleers and Christopher Smith (2006-03-24) for their great work (now merged into the plugin). Changelog :
<code> & <file>) not being allowed within notes,As of 2006-03-23, the plugin works with DokuWiki 2006-03-09. The documentation on this page has been updated to work for DokuWiki Release 2006-03-09, and revamped to be cleaner.
Download the latest version, as a .tar.gz (14Kib) or a .zip (15Kib) on my website and just untar/unzip it in lib/plugins. It is also reported to work with plug-in manager (thanks to Kenneth Udut, DGM2).
Make sure you have ‘Allow embedded HTML’ turned on in your config or this will not work.
The plugin is self contained and should work “out of the box” (without any CSS alteration, thanks to Eric Hameleers).
If after using the <note> </note> tag, it doesn't work.
Open note/syntax.php and change lines 113 and 121. (fixed in 2008-02-17 version)
When you have it installed, use this :
<note> This is my note ! Remember it !! </note>
<note important>
Warning ! You're about to lose your mind
</note>
<note tip> The clues are in the images. </note>
<note warning> Beware of the dog when you open the door !! </note>
You can use the note keywords important, warning and tip. It is quite easy to add new types of notes if you know a bit of PHP and CSS.
Many thanks to the DokuWiki developers !!! I really enjoy using and hacking this wiki, since 2005-07. I love Doku :) Thanks to Stephane Chamberland and Carl-Christian Salvesen for their respective Side Notes and Graphviz plugins, i used them as great inspiration. Thanks to (in any order) :
For their interest in this plugin, their remarks, suggestions or patches.
Feel free to mail me if you encounter problems or need help. And don't hesitate to do it, as i don't browse the present page everyday…
ed
I deleted all users comments because they addressed old issues that are not present anymore in the last version of the plugin. You can still see them if you browse the «Old revisions» of this page.
Olivier,
I don't think you should have a single entry pattern <note.*?>. I used two entry patterns as when specifying a note style, the style should be preceded by a space. So the two potential patterns are mutually exclusive - and since Dokuwiki parser doesn't allow or in patterns, two patterns are required.
> is placed on a subsequent line.
Your single pattern will match <notes>, <notepaper>, <notethiscouldbeanything>, which I would think is not desirable.
— Christopher Smith 2006-03-30 02:10
I agree with this hint, but if would not match <note> because of the leading \s+ (whitespace needed). The whole term should be placed as optional (e.g. surrounded by(…)?)
— Oliver Geisen 2006-04-06 13:54
Olivier,
Are you aware of any problems displaying the notes using Internet Explorer 6.0? I have a problem where the presentation of the boxes is poor compared to FireFox (which works perfectly on the same page). The problems are:
Do you know if this is a local implementation issue or something unique to IE?
— Mark Butterworth 2006-05-30 11:30
1. Can't help with that.
2. Use transparent GIFs instead of the transparent PNGs, as IE has a buggy implementation for displaying the later.
Put them in 'lib/plugins/note/images' and edit 'lib/plugins/note/style.css' (change the 'background-image:' directives)
to replace PNGs with your GIFs. Make sure that the GIFs have the same permissions as the PNGs.
— thanos 2006-05-30 14:05
— MikeStammer 2006-06-28 13:08
- Make sure you have 'Allow embedded HTML' turned on in your config or this will not work right!
— Matthias Pitzl 2006-08-30 09:07
- It's clear why the boxes are rounded only in browsers using the Gecko rendering engine: there's some proprietary CSS-Code used for the rounded edge effect. Opera also just shows a rectangle box.
— alex 2006-12-16
- This is a real shame because rounded corners also don't show up in Safari.
I needed to clean up the cache with cacherevisionseraser to get the plugin working. — Konrad Bauckmeier 2006-07-06 15:38
I had the same problem. Perhaps this hint should be included to the install-instructions. Thx a lot for the plugin.
An other obvious method which worked for me was to delete the cache manually:
rm -rf <your doku root>/data/cache/*
— Alex 2007-05-29
<note> won't work inside numbered list, but <code>, <file> etc works. Probably some restriction in mode?— Petr Sindelar 2006-08-16 12:42
If you have a long table of contents and a <note> quite at the beginning of the page, the <note> will leave a lot of vertical space and only come after the end of the TOC.
— Reinhold Kainhofer 2006-08-27 11:58
I solved this by surrounding the note<div>…</div>with<table style=“border: none;”><tr><td>…</td></tr></table>. Not particularly nice, but it works.
— dab 2006-11-02 13:54
If you want the notes to have that nice layout also in the printout (currently, the notes are not marked in any
way in the printout), you have to copy the style.css over to print.css (which is the only style sheet used when
printing).
— Reinhold Kainhofer 2006-08-28 13:28
This works for the formatting but I still can't get the icons to print. I have the option checked to print background colors & images. How can I get the icons to print?
— Tim Constantine 2006-09-20 10:16
That is because you didn`t alter the path for the images, in the style css there should be the line: “background-image: url(images/important.gif);”
This path won`t work in the print.css however, because you are in another root directory. There are two possible ways to change this:
1. Copy the images folder to the directory your print.css is in (not the best way, but easy to do :D)
2. Alter the path in your print.css, it should then look something like: “background-image: url(../../../plugins/note/images/important.gif);”
Hope that works for you
Scarecrow 2006-12-01 13:07Wouldn't an @import in the print.css do it? You even would not have to alter the image-urls. — Andy Pillip 2007-09-14 15:29
—- On at least one page i can a huge blank space… I don't understand what's going on… Any hint/help is appreaciated. Weirdly enough, when logged on, that space desappears.
— Pascal Giard 2006-10-04 11:48
Hi, Solution is to edit the style.css in plugins/note/ and remove clear: both; from it. — Ze 2006-12-07 13:46
Thanks alot, works like a charm! — Pascal Giard 2006-12-08 00:11
This will not work for IE6! Other ideas? — Robert Riebisch 2007-03-21 13:12
With latest version of dokuwiki (rc2006-10-19.tgz RC3) the plugin does not display the graphics at the notes.
Only the text and color. What can I do?
did you try to clear the cache? (navigator and server) i had similar issue at installation.
Thierry 2006-12-11 10:56
I had similar problems with the 2006-11-06 release, and the solution was similar, if not the same. I'm not clear on what Thierry meant about “navigator and server”, but deleting all the subfolders with a single character for a name under the DokuWiki/data/cache folder solved the problem I had. Olivier said it might be necessary to close the browser and open a new one, but that wasn't necessary in my case. — DGM2 2007-01-04 16:39
The download does not work. Does anyone have a copy>
The downloads work, now. See above — DGM2 2007-01-04 16:30
Hello, could you offer zip format of the plugin? Because the tgz file won't be repacked on Windows servers through the Plugin Manager.
Thank you for this handy plugin! — Roberto Ciang 2006-12-13 08:12
I put it up on my dyn-server as a ZIP: Get it from http://kokstitan.ath.cx/note.zip — konstantin baierer 2006-12-13 11:08
I'm not sure if anyone else had similar problems, but I noticed with the latest DokuWiki and Firefox (not sure which is more responsible) I had to change the style.css file so that the ”.noteclassic” and so forth became “div.noteclassic”. Otherwise the notes didn't show up with any style.
I had the same problem but only with the arctic skin. Your workaround works great! Thank you.
Thanks !! That helped me out as well! — Wouter 2007-08-06 21:16
SCRIPT.JS for Note Plugin by — Seth 2007-03-27 17:47
I have created a script.js file for the note plugin which is used to create a note picker in the toolbar (when editing). It is based on the javascript function to create a highlight toolbar in dokuwiki. I hope this becomes standard with the plugin in the future.
The script.js file is available at: http://rafb.net/p/ciN10M13.html and should be saved as /lib/plugins/note/script.js
You will also need to find an image for the toolbar, the one I am using is probably copywritten, I searched the net for 'note' as a small image and found a 16×16. The default image file is /lib/plugins/note/note.gif but can be changed easily in the javascript.
There is one bug: When you click the image for the dropdown the options are blank, you must hover over the blank area to show the name in the tooltip. It isnt so much that it is a bug but that I dont know too much javascript so I cant fix it. I am sure there is a way to actually show the way the note looks in the picker.
Bug within the plugin 2007-04-02 17:32
There's a bug in the syntax.php file, in the function render there's an inversion between <p> and </p>.
Philippe Gomes
Unable to install via plugin manager (2007-04-05)
I have to download it, and un-tar it.
Anyway, great plugin :)
I've seen the same bug as Philippe. I can only get notes to display if I edit syntax.php as he states.
However, with the notes plugin enabled, I get the following error whenever editing a page:- Warning: Cannot modify header information - headers already sent by (output started at C:\www\wiki\lib\plugins\note\syntax.php:1) in C:\www\wiki\inc\actions.php on line 295
Is this plugin incompatible with the latest dokuwiki, or is it perhaps incompatible with some other plugins ?
Sounds like a problem related to gzip —- The notes leave a big space above when using the ACH template… —- Yes, the plugin didn't work for me until I made the changes Philippe suggested in lines 113 and 121 of note/syntax.php: <code php> $renderer→doc .= '<p><div class=”'.$data.'”>'; … $renderer→doc .= “\n</div></p>”; </code> —- Is there a way to continue 2nd level unordered list after <note>…</note>?**
If note is placed inside a second level bullet list, then the bullet following the note is reset to 1st level, e.g.:
* level 1
* level 2
<note>a note</note>
* this should be level 2 bullet, but it becomes level 1
If you use this plugin a lot you might put the icons in the toolbar. Add following code to /conf/userscript.js
if(toolbar){ toolbar[toolbar.length] = {"type":"format", "title":"note", "icon":"note.png", "key":"", "open":"<note>", "close":"</note>"}; }
if(toolbar){ toolbar[toolbar.length] = {"type":"format", "title":"important", "icon":"note_important.png", "key":"", "open":"<note important>", "close":"</note>"}; }
if(toolbar){ toolbar[toolbar.length] = {"type":"format", "title":"warning", "icon":"note_warning.png", "key":"", "open":"<note warning>", "close":"</note>"}; }
if(toolbar){ toolbar[toolbar.length] = {"type":"format", "title":"tip", "icon":"note_tip.png", "key":"", "open":"<note tip>", "close":"</note>"}; }
You can use the icons that are distributed with this plugin (resized to 16×16 pixels) and put them in /lib/images/toolbar/
Did not work for me - the only plugin not to work so far - Dokuwiki 2007-06-26b - http://dokuwiki.healthwealthandmusic.co.uk/. I've got html enabled and I tried disabling thebox plugin just in case it conflicted and I cleared the cache.
I had the same problem, but I added the following line in syntax.php after the first require_once. Not the best solution, but a simpler solution.
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"lib/plugins/note/style.css\" />" ;
I had to change the permissions from ”-rw-r—–” to ”-rw-r–r–” for displaying the images correctly
— for me don't work in date 13/03/2008 and with the last version of dokuwiki…i try somethings you say here but it doesn't go!!! an help?!?!
Feature request: It would be nice to be able to disable the display of the icons when you want - thus, this would just display the coloured boxes without the icons. Sometimes this is preferred/desired. It would make this plugin that bit more useful. MP 06/05/08
Hello, with the latest Dokuwiki release you should be able to use the 'block' PType and remove the <p> tags from your output strings in render(). Thanks for the plugin~ :) ~fantasai
Testing this with the May 2008 release of dokuwiki the plugin appears broken. The tags display as lessthan TEXT greaterthan symbol without any css formatting. Is this a stylesheet problem as checking the source for a test page doesn't reveal an include for the templates css, and the fix suggested above doesn't work? ~Matt
To fix in the latest version, you should check the permissions of the files/folder, they are wrong. To do this in one step, chmod 755 everything in lib/plugin/note ;)
Even after chmod 755, the plugin is still broken. I use the DokuBook template … after switching back to the default template, the plugin works ! Something missing with dokubook template ? Thanks for this great plugin ! … Back to dokubook template and it works now, I don't know why … cache problem ?