plugin:isns
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:isns [2007-10-13 15:22] – ach | plugin:isns [2023-12-22 20:15] (current) – new download url Aleksandr | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== isns Plugin ====== | ||
+ | |||
+ | ---- plugin ---- | ||
+ | description: | ||
+ | author | ||
+ | email : ido@woow-fr.com | ||
+ | type : syntax | ||
+ | lastupdate : 2006-01-18 | ||
+ | compatible : | ||
+ | depends | ||
+ | conflicts | ||
+ | similar | ||
+ | tags : namespace, redirect | ||
+ | |||
+ | downloadurl: | ||
+ | bugtracker : | ||
+ | sourcerepo : | ||
+ | donationurl: | ||
+ | |||
+ | screenshot_img: | ||
+ | ---- | ||
+ | |||
+ | ===== What's that? ===== | ||
+ | |||
+ | I have created this plugin because when you show a page which is located in sub-namespace (like php: | ||
+ | |||
+ | Some of user will be disappointed by that... | ||
+ | |||
+ | With this plugin, if you call a page which doesn' | ||
+ | |||
+ | (I hope you'll understand me... I'm not really good in English...). | ||
+ | |||
+ | See plugin in action here: http:// | ||
+ | |||
+ | ===== How to install it ===== | ||
+ | |||
+ | With plugin manager: [[https:// | ||
+ | |||
+ | Or without: unpack the zip in / | ||
+ | |||
+ | |||
+ | After installing, you must edit " | ||
+ | |||
+ | **WARNING: write '' | ||
+ | |||
+ | ===== Code ===== | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | if(!defined(' | ||
+ | if(!defined(' | ||
+ | require_once(DOKU_PLUGIN.' | ||
+ | |||
+ | /** | ||
+ | * All DokuWiki plugins to extend the parser/ | ||
+ | * need to inherit from this class | ||
+ | */ | ||
+ | class syntax_plugin_isns extends DokuWiki_Syntax_Plugin { | ||
+ | |||
+ | /** | ||
+ | * return some info | ||
+ | */ | ||
+ | function getInfo(){ | ||
+ | return array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | | ||
+ | /** | ||
+ | * What kind of syntax are we? | ||
+ | */ | ||
+ | function getType(){ | ||
+ | return ' | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Where to sort in? | ||
+ | */ | ||
+ | function getSort(){ | ||
+ | return 1; | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Connect pattern to lexer | ||
+ | */ | ||
+ | function connectTo($mode) { | ||
+ | $this-> | ||
+ | } | ||
+ | | ||
+ | /** | ||
+ | * Handle the match | ||
+ | */ | ||
+ | function handle($match, | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Create output | ||
+ | */ | ||
+ | function render($mode, | ||
+ | if($mode == ' | ||
+ | $n=$this-> | ||
+ | if (@$n) | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | |||
+ | function _IsNs() { | ||
+ | global $conf; | ||
+ | global $ID; | ||
+ | $pn=wikiFN($ID); | ||
+ | if ((!file_exists($pn)) && (is_dir(substr($pn, | ||
+ | ob_start(); | ||
+ | html_index($ID); | ||
+ | return ob_get_clean();; | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | //Setup VIM: ex: et ts=4 enc=utf-8 : | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Comments ===== | ||
+ | |||
+ | How can i modify that to bring " | ||
+ | |||
+ | ==== Solution ==== | ||
+ | |||
+ | I patched DokuWiki to do what you need (and me too). What my code does: If there is a page called " | ||
+ | |||
+ | I posted a patch here, but it is not accurate anymore. It had to be extended in some ways. If you are interested, better mail me for details. | ||
+ | |||
+ | You can see it in action [[http:// | ||
+ | |||
+ | Sadly enough, this is not a plugin and I don't know how to do it as a plugin. | ||
+ | -- Johannes Jordan (dokuwiki //at// lanrules.de) | ||