plugin:hidetext
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:hidetext [2009-09-30 22:51] – added similar plugins and tags ach | plugin:hidetext [2020-07-17 00:51] (current) – florious | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== hidetext | + | ====== hidetext |
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
author | author | ||
email : vshekun@gmail.com | email : vshekun@gmail.com | ||
type : Syntax | type : Syntax | ||
- | lastupdate : 2009-09-28 | + | lastupdate : 2019-09-02 |
compatible : 2009-02-14b | compatible : 2009-02-14b | ||
depends | depends | ||
Line 17: | Line 17: | ||
===== Usage ===== | ===== Usage ===== | ||
+ | |||
**< | **< | ||
Line 28: | Line 29: | ||
< | < | ||
Result: __> > >__ | Result: __> > >__ | ||
- | |||
===== Installation ===== | ===== Installation ===== | ||
+ | |||
Create a new directory hidetext inside your lib/ | Create a new directory hidetext inside your lib/ | ||
- | <code php> | + | |
+ | **For PHP 7:** | ||
+ | < | ||
+ | <?php | ||
+ | /** | ||
+ | * Plugin HideText: hiding big text < | ||
+ | * @license | ||
+ | * @author | ||
+ | * Updated | ||
+ | * Format: < | ||
+ | * Examples: < | ||
+ | | ||
+ | */ | ||
+ | |||
+ | if(!defined(' | ||
+ | if(!defined(' | ||
+ | require_once(DOKU_PLUGIN.' | ||
+ | |||
+ | |||
+ | /** | ||
+ | * All DokuWiki plugins to extend the parser/ | ||
+ | * need to inherit from this class | ||
+ | */ | ||
+ | class syntax_plugin_hidetext extends DokuWiki_Syntax_Plugin { | ||
+ | |||
+ | /** | ||
+ | * return some info | ||
+ | */ | ||
+ | function getInfo(){ | ||
+ | return array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * What kind of syntax are we? | ||
+ | */ | ||
+ | function getType(){ | ||
+ | return ' | ||
+ | } | ||
+ | | ||
+ | return array(' | ||
+ | | ||
+ | |||
+ | /** | ||
+ | * Where to sort in? | ||
+ | */ | ||
+ | function getSort(){ | ||
+ | return 201; | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Connect pattern to lexer | ||
+ | */ | ||
+ | function connectTo($mode) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | function postConnect() { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Handle the match | ||
+ | */ | ||
+ | function handle($match, | ||
+ | switch ($state) { | ||
+ | case DOKU_LEXER_ENTER : | ||
+ | return array($state, | ||
+ | break; | ||
+ | case DOKU_LEXER_UNMATCHED : | ||
+ | return array($state, | ||
+ | break; | ||
+ | case DOKU_LEXER_EXIT : | ||
+ | return array($state, | ||
+ | break; | ||
+ | } | ||
+ | return array(); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Create output | ||
+ | */ | ||
+ | function render($mode, | ||
+ | if($mode == ' | ||
+ | |||
+ | | ||
+ | switch ($state) { | ||
+ | case DOKU_LEXER_ENTER : | ||
+ | if ( $match == "" | ||
+ | $id = " | ||
+ | $renderer-> | ||
+ | $renderer-> | ||
+ | $renderer-> | ||
+ | $renderer-> | ||
+ | $renderer-> | ||
+ | break; | ||
+ | case DOKU_LEXER_UNMATCHED : | ||
+ | $renderer-> | ||
+ | break; | ||
+ | case DOKU_LEXER_EXIT : | ||
+ | $renderer-> | ||
+ | break; | ||
+ | } | ||
+ | return true; | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | |||
+ | **For PHP 5 and 6:** | ||
+ | <code php / | ||
<?php | <?php | ||
/** | /** | ||
Line 66: | Line 188: | ||
' | ' | ||
' | ' | ||
- | ' | + | ' |
- | ' | + | ' |
); | ); | ||
} | } | ||
Line 78: | Line 200: | ||
} | } | ||
| | ||
- | return array(' | + | return array(' |
| | ||
Line 146: | Line 268: | ||
} | } | ||
} | } | ||
- | ?> | ||
</ | </ | ||
plugin/hidetext.1254343904.txt.gz · Last modified: 2009-09-30 22:51 by ach