plugin:outdent
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:outdent [2007-03-24 23:35] – az | plugin:outdent [2023-10-30 22:42] (current) – Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== outdent Plugin ====== | ||
+ | ---- plugin ---- | ||
+ | description: | ||
+ | author | ||
+ | email : chris@jalakai.co.uk | ||
+ | type : syntax | ||
+ | lastupdate : 2008-08-13 | ||
+ | compatible : Binky | ||
+ | depends | ||
+ | conflicts | ||
+ | similar | ||
+ | tags : section, headings | ||
+ | |||
+ | downloadurl: | ||
+ | ---- | ||
+ | |||
+ | This plugin extends DokuWiki syntax to enable the removal of one level of section indenting. | ||
+ | |||
+ | In native [[: | ||
+ | |||
+ | e.g. | ||
+ | HEADING 1 | ||
+ | ==level 1 section content | ||
+ | HEADING 2 | ||
+ | level 2 section content | ||
+ | HEADING 3 | ||
+ | level 3 section content | ||
+ | level 2 section content | ||
+ | HEADING 3 | ||
+ | level 1 section content | ||
+ | |||
+ | |||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | < | ||
+ | == | ||
+ | </ | ||
+ | The two equals signs must be on their own line. | ||
+ | |||
+ | See the page in action [[http:// | ||
+ | |||
+ | |||
+ | ===== Installation ===== | ||
+ | Search and install the plugin using the [[plugin: | ||
+ | |||
+ | Plugin sources: [[http:// | ||
+ | |||
+ | |||
+ | ===== Configuration ===== | ||
+ | |||
+ | The plugin has no configuration settings. | ||
+ | |||
+ | ===== Details ===== | ||
+ | |||
+ | The plugin consists one file, the plugin script [[# | ||
+ | |||
+ | ==== syntax.php ==== | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | /** | ||
+ | * Plugin Outdent: Removes one level of indenting. | ||
+ | * | ||
+ | * @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_outdent extends DokuWiki_Syntax_Plugin { | ||
+ | |||
+ | function getInfo(){ | ||
+ | return array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | |||
+ | function getType() { return ' | ||
+ | function getSort() { return 50; } /* same as header */ | ||
+ | |||
+ | function connectTo($mode) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | function handle($match, | ||
+ | $level=0; | ||
+ | if ($state == DOKU_LEXER_SPECIAL) { | ||
+ | $level = $this-> | ||
+ | if ($level > 1) { | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | } | ||
+ | } | ||
+ | |||
+ | return false; | ||
+ | } | ||
+ | |||
+ | function render($mode, | ||
+ | |||
+ | return false; | ||
+ | } | ||
+ | |||
+ | function _getLevel(& | ||
+ | |||
+ | for ($i=count($calls); | ||
+ | if ($calls[$i][0] == ' | ||
+ | if ($calls[$i][0] == ' | ||
+ | } | ||
+ | |||
+ | return 0; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Revision History ===== | ||
+ | |||
+ | * 2008-08-13 --- Plugin URL updated. | ||
+ | * 2005-09-30 --- Released. | ||
+ | |||
+ | |||
+ | ===== To Do ===== | ||
+ | |||
+ | ===== Bugs ===== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Discussion ===== | ||
+ | |||
+ | >Great plugin. Very helpful for working around the quirks of the [[plugin: | ||
+ | |||
+ | Ah, interesting plugin! | ||
+ | |||
+ | I was looking for something like this, but didn't know how to search for it. I think that it would sense to make a notation on [[wiki: | ||
+ | |||
+ | ---- | ||
+ | Could your plugin be modified to create section break without changing the level, indentation or anything else, just section break. I need this thing badly. Unfortunately I myself is a dummy in programming. |