plugin:tab
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:tab [2011-08-09 14:36] – old revision restored Aleksandr | plugin:tab [2020-05-14 22:36] (current) – [Tab Plugin] Juergen_aus_Zuendorf | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Tab ====== | + | ====== Tab Plugin |
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
- | author | + | author |
- | email : timskoch@hotmail.com | + | email : H-J-Schuemmer@Web.de |
type : syntax | type : syntax | ||
- | lastupdate : 2006-08-16 | + | lastupdate : 2020-05-14 |
- | compatible : | + | compatible : 2018-04-22b " |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
tags : typography | tags : typography | ||
+ | |||
+ | downloadurl: | ||
+ | bugtracker : https:// | ||
+ | sourcerepo : https:// | ||
---- | ---- | ||
Line 17: | Line 21: | ||
===== Description ===== | ===== Description ===== | ||
- | Nothing too special. | + | Since one can't really do tabs in HTML, this plugin offers a possibility by the use of non-breaking spaces (nbsp' |
- | ===== Use ===== | ||
- | Simply insert | + | ===== Syntax ===== |
- | + | ||
- | ===== Code ===== | + | There are two ways to use the plugin: |
- | <code php lib/ | + | - Insert ''< |
- | <?php | + | - Insert '' |
- | /** | + | |
- | * Plugin Tab: Inserts "& | + | Therefore the following both syntax |
- | * | + | |
- | * @license | + | ^ Syntax |
- | * @author | + | | '' |
- | */ | + | | ''< |
- | + | ||
- | if(!defined('DOKU_INC')) define('DOKU_INC', | + | |
- | if(!defined(' | + | |
- | require_once(DOKU_PLUGIN.' | + | |
- | + | ||
- | /** | + | |
- | * All DokuWiki plugins to extend the parser/ | + | |
- | * need to inherit from this class | + | |
- | */ | + | |
- | class syntax_plugin_tab extends DokuWiki_Syntax_Plugin { | + | |
- | + | ||
- | /** | + | |
- | * return some info | + | |
- | */ | + | |
- | function getInfo(){ | + | |
- | return array( | + | |
- | | + | |
- | ' | + | |
- | 'date' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ); | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * What kind of syntax are we? | + | |
- | */ | + | |
- | function getType(){ | + | |
- | | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * What kind of syntax do we allow (optional) | + | |
- | */ | + | |
- | // function getAllowedTypes() { | + | |
- | // return array(); | + | |
- | // } | + | |
- | + | ||
- | /** | + | |
- | * What about paragraphs? (optional) | + | |
- | */ | + | |
- | // function getPType(){ | + | |
- | // return ' | + | |
- | // } | + | |
- | + | ||
- | /** | + | |
- | * Where to sort in? | + | |
- | */ | + | |
- | function getSort(){ | + | |
- | return 999; | + | |
- | } | + | |
- | + | ||
- | + | ||
- | /** | + | |
- | * Connect pattern to lexer | + | |
- | */ | + | |
- | function connectTo($mode) { | + | |
- | $this-> | + | |
- | // $this-> | + | |
- | } | + | |
- | + | ||
- | // function postConnect() { | + | |
- | // $this-> | + | |
- | // } | + | |
- | + | ||
- | + | ||
- | /** | + | |
- | * Handle the match | + | |
- | */ | + | |
- | function handle($match, | + | |
- | switch ($state) { | + | |
- | case DOKU_LEXER_ENTER : | + | |
- | break; | + | |
- | case DOKU_LEXER_MATCHED : | + | |
- | break; | + | |
- | case DOKU_LEXER_UNMATCHED : | + | |
- | break; | + | |
- | case DOKU_LEXER_EXIT : | + | |
- | break; | + | |
- | case DOKU_LEXER_SPECIAL : | + | |
- | break; | + | |
- | } | + | |
- | return array(); | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Create output | + | |
- | */ | + | |
- | function render($mode, & | + | |
- | if($mode == ' | + | |
- | $renderer-> | + | |
- | // $renderer-> | + | |
- | return true; | + | |
- | } | + | |
- | return false; | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | //Setup VIM: ex: et ts=4 enc=utf-8 : | + | |
- | </ | ||
===== Installation ===== | ===== Installation ===== | ||
- | Just like any other plugin: | + | Install the plugin using the [[plugin:plugin|Plugin Manager]] |
- | Enjoy! | ||
+ | ===== Development ===== | ||
+ | The original code was written by Tim Skoch. I have updated it for compatibility to PHP7 and included the possibility proposed by taggic (2011-09-22) to extend the syntax to "< | ||
- | ===== Discussion ===== | + | The earlier description can be found [[.: |
- | Is any really necessary? ;-) | ||
- | ====== | + | === Change Log === |
- | Tim, | + | |
- | We used your code to spawn our [[plugin:pagebreak|pagebreak]] plugin. | + | * **2018-02-06**: Last version of Tim Scoch |
- | ~[[mailto:j.mcbride@mail.utexas.edu|Jonathan]] | + | * **2020-05-14**: Acquisition |
- | ---- | ||
- | 2010-05-18 | + | === Known Bugs and Issues |
- | :?: It doesn' | + | |
- | ==== New Code ==== | + | |
- | Could be done in less lines (drop test code etc). | + | Please report bugs or feature requests at the [[https:// |
- | <code php> | + | |
- | <?php | + | |
- | /** | ||
- | * Plugin Tab: Inserts "& | ||
- | | ||
- | * @license | ||
- | * @author | ||
- | */ | ||
- | |||
- | if(!defined(' | ||
- | if(!defined(' | ||
- | require_once(DOKU_PLUGIN.' | ||
- | |||
- | /** | ||
- | * All DokuWiki plugins to extend the parser/ | ||
- | * need to inherit from this class | ||
- | */ | ||
- | class syntax_plugin_tab extends DokuWiki_Syntax_Plugin { | ||
- | |||
- | /** | ||
- | * return some info | ||
- | */ | ||
- | function getInfo(){ | ||
- | return array( | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ); | ||
- | } | ||
- | |||
- | /** | ||
- | * What kind of syntax are we? | ||
- | */ | ||
- | function getType(){ | ||
- | return ' | ||
- | } | ||
- | |||
- | /** | ||
- | * Where to sort in? | ||
- | | ||
- | function getSort(){ | ||
- | return 999; | ||
- | } | ||
- | |||
- | /** | ||
- | * Connect pattern to lexer | ||
- | */ | ||
- | function connectTo($mode) { | ||
- | $this-> | ||
- | } | ||
- | |||
- | /** | ||
- | * Handle the match | ||
- | */ | ||
- | function handle($match, | ||
- | return array(); | ||
- | } | ||
- | |||
- | /** | ||
- | * Create output | ||
- | */ | ||
- | function render($mode, | ||
- | if($mode == ' | ||
- | $renderer-> | ||
- | return true; | ||
- | } | ||
- | return false; | ||
- | } | ||
- | } | ||
- | ?> | + | ===== Discussion ===== |
- | </ | + | |
- | When we updated to the latest version of DokuWiki, this broke. | ||
- | 2011-07-26 | ||
- | Works great in latest version using "New Code" above. |
plugin/tab.1312893377.txt.gz · Last modified: 2011-08-09 14:36 by Aleksandr