DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:nstoc

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:nstoc [2011-08-03 15:07] – [Discussion] 212.59.43.2plugin:nstoc [2023-10-30 22:52] (current) Klap-in
Line 1: Line 1:
-[[plugin:nstoc:deutsch]] +[[de:plugin:nstoc|deutsch]] 
-====== NsToC Syntax PlugIn ======+====== NsToC Syntax Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 8: Line 8:
 type       : syntax type       : syntax
 lastupdate : 2010-02-18 lastupdate : 2010-02-18
-compatible : 2005-07-13++compatible : Frusterick Manners, !Hogfather
 depends    : depends    :
 conflicts  : conflicts  :
-similar    : +similar    : tocselect 
-tags       : navigation, menu, listing, namespace+tags       : navigation, menu, listing, namespace, !broken
  
 downloadurl: http://dev.mwat.de/dw/syntax_plugin_nstoc.zip downloadurl: http://dev.mwat.de/dw/syntax_plugin_nstoc.zip
Line 48: Line 48:
  {{nstoc chapter3 1}}  {{nstoc chapter3 1}}
 Here only the H1 head­lines of the pages in "''chapter3''" will be shown. Here only the H1 head­lines of the pages in "''chapter3''" will be shown.
 +
 +==== Compatibility ====
 +
 +This plugin is also compatible with 2005-07-13 and was made for that version. It's compatible with 2017 Frusterick Manners but not Hogfather.
 +
  
 ==== Hints ==== ==== Hints ====
Line 200: Line 205:
  
 ===== Installation ===== ===== Installation =====
-It's quite easy to integrate this plugin with your DokuWiki: +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
- +
- - Download the [[http://dev.mwat.de/dw/syntax_plugin_nstoc.zip|source archive]] (~9KB) and un­pack it in your Doku­Wiki plug­in di­rec­tory ''{dokuwiki}/lib/plugins'' (make sure, in­clu­ded sub­di­rec­to­ries are un­packed cor­rect­ly); this will create the directory ''{dokuwiki}/lib/plugins/nstoc''. +
- - Make sure both the new direc­tory and the files therein are read­able by the web-server e.g.<code> +
- chown apache:apache dokuwiki/lib/plugins/* -Rc +
-</code> +
- +
-You might as well use the [[plugin:plugin|plugin manager]] for installing or updating this plugin.+
  
 +  * http://dev.mwat.de/dw/syntax_plugin_nstoc.zip
 ===== Plugin Source ===== ===== Plugin Source =====
  
Line 216: Line 215:
 <?php <?php
 if (! class_exists('syntax_plugin_nstoc')) { if (! class_exists('syntax_plugin_nstoc')) {
-if (! defined('DOKU_PLUGIN')) { 
-  if (! defined('DOKU_INC')) { 
-    define('DOKU_INC', realpath(dirname(__FILE__) . '/../../') . '/'); 
-  } // if 
-  define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/'); 
-} // if 
-// Include parent class: 
-require_once(DOKU_PLUGIN . 'syntax.php'); 
-// library providing the global 'auth_aclcheck()' function: 
-require_once(DOKU_INC . 'inc/auth.php'); 
-// library providing the global 'wl()' function: 
-require_once(DOKU_INC . 'inc/common.php'); 
-// library providing the global 'search()' function: 
-require_once(DOKU_INC . 'inc/search.php'); 
-// library providing the global 'cleanID()'/'getID()'/'wikiFN()' functions: 
-require_once(DOKU_INC . 'inc/pageutils.php'); 
  
 /** /**
Line 692: Line 675:
    * @static    * @static
    */    */
-  function handle($aMatch, $aState, $aPos, &$aHandler) {+  function handle($aMatch, $aState, $aPos, Doku_Handler $aHandler) {
     if (DOKU_LEXER_SPECIAL != $aState) {     if (DOKU_LEXER_SPECIAL != $aState) {
       // This causes "render()" to do nothing ...       // This causes "render()" to do nothing ...
Line 1227: Line 1210:
 >> Yep I have the same problem in my wiki too,... namespaces in Greek don't show up, but this is inconsistent... some cases work some others don't, the mb_ extension is not available atm on that PHP environment could it be related ?  --- [[user>petsagouris|George Petsagourakis]] //2011/02/13 12:54// >> Yep I have the same problem in my wiki too,... namespaces in Greek don't show up, but this is inconsistent... some cases work some others don't, the mb_ extension is not available atm on that PHP environment could it be related ?  --- [[user>petsagouris|George Petsagourakis]] //2011/02/13 12:54//
 \\ \\
-I want to change the default green color but I don't know how to solve this. I try with the style.css in nstoc dir but it doesn't cnange anything .. [[isma.ballo@gmail.com|Isma]] //2011/02/16 14:00//+ 
 +I want to change the default green color but I don't know how to solve this. I try with the style.css in nstoc dir but it doesn't cnange anything .. [[isma.ballo@gmail.com|Isma]] //2011/02/16 14:00//
 \\ \\
 +\\
 +
 +>  Hello, in handle function at line 488 why are you passing a string at param 3 for the substr function ? When cache is regenerated i got warning about this param which should be a long instead of a string...
 +>  I suggest that : 
 +><code=php>$dir = substr($current, 0, -mb_strlen(strrchr($current, ':')));</code>
 +> --- [[user>JohanGuilbaud|JohanGuilbaud]] //2011/10/11 09:18//
  
 ===== Feature Requests ===== ===== Feature Requests =====
Line 1234: Line 1224:
 This plugin is almost perfect, but something is missing: I use the numbered heading plugin to automatically number my sections, but these numbers are not shown in the TOC build by this plugin. Maybe this could be solved by just using the built-in TOC generator of DokuWiki, so you can provide the same design and same features. ~~~~ This plugin is almost perfect, but something is missing: I use the numbered heading plugin to automatically number my sections, but these numbers are not shown in the TOC build by this plugin. Maybe this could be solved by just using the built-in TOC generator of DokuWiki, so you can provide the same design and same features. ~~~~
  
 +==== Play well with publish plugin ====
 +Thanks for putting this together, I use it all over the place.  My one request would be to see if you could make the plugin play well with  [[plugin:publish|publish plugin]].  I realize you can play well with every plugin, but draft is pretty popular.  In particular, it would be great to have an option so that a page that is saved in draft form but does not currently have any published versions would not show up in the list.
  
 +==== List length ====
 +It would be great, if it is possible to restrict the headlinelist.
 +like:
 + [[nstoc [namespace [maxdepth][maxlength]]
plugin/nstoc.1312376846.txt.gz · Last modified: 2011-08-03 15:07 by 212.59.43.2

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