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 [2022-07-06 16:19] – fwfewfe 2001:16a2:c584:1e00:947f:cc7c:ca78:8efplugin:nstoc [2023-10-30 22:52] (current) Klap-in
Line 1: Line 1:
-fewfewfewfweewfew+[[de:plugin:nstoc|deutsch]] 
 +====== NsToC Syntax Plugin ====== 
 + 
 +---- plugin ---- 
 +description: Namespace Table-of-Content 
 +author     : Matthias Watermann 
 +email      : support@mwat.de 
 +type       : syntax 
 +lastupdate : 2010-02-18 
 +compatible : Frusterick Manners, !Hogfather 
 +depends    : 
 +conflicts 
 +similar    : tocselect 
 +tags       : navigation, menu, listing, namespace, !broken 
 + 
 +downloadurl: http://dev.mwat.de/dw/syntax_plugin_nstoc.zip 
 +---- 
 + 
 +A while ago I started a project involving lots of hierar­chi­cally orde­red pa­ges -- just like a book with chapters, sub-chap­ters and para­graphs. 
 +To add (and up­date whenever a page was ad­ded/re­mo­ved/mer­ged) the TOC re­fe­ren­ces was a neces­sary but quite stu­pid job((In other words: just what com­pu­ters were made for.)). 
 +After doing this pesky task for quite a few ti­mes I de­ci­ded to auto­mate it. --- 
 +Enter "''nstoc''"
 + 
 +This plugin offers you the ability to gene­rate a //Table Of Con­tents// for a na­me­space with an optio­nal depth. 
 +It gene­rates a (possi­bly nested) list of head­lines used in all mat­ched pages. 
 + 
 +One could say this plugin sees your whole Wiki as one huge docu­ment struc­tured by chap­ters (Wiki name­spaces), sub-chap­ters (the single pa­ges within a name­space) and ap­pro­pri­ate head­lines (H1...H5). 
 + 
 +===== Usage ===== 
 + 
 +The basic markup is just: 
 + {{nstoc }} 
 +This will create a nested list of all pages((actually, the //head­lines// in/of the pages are shown)) in the cur­rent name­space and all sub-na­me­spa­ces. 
 +Please note the space((''space'', ASCII char #32; not to be con­fu­sed with a ''blank'', ASCII char #255)) be­hind the "''nstoc''" key­word: 
 +For­get­ting it will trigger Do­ku­Wiki's built-in ''media'' ren­de­rer which you most pro­bab­ly do //not// want here. 
 + 
 +To limit the output to -- say -- two levels use 
 + {{nstoc 2}} 
 +The result will be a list with all H1 and H2 head­lines in the cur­rent na­me­space's pages and all H1 head­lines in the pages of all sub-na­me­spaces of the cur­rent one while 
 + {{nstoc 3}} 
 +will pro­duce a list with all H1/H2/H3 head­lines in the current na­me­space's pa­ges, all H1/H2 head­lines in the pages of all sub-name­spa­ces of the cur­rent one and all H1 head­lines in the pa­ges of all sub-sub-name­spaces. 
 + 
 +Another way to limit the output is to expli­citly name the name­space: 
 + {{nstoc chapter2}} 
 +This will show the head­lines (with unlimi­ted depth) in the "''chapter2''" name­space. 
 + 
 +You may, of course, combine the optional //name­space// and //depth// ar­gu­ments: 
 + {{nstoc chapter3 1}} 
 +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 ==== 
 + 
 +Here are some tips which might be help­ful for you when wor­king with this plugin. 
 + 
 +=== Order === 
 + 
 +The generated output -- or, to be more precise: the //order// of the ge­ne­ra­ted list -- might not always be what you'd expect. 
 +The reason for this: You, as a hu­man be­ing((I hope ...)), have a no­tion of //meaning// while the com­puter just knows about //data//. 
 +To illu­strate this let's as­su­me you're wri­ting a book. 
 +Right now you've fini­shed (or at least crea­ted) this pa­ges: 
 + 
 + - Preface 
 + - Introduction 
 + - First Chapter 
 + - Second Chapter 
 + - Appendix 
 + 
 +When using "''nstoc''" you'll most probably expect a list like the one above. 
 +But, alas, the real result would look like 
 + 
 + * Appendix 
 + * First Chapter 
 + * Introduction 
 + * Preface 
 + * Second Chapter 
 + 
 +Not very helpful, is it? --- The reason is simple: 
 +The only thing DokuWiki and this plugin has to deal with are (file and namespace) //names//
 +But, as it turns out, it's quite easy for you to take this fact to your advan­tage by choo­sing the right page names. 
 +For example, name the pages((i.e. the files but //not// the H1 head­line)) like this: 
 + 
 + * 00_preface 
 + * 01_introduction 
 + * 02_first_chapter 
 + * 03_second_chapter 
 + * 99_appendix 
 + 
 +Theoretically you could even omit all the alphas and just leave the di­gits. 
 +But I guess, that would take the compu­te­ri­zing of your work a bit too far. 
 +Any­way, as long as the pa­ge and name­space //names// sort in the inten­ded order, "''nstoc''" will pro­duce useful out­put.
  
 BTW: This discussion applies to name­space names as well. BTW: This discussion applies to name­space names as well.
plugin/nstoc.1657117165.txt.gz · Last modified: 2022-07-06 16:19 by 2001:16a2:c584:1e00:947f:cc7c:ca78:8ef

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