DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:tabtables

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:tabtables [2010-10-04 11:01] – [Todo] 77.167.120.32plugin:tabtables [2023-10-30 22:17] (current) Klap-in
Line 6: Line 6:
 email      : pomax@nihongoresources.com email      : pomax@nihongoresources.com
 type       : Action type       : Action
-lastupdate : 2009-09-29 +lastupdate : 2010-10-04 
-compatible : 2009-02-14b (not tested on earlier versions)+compatible : !Hogfather, Lemming
 tags       : tables tags       : tables
  
-downloadurl: http://pomax.nihongoresources.com/downloads/plugin-tabtables.tar.gz+downloadurl: http://projects.nihongoresources.com/downloadables/plugin-tabtables.tar.gz
 ---- ----
  
 ===== Download and Installation ===== ===== Download and Installation =====
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the following URL.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-  * [[http://pomax.nihongoresources.com/downloads/plugin-tabtables.tar.gz|tar.gz format (3k)]]+  * [[http://projects.nihongoresources.com/downloadables/plugin-tabtables.tar.gz|tar.gz format (3k)]]
  
-To install the plugin manually, download the source to your plugin folder, ''lib/plugins'', and extract its contents.  That will create a new plugin folder, ''lib/plugins/tabtables'', containing a single file, action.php -- The plugin is now installed. 
 ===== Details ===== ===== Details =====
  
Line 95: Line 94:
 ===== This is an action plugin, not a syntax plugin ===== ===== This is an action plugin, not a syntax plugin =====
  
-Despite the function of this plugin being syntactical, it is implemented as an action plugin. This means that the action is performed before the standard wiki syntax translation (including all syntax plugins) take effect. A consequence of this is that lines that start with tabs are translated to wikisymbols inside the %%<code>%%, %%<file>%% and even in %%<nowiki>%% blocks. There is a record for this problem in the TODO section, and is currently being worked on.+Despite the function of this plugin being syntactical, the job it has to do cannot be done with a regular expression, and so is implemented as an action plugin, instead. 
 + 
 +This means that the action is performed before the standard wiki syntax translation (including all syntax plugins) take effect. A consequence of this is that lines that start with tabs are translated to wikisymbols. Since processing is per line, the plugin will not convert anything that's in %%<code>%%, %%<file>%% and %%<nowiki>%% blocks **unless these blocks are opened and closed on the same line**.
 ===== Todo ===== ===== Todo =====
  
Line 105: Line 106:
 One option is to prepare your table data in a text editor with tabs, the other is to copy a tab into your clipboard and instead of typing "tab" to get one, typing ctrl/cmd-v (or whatever key combination acts as "paste" on your OS). One option is to prepare your table data in a text editor with tabs, the other is to copy a tab into your clipboard and instead of typing "tab" to get one, typing ctrl/cmd-v (or whatever key combination acts as "paste" on your OS).
  
-This plugin will covert tabs in %%<code>%%, %%<file>%%, and even in %%<nowiki>%% blocks, ''provided these are opened and closed on the same line''. This is a consequence of running as action plugin. +This plugin will covert tabs in %%<code>%%, %%<file>%%, and even in %%<nowiki>%% blocks, **provided these are opened and closed on the same line**. This is a consequence of running as action plugin. 
  
 ===== Bugs ===== ===== Bugs =====
 +==== PHP 7.0 compatibility ====
 +This plugin uses the //split// function that is not available in PHP7.0. To fix you must replace line 165 in action.php (that contains //split//) with:
  
 +  $cells = count(preg_split('/\t/',$original[0]));
 ==== 2009-10-02 ==== ==== 2009-10-02 ====
  
Line 179: Line 183:
  * Preprocesses the user's written data, by hooking into the text parser at the preprocessing point  * Preprocesses the user's written data, by hooking into the text parser at the preprocessing point
  */  */
- function register(&$controller) { + function register(Doku_Event_Handler $controller) { 
  $controller->register_hook('PARSER_WIKITEXT_PREPROCESS', 'BEFORE', $this, '_tablify');  $controller->register_hook('PARSER_WIKITEXT_PREPROCESS', 'BEFORE', $this, '_tablify');
  $controller->register_hook('PARSER_HANDLER_DONE','BEFORE', $this, '_fixsecedit');  $controller->register_hook('PARSER_HANDLER_DONE','BEFORE', $this, '_fixsecedit');
Line 214: Line 218:
  if(strpos($line,"<nowiki")!==false) { $nowiki_blocked = true; }  if(strpos($line,"<nowiki")!==false) { $nowiki_blocked = true; }
  // block clearing?  // block clearing?
- if(strpos($line,"</code>")!==false) { $code_blocked = false; } + if(strpos($line,"&lt;/code>")!==false) { $code_blocked = false; } 
- if(strpos($line,"</file>")!==false) { $file_blocked = false; } + if(strpos($line,"&lt;/file>")!==false) { $file_blocked = false; } 
- if(strpos($line,"</nowiki>")!==false) { $nowiki_blocked = false; }+ if(strpos($line,"&lt;/nowiki>")!==false) { $nowiki_blocked = false; }
  // if blocked, immediately continue on to the next line  // if blocked, immediately continue on to the next line
  if($code_blocked || $file_blocked  || $nowiki_blocked) { continue; }  if($code_blocked || $file_blocked  || $nowiki_blocked) { continue; }
plugin/tabtables.1286182916.txt.gz · Last modified: 2010-10-04 11:01 by 77.167.120.32

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