plugin:tab
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
plugin:tab [2011-07-26 17:15] – 129.255.1.147 | plugin:tab [2018-02-14 13:01] – [Code] Juergen_aus_Zuendorf | ||
---|---|---|---|
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: | ||
' | ' | ||
' | ' | ||
- | ' | + | ' |
' | ' | ||
' | ' | ||
Line 102: | Line 102: | ||
* Handle the match | * Handle the match | ||
*/ | */ | ||
- | function handle($match, | + | function handle($match, |
switch ($state) { | switch ($state) { | ||
case DOKU_LEXER_ENTER : | case DOKU_LEXER_ENTER : | ||
Line 121: | Line 121: | ||
* Create output | * Create output | ||
*/ | */ | ||
- | function render($mode, | + | function render($mode, |
if($mode == ' | if($mode == ' | ||
$renderer-> | $renderer-> | ||
Line 132: | Line 132: | ||
//Setup VIM: ex: et ts=4 enc=utf-8 : | //Setup VIM: ex: et ts=4 enc=utf-8 : | ||
- | |||
</ | </ | ||
+ | --- [[user> | ||
+ | -> Changes for compatibility to PHP7:\\ | ||
+ | "& | ||
===== Installation ===== | ===== Installation ===== | ||
Line 240: | Line 242: | ||
2011-07-26 | 2011-07-26 | ||
- | Works great in latest version. | + | Works great in latest version |
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Enhancement/ | ||
+ | // | ||
+ | |||
+ | If you modify the code according below you can define the quantity of "& | ||
+ | |||
+ | following both syntax lines are working: | ||
+ | < | ||
+ | <tab> 5 times "& | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | <code php> | ||
+ | // Connect pattern to lexer | ||
+ | function connectTo($mode) { | ||
+ | $this-> | ||
+ | |||
+ | // Handle the match | ||
+ | function handle($match, | ||
+ | $match = substr($match, | ||
+ | |||
+ | if ((strlen($match)> | ||
+ | $data .= str_repeat('&# | ||
+ | } | ||
+ | else { // if standard tab is used then insert 5 spaces | ||
+ | $data = '&# | ||
+ | } | ||
+ | return $data; | ||
+ | } | ||
+ | |||
+ | // Create output | ||
+ | function render($mode, | ||
+ | if($mode == ' | ||
+ | $renderer-> | ||
+ | return true; } | ||
+ | return false; | ||
+ | } | ||
+ | </ |
plugin/tab.txt · Last modified: 2020-05-14 22:36 by Juergen_aus_Zuendorf