plugin:smaller
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
plugin:smaller [2005-10-05 09:55] – external edit 127.0.0.1 | plugin:smaller [2013-11-13 01:23] (current) – created Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Smaller Plugin ====== | + | Please refer to [[BBCode]] plugin, which makes diffent |
- | + | ||
- | **Note:** This plugin will be discontinued. A [[plugin:BBCode]] plugin | + | |
- | + | ||
- | ===== Description ===== | + | |
- | + | ||
- | With this [[plugins|plugin]] the [[syntax]] of [[DokuWiki]] is extended to allow text with smaller font size. The syntax to use this plugin is... | + | |
- | + | ||
- | #-Smaller text-# | + | |
- | + | ||
- | You can see the plugin in action [[http:// | + | |
- | + | ||
- | ===== Plugin ===== | + | |
- | + | ||
- | Put the following PHP file in ''/ | + | |
- | + | ||
- | <code php> | + | |
- | <?php | + | |
- | /** | + | |
- | * Smaller Plugin: enables smaller text font size with syntax #-text-# | + | |
- | * | + | |
- | * @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_smaller extends DokuWiki_Syntax_Plugin { | + | |
- | + | ||
- | /** | + | |
- | * return some info | + | |
- | */ | + | |
- | function getInfo(){ | + | |
- | return array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ); | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Constructor - adds allowed modes | + | |
- | */ | + | |
- | function syntax_plugin_smaller(){ | + | |
- | global $PARSER_MODES; | + | |
- | $this-> | + | |
- | $PARSER_MODES[' | + | |
- | $PARSER_MODES[' | + | |
- | $PARSER_MODES[' | + | |
- | ); | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * What kind of syntax are we? | + | |
- | */ | + | |
- | function getType(){ | + | |
- | return ' | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Where to sort in? | + | |
- | */ | + | |
- | function getSort(){ | + | |
- | return 104; | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Connect pattern to lexer | + | |
- | */ | + | |
- | function connectTo($mode) { | + | |
- | $this-> | + | |
- | } | + | |
- | + | ||
- | function postConnect() { | + | |
- | $this-> | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Handle the match | + | |
- | */ | + | |
- | function handle($match, | + | |
- | return array($match, | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Create output | + | |
- | */ | + | |
- | function render($mode, | + | |
- | if($mode == ' | + | |
- | if ($data[1] == DOKU_LEXER_ENTER){ | + | |
- | $renderer-> | + | |
- | } else if ($data[1] == DOKU_LEXER_UNMATCHED){ | + | |
- | $renderer-> | + | |
- | } else if ($data[1] == DOKU_LEXER_EXIT){ | + | |
- | $renderer-> | + | |
- | } | + | |
- | return true; | + | |
- | } | + | |
- | return false; | + | |
- | } | + | |
- | + | ||
- | } | + | |
- | + | ||
- | //Setup VIM: ex: et ts=4 enc=utf-8 : | + | |
- | ?> | + | |
- | </ | + |
plugin/smaller.1128498905.txt.gz · Last modified: 2011-06-18 17:02 (external edit)