plugin:htag
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:htag [2009-01-25 23:15] – 84.51.133.41 | plugin:htag [2022-01-12 01:18] (current) – Obsolete Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== H-Tag Plugin ====== | ||
+ | ---- plugin ---- | ||
+ | description: | ||
+ | author | ||
+ | email : abr.programmer@gmail.com | ||
+ | type : syntax | ||
+ | lastupdate : 2007-07-23 | ||
+ | compatible : 2013-05-10 2012-10-13 2012-01-25 and 2011-05-25 | ||
+ | depends | ||
+ | conflicts | ||
+ | similar | ||
+ | tags : editing, headings, | ||
+ | ---- | ||
+ | |||
+ | ^ Author | [[abr.programmer@gmail.com|Adam B. Ross]] | | ||
+ | ^ Version | 0.95 (2007-07-23) | | ||
+ | ^ DokuWiki version | Tested on v.2007-06-26| | ||
+ | |||
+ | ===== Description ===== | ||
+ | This is similar to Tony Pujal' | ||
+ | ===== Usage ===== | ||
+ | h1. A Heading to Rule Them All! | ||
+ | |||
+ | This plugin will convert '' | ||
+ | |||
+ | This syntax breaks compatibility with any code or plugins that manipulate the use of '' | ||
+ | |||
+ | A demo and plugin download will be made available once I finish deploying my wiki ;P FIXME (URL to author' | ||
+ | |||
+ | ===== Installation ===== | ||
+ | - Create the directory '' | ||
+ | - Copy the code below to '' | ||
+ | |||
+ | |||
+ | |||
+ | ==== Source Code ==== | ||
+ | <code php syntax.php> | ||
+ | <?php /** | ||
+ | | ||
+ | | ||
+ | * | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | **/ | ||
+ | |||
+ | class syntax_plugin_htag extends DokuWiki_Syntax_Plugin { | ||
+ | |||
+ | function getInfo() { | ||
+ | return array ( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | |||
+ | // header specific | ||
+ | function getType() { return ' | ||
+ | |||
+ | // headings shouldn' | ||
+ | function accepts($mode) { return false; } | ||
+ | |||
+ | function connectTo( $mode ) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | // Doku_Parser_Mode 60 | ||
+ | // header (numbered headers) 45 | ||
+ | function getSort() { return 44; } | ||
+ | | ||
+ | function handle( $match, $state, $pos, Doku_Handler $handler) { | ||
+ | { | ||
+ | global $conf; | ||
+ | preg_match( '/ | ||
+ | $title = substr( $match, 3 ); | ||
+ | $title = trim($title); | ||
+ | $level = substr( $htag[0], 1, 1 ); | ||
+ | |||
+ | if( $handler-> | ||
+ | if( $level <= $conf[' | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | } | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | |||
+ | return true; | ||
+ | } | ||
+ | |||
+ | function render( $format, Doku_Renderer $renderer, $data) { | ||
+ | { | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Changelog ===== | ||
+ | * **Version ..** 2022: some code cleanup, not tested | ||
+ | * **Version 0.95 (2007-07-23)**: | ||
+ | * **Version 0.9 (2007-07-17)**: | ||
+ | |||
+ | |||
+ | |||
+ | ===== Discussion ===== | ||
+ | ==== Spurious blank lines ==== | ||
+ | If I create a pair of headers: | ||
+ | < | ||
+ | h1. Heading 1 | ||
+ | h2. Heading 2 | ||
+ | </ | ||
+ | and then export the page using the odt plugin, then I get spurious blank lines between the headings. | ||
+ | |||
+ | Looking at the content.xml file I can see that these are due to %%< | ||
+ | |||
+ | However, odt exports ok if the regular heading formats are used. | ||
+ | |||
+ | Anyone got any ideas what's causing this? | ||
+ | |||
+ | ==== Error - 10 Feb 2011 ==== | ||
+ | |||
+ | Causes the error : " | ||
+ | on the first load for each page. Refreshing the page will have it come up clean. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | **11 Dec 2011** (kaj.wiik ə iki.fi) | ||
+ | |||
+ | Edit the following lines out (section edit is done now elsewhere): | ||
+ | |||
+ | < | ||
+ | if( $level <= $conf[' | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | $handler-> | ||
+ | } | ||
+ | </ | ||
+ | |