DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:side_note

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:side_note [2010-03-22 13:28] 217.128.78.18plugin:side_note [2013-03-06 15:42] (current) Klap-in
Line 1: Line 1:
- 
  
 ====== Definition Side Note ====== ====== Definition Side Note ======
Line 12: Line 11:
 depends    : depends    :
 conflicts  : conflicts  :
-similar    : note+similar    : note, imagebox, imagereference
 tags       : boxes, caption, !experimental tags       : boxes, caption, !experimental
 ---- ----
Line 21: Line 20:
 ===== Description ===== ===== Description =====
  
-With this plugin the [[:syntax]] of [[:DokuWiki]] is extended to allow Side Notes. The syntax to use this plugin is:+With this plugin the [[:wiki:syntax]] of [[:DokuWiki]] is extended to allow Side Notes. The syntax to use this plugin is:
  
   <side>This is my centered note </side>   <side>This is my centered note </side>
Line 145: Line 144:
      */      */
     function connectTo($mode) {     function connectTo($mode) {
-        $this->Lexer->addEntryPattern('<side right>(?=.*\x3C/side\x3E)',$mode,'plugin_sidenote'); +        $this->Lexer->addEntryPattern('<side right>(?=.*</side>)',$mode,'plugin_sidenote'); 
-        $this->Lexer->addEntryPattern('<side left>(?=.*\x3C/side\x3E)',$mode,'plugin_sidenote'); +        $this->Lexer->addEntryPattern('<side left>(?=.*</side>)',$mode,'plugin_sidenote'); 
-        $this->Lexer->addEntryPattern('<side>(?=.*\x3C/side\x3E)',$mode,'plugin_sidenote');+        $this->Lexer->addEntryPattern('<side>(?=.*</side>)',$mode,'plugin_sidenote');
     }     }
     function postConnect() {     function postConnect() {
Line 218: Line 217:
 I disagree --- a better pattern would be ''%%<side(?:\s+[^\r\n>]+)?>(?=.*</side>)%%'' This would allow the plugin to catch ''%%<note>%%'', ''%%<note left>%%'', or ''%%<note gobble-de-gook>%%'', but allow another plugin to catch, say, ''%%<sideways>%%''. I disagree --- a better pattern would be ''%%<side(?:\s+[^\r\n>]+)?>(?=.*</side>)%%'' This would allow the plugin to catch ''%%<note>%%'', ''%%<note left>%%'', or ''%%<note gobble-de-gook>%%'', but allow another plugin to catch, say, ''%%<sideways>%%''.
  
->> I always knew there was a way, but that it was beyond my regex expertise :-)  (\x3c & \x3e changes to < > since parser has been patched to support them) --- //[[chris@jalakai.co.uk|Christopher Smith]] 2006-04-22 16:53//+>> I always knew there was a way, but that it was beyond my regex expertise :-)  --- //[[chris@jalakai.co.uk|Christopher Smith]] 2006-04-22 16:53//
  
 >This plugin slightly breaks the <nowiki>\\</nowiki> line breaker when entering sidenote text. If you use the doubleslashes it throws a full empty line between paragraphs. You are forced to use <br> if you don't want messy spacing between lines. Is it possible to change this plugin so you can set a fixed column width in the tag, and the sidenote will autowrap with you manually needing to enter line breaks? [[dhry@dhryland.com|Dean-Ryan Stone]] 20060807 >This plugin slightly breaks the <nowiki>\\</nowiki> line breaker when entering sidenote text. If you use the doubleslashes it throws a full empty line between paragraphs. You are forced to use <br> if you don't want messy spacing between lines. Is it possible to change this plugin so you can set a fixed column width in the tag, and the sidenote will autowrap with you manually needing to enter line breaks? [[dhry@dhryland.com|Dean-Ryan Stone]] 20060807
Line 246: Line 245:
 > I just got an email asking for my changes to this plugin and I figured that if I was going to create a patch I may as well post it here. Feel free to download my [[http://alphacomplex.org/~adam/oss/dokuwiki/plugins/sidenote/sidenote.diff|sidenote.diff]], it's GPL2 of course. To apply the diff cd to the sidenote plugin directory (dokuwiki/lib/plugins/sidenote/) and run <code bash>patch -p1 < /path/to/sidenote.diff</code> > I just got an email asking for my changes to this plugin and I figured that if I was going to create a patch I may as well post it here. Feel free to download my [[http://alphacomplex.org/~adam/oss/dokuwiki/plugins/sidenote/sidenote.diff|sidenote.diff]], it's GPL2 of course. To apply the diff cd to the sidenote plugin directory (dokuwiki/lib/plugins/sidenote/) and run <code bash>patch -p1 < /path/to/sidenote.diff</code>
 > --- // [[adam@alphacomplex.org|adam]] 2006-12-15 09:22 // > --- // [[adam@alphacomplex.org|adam]] 2006-12-15 09:22 //
 +
 +> This plugin has helped me out significantly, brilliant work!
 +> --- // [[sam@samuelmiller.biz|sam]] 2010-12-31 13:03 //
plugin/side_note.txt · Last modified: 2013-03-06 15:42 by Klap-in

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