DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:htag

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:htag [2013-10-25 12:16] 213.211.140.219plugin:htag [2022-01-12 01:18] (current) – Obsolete Klap-in
Line 11: Line 11:
 conflicts  : numberedheadings conflicts  : numberedheadings
 similar    :  similar    : 
-tags       : editing, headings+tags       : editing, headings,!obsolete #as not maintained, no download available 
 ---- ----
  
Line 36: Line 36:
  
 ==== Source Code ==== ==== Source Code ====
-<code php>+<code php syntax.php>
 <?php /** <?php /**
   This plugin provides alternative heading syntax.   This plugin provides alternative heading syntax.
Line 46: Line 46:
   @since      23-Jul-2007   @since      23-Jul-2007
 **/ **/
- 
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); 
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 
-require_once(DOKU_PLUGIN.'syntax.php'); 
  
 class syntax_plugin_htag extends DokuWiki_Syntax_Plugin { class syntax_plugin_htag extends DokuWiki_Syntax_Plugin {
Line 60: Line 56:
                         'name' => 'Heading Level Tag',                         'name' => 'Heading Level Tag',
                         'desc' => 'Adds outline-style markup (h1.~) syntax for headings.',                         'desc' => 'Adds outline-style markup (h1.~) syntax for headings.',
-                        'url' => 'http://www.dokuwiki.org/plugin:htag'+                        'url' => 'https://www.dokuwiki.org/plugin:htag'
                 );                 );
         }         }
Line 78: Line 74:
         function getSort() { return 44; }         function getSort() { return 44; }
                  
-        function handle( $match, $state, $pos, &$handler )+        function handle( $match, $state, $pos, Doku_Handler $handler) {
         {         {
                 global $conf;                 global $conf;
Line 86: Line 82:
                 $level = substr( $htag[0], 1, 1 );                 $level = substr( $htag[0], 1, 1 );
  
-                if( $handler->status['section') $handler->_addCall('section_close',array(), $pos);+                if( $handler->getStatus('section') $handler->addCall('section_close',array(), $pos);
                 if( $level <= $conf['maxseclevel'] ) {                 if( $level <= $conf['maxseclevel'] ) {
-                    $handler->_addCall('section_edit',array($handler->status['section_edit_start'], $pos-1, +                    $handler->addCall('section_edit',array($handler->getStatus('section_edit_start'), $pos-1, 
-                                $handler->status['section_edit_level'], $handler->status['section_edit_title']), $pos); +                                $handler->getStatus('section_edit_level'), $handler->getStatus('section_edit_title')), $pos); 
-                    $handler->status['section_edit_start'] = $pos; +                    $handler->setStatus('section_edit_start'$pos)
-                    $handler->status['section_edit_level'] = $level; +                    $handler->setStatus('section_edit_level'$level)
-                    $handler->status['section_edit_title'] = $title;+                    $handler->setStatus('section_edit_title'$title);
                 }                 }
-                $handler->_addCall('header',array($title,$level,$pos), $pos); +                $handler->addCall('header',array($title,$level,$pos), $pos); 
-                $handler->_addCall('section_open',array($level),$pos); +                $handler->addCall('section_open',array($level),$pos); 
-                $handler->status['section'] = true;+                $handler->setStatus('section'true);
  
                 return true;                 return true;
         }         }
  
-        function render( $format, &$renderer, $data )+        function render( $format, Doku_Renderer $renderer, $data) {
         {         {
                 return true;                 return true;
Line 110: Line 106:
  
 ===== Changelog ===== ===== Changelog =====
 +  * **Version ..** 2022: some code cleanup, not tested
   * **Version 0.95 (2007-07-23)**: Fixed no-sections bug.   * **Version 0.95 (2007-07-23)**: Fixed no-sections bug.
   * **Version 0.9 (2007-07-17)**: First published version.   * **Version 0.9 (2007-07-17)**: First published version.
plugin/htag.1382696168.txt.gz · Last modified: 2013-10-25 12:16 by 213.211.140.219

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki