DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:tab

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
plugin:tab [2011-09-22 10:44]
93.199.162.152 [Enhancement/Feature Extension]
plugin:tab [2018-02-14 13:01] (current)
Juergen_aus_Zuendorf [Code]
Line 1: Line 1:
-====== Tab ======+====== Tab Plugin ​======
  
 ---- plugin ---- ---- plugin ----
Line 6: Line 6:
 email      : timskoch@hotmail.com email      : timskoch@hotmail.com
 type       : syntax type       : syntax
-lastupdate : 2006-08-16+lastupdate : 2018-02-06
 compatible : compatible :
 depends ​   : depends ​   :
Line 50: Line 50:
             '​author'​ => 'Tim Skoch',​             '​author'​ => 'Tim Skoch',​
             '​email' ​ => '​timskoch@hotmail.com',​             '​email' ​ => '​timskoch@hotmail.com',​
-            '​date' ​  => '2006-08-16',+            '​date' ​  => '2018-02-06',
             '​name' ​  => 'Tab Plugin',​             '​name' ​  => 'Tab Plugin',​
             '​desc' ​  => '​Inserts "&​nbsp;&​nbsp;&​nbsp;&​nbsp;&​nbsp;"​ into the html of the document for every <tab> it encounters',​             '​desc' ​  => '​Inserts "&​nbsp;&​nbsp;&​nbsp;&​nbsp;&​nbsp;"​ into the html of the document for every <tab> it encounters',​
Line 102: Line 102:
      * Handle the match      * Handle the match
      */      */
-    function handle($match,​ $state, $pos, &$handler){+    function handle($match,​ $state, $pos, Doku_Handler ​$handler){
         switch ($state) {         switch ($state) {
           case DOKU_LEXER_ENTER :            case DOKU_LEXER_ENTER : 
Line 121: Line 121:
      * Create output      * Create output
      */      */
-    function render($mode, ​&$renderer, $data) {+    function render($mode, ​Doku_Renderer ​$renderer, $data) {
         if($mode == '​xhtml'​){         if($mode == '​xhtml'​){
             $renderer->​doc .= "&​nbsp;&​nbsp;&​nbsp;&​nbsp;&​nbsp;"; ​           // ptype = '​normal'​             $renderer->​doc .= "&​nbsp;&​nbsp;&​nbsp;&​nbsp;&​nbsp;"; ​           // ptype = '​normal'​
Line 132: Line 132:
    
 //Setup VIM: ex: et ts=4 enc=utf-8 : //Setup VIM: ex: et ts=4 enc=utf-8 :
- 
 </​code>​ </​code>​
  
 +--- [[user>​Juergen_aus_Zuendorf|Juergen_aus_Zuendorf]] //​2018-02-06 16:27//\\
 +-> Changes for compatibility to PHP7:\\
 +"&​$handler"​ and "&​$renderer"​ to "​Doku_Handler $handler"​ and "​Doku_Renderer $renderer"​
 ===== Installation ===== ===== Installation =====
  
Line 247: Line 249:
 //​2011-09-22 by Taggic// \\  //​2011-09-22 by Taggic// \\ 
  
-If you modify the code according below you can define the quantity of "&​nbsp"​ signs. If the parameter is missing it is using automatically the old behaiviour so that nobody has te search and replace the formerly used "​tabs"​.+If you modify the code according below you can define the quantity of "&​nbsp"​ signs. If the parameter is missing it is using automatically the old behaiviour so that nobody has to search ​through all pages and replace the formerly used "​tabs"​.
  
 following both syntax lines are working: following both syntax lines are working:
Line 258: Line 260:
     // Connect pattern to lexer     // Connect pattern to lexer
     function connectTo($mode) {      function connectTo($mode) { 
-      $this->​Lexer->​addSpecialPattern('<​tab[^}]*>',​ $mode, '​plugin_tab'​);​ }+      $this->​Lexer->​addSpecialPattern('<​tab\d*>',​ $mode, '​plugin_tab'​);​ }
    
     // Handle the match     // Handle the match
plugin/tab.1316681089.txt.gz ยท Last modified: 2011-09-22 10:44 by 93.199.162.152