plugin:camelcase
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:camelcase [2007-12-31 16:39] – xxovercastxx | plugin:camelcase [2018-05-30 21:12] (current) – Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== CamelCase Plugin ====== | ||
+ | ---- plugin ---- | ||
+ | description: | ||
+ | author | ||
+ | email : chris@jalakai.co.uk | ||
+ | type : syntax | ||
+ | lastupdate : 2008-08-13 | ||
+ | compatible : 2005-09-19+ | ||
+ | depends | ||
+ | conflicts | ||
+ | similar | ||
+ | tags : links | ||
+ | |||
+ | downloadurl: | ||
+ | ---- | ||
+ | |||
+ | 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. | ||
+ | CamelCase => camel_case | ||
+ | |||
+ | Standard DokuWiki behaviour is to create a link to a page with the %%CamelCase%% converted to all lower case (e.g. camelcase). This can result in reduced readability for the page names. An alternative is to set the config option '' | ||
+ | |||
+ | ===== Syntax ===== | ||
+ | |||
+ | as described in DokuWiki' | ||
+ | |||
+ | |||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | Search and install the plugin using the [[plugin: | ||
+ | |||
+ | |||
+ | Plugin sources: [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Details ===== | ||
+ | |||
+ | ==== php source ==== | ||
+ | |||
+ | **'' | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | /** | ||
+ | * CamelCase Plugin: replaces DokuWiki' | ||
+ | | ||
+ | * @license | ||
+ | * @author | ||
+ | */ | ||
+ | |||
+ | if(!defined(' | ||
+ | |||
+ | /** | ||
+ | * All DokuWiki plugins to extend the parser/ | ||
+ | * need to inherit from this class | ||
+ | */ | ||
+ | class syntax_plugin_camelcase extends DokuWiki_Syntax_Plugin { | ||
+ | |||
+ | | ||
+ | /** | ||
+ | * return some info | ||
+ | */ | ||
+ | function getInfo(){ | ||
+ | return array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Syntax Type | ||
+ | * | ||
+ | * Needs to return one of the mode types defined in $PARSER_MODES in parser.php | ||
+ | */ | ||
+ | function getType(){ | ||
+ | return(' | ||
+ | } | ||
+ | | ||
+ | function connectTo($mode) { | ||
+ | $this-> | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | | ||
+ | function getSort() { | ||
+ | return 275; // needs to be lower than 290 | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Handler to prepare matched data for the rendering process | ||
+ | */ | ||
+ | function handle($match, | ||
+ | | ||
+ | preg_match_all('/ | ||
+ | $link = implode(' | ||
+ | return array($link, | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Handles the actual output creation. | ||
+ | */ | ||
+ | function render($format, | ||
+ | $renderer-> | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | //Setup VIM: ex: et ts=4 enc=utf-8 : | ||
+ | </ | ||
+ | |||
+ | ===== Revision History ===== | ||
+ | |||
+ | * 2008-08-13 --- Plugin URL updated. | ||
+ | * 2005-08-15 --- Released. | ||
+ | |||
+ | ===== To Do ===== | ||
+ | |||
+ | ===== Bugs ===== | ||
+ | |||
+ | ===== Discussion ===== | ||
+ | >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? |