DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:camelcase

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:camelcase [2010-10-10 14:55] – downloadurl lupo49plugin:camelcase [2018-05-30 21:12] (current) Klap-in
Line 1: Line 1:
-====== CamelCase plugin ======+====== CamelCase Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 16: Line 16:
 ---- ----
  
-This [[plugin]] replaces the current DokuWiki handlers for %%CamelCase%% markup. It will create a link to a page with underscores between the %%CamelCase%% words.+This plugin replaces the current DokuWiki handlers for %%CamelCase%% markup. It will create a link to a page with underscores between the %%CamelCase%% words.
  
 e.g. e.g.
Line 25: Line 25:
 ===== Syntax ===== ===== Syntax =====
  
-as described in DokuWiki's [[syntax]]+as described in DokuWiki's [[wiki:syntax]]
  
  
  
 ===== Installation ===== ===== Installation =====
 +
 +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
 +
  
 Plugin sources: [[http://dokuwiki.jalakai.co.uk/plugin-camelcase.zip|zip format (1k)]], [[http://dokuwiki.jalakai.co.uk/plugin-camelcase.tar.gz|tar.gz format (1k)]] Plugin sources: [[http://dokuwiki.jalakai.co.uk/plugin-camelcase.zip|zip format (1k)]], [[http://dokuwiki.jalakai.co.uk/plugin-camelcase.tar.gz|tar.gz format (1k)]]
  
-Download the source to your plugin folder, ''lib/plugins'' and extract its contents. That will create a new plugin folder, ''lib/plugins/camelcase'' and install the plugin there. 
  
-The folder will contain: 
-  syntax.php                             syntax plugin script 
  
-The plugin is now installed. 
  
 ===== Details ===== ===== Details =====
Line 55: Line 54:
  */  */
  
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); +if(!defined('DOKU_INC')) die();
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); +
-require_once(DOKU_PLUGIN.'syntax.php');+
  
 /** /**
Line 102: Line 99:
      * Handler to prepare matched data for the rendering process      * Handler to prepare matched data for the rendering process
      */      */
-    function handle($match, $state, $pos, &$handler){+    function handle($match, $state, $pos, Doku_Handler $handler){
          
         preg_match_all('/[A-Z][^A-Z]*/u',$match, $matches);         preg_match_all('/[A-Z][^A-Z]*/u',$match, $matches);
Line 112: Line 109:
      * Handles the actual output creation.      * Handles the actual output creation.
      */      */
-    function render($format, &$renderer, $data) {+    function render($format, Doku_Renderer $renderer, $data) {
       $renderer->internallink($data[0],$data[1]);        $renderer->internallink($data[0],$data[1]); 
     }     }
Line 131: Line 128:
 ===== Discussion ===== ===== Discussion =====
 >This is really nice! I've wanted this feature for a long time for my wiki. >This is really nice! I've wanted this feature for a long time for my wiki.
 +----
 +>Thank you for this plugin. Is there a way to prevent selected camel case words becoming a links, such as for ex. using ~ before the word in certain other wikis?
plugin/camelcase.1286715307.txt.gz · Last modified: 2010-10-10 14:55 by lupo49

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