nspages Plugin
Zeigt das Inhaltsverzeichnis und optional die untergeordneten Namensräume1) eines gegeben Namensraums an.
Die Benutzung ist einfach, schreibe einfach
<nspages>
und sieh dir das Ergebnis an. (Du kann auch einfach in der Toolbar des Wiki Editors anklicken.
Die allgemeine Syntax ist
<nspages namespace_pfad -option1 -option2 ...>
Beschreibung:
namespace_pfad
Absoluter (z.B.:namespace1:subnamespace
) oder relativer Pfad (ex:.:subnamespace
). Wenn nichts angegeben wird, gilt der aktuelle Namenraum.-option
kann eine oder mehrere der folgenden Angaben sein:
Common options | |
---|---|
-subns | displays the subnamespaces of the selected namespace (and provide links to their main page) |
-nopages | do not list the pages of the selected namespace (of course this option is useful only if you use -subns ) |
-exclude:nameOfPage | won't include the page nameOfPage. This option may be use several times in order to exclude several pages |
-exclude:subNs: | won't include the subnamespace subNs. This option may also be used more than once |
-exclude | won't include the current page |
-h1 | will display the first h1 title found. If a page doesn't contain such a title, the name of the page is used instead |
-textPages="some text" | some text will be displayed instead of the default text, to introduce the pages list |
-textNS="some text" | some text will be displayed instead of the default text, to introduce the namespaces list |
-title | alias of -h1 |
-simpleList | display the list on a single column |
-numberedList | display the list on a single column, as an ordered list |
-simpleLine | display the list on a single line (incompatible with -simpleList ) |
-simpleLineBreak | display the list on a single column, separated only by line breaks (incompatible with the previous flags) |
-nbCol=3 | Change the number of columns to use (default is 3 ) |
-sortId | Sort the pages according to their id, even if -title is used |
Less common options | |
---|---|
-reverse | Sort the pages in reverse order |
-naturalOrder | Sort the pages in natural order |
-sortByDate | Sort the pages by date of last modification |
-pagesInNs | The pages will appear among the namespaces |
-r | recurse : display elements of the subnamespaces. You may use just -r to check every subnamespace, or e.g. -r=3 to have a depth limit to 3 levels |
-exclude:[page1 subNs: page2] | an easier syntax to exclude several pages/subnamespaces |
-pregPagesOn -pregPagesOff -pregNSOn -pregNSOff | Enable the use of regex to select the documents that should be displayed. Eg: -pregPagesOn="/doku/i" will display only pages which contains "doku" in their id.Several options may be used, and each of them may be used several times. |
-anchorName=myName | Add anchors on each title-letters, to let link directly to them. Anchors will look like, e.g. for the letter A: nspages_myName_A |
-actualTitle | print an actual html title (not just a bold and underlined text) |
-actualTitle=n | print an actual html title <hn> |
-idAndTitle | Use the format "id of the item - title of the item" |
-nbItemsMax=n | Display at most n pages or subnamespaces |
-hideNoPages | Hide page header and "no pages" message if no pages present |
-hideNoSubns | Hide subnamespace header and "no subnamespace" message if no subns present |
ex: Unternamensraum:
or
will work.
Installation
If you have one of the latest version of DokuWiki (at least 2009-12-25, Lemmings), you may use this archive: https://github.com/gturri/nspages/zipball/master.
Some (important) points
- With version older than 2014-08-10, you should put ~~NOCACHE~~ in the pages where you use this plugin, to make sure that if you create or remove a page in the namespace, it will be taken into account. Now, nspages automatically deactivate the cache on the pages where it is used (you can deactivate this behaviour on the admin panel).
- The CSS sheet should be taken into account in order for this plugin to work correctly; but because of the cache system it may not be the case the first time you use this plugin (even if ~~NOCACHE~~ is specified). The easier way to resolve this is to make sure your cache is invalidated by touching
conf/local.php
(eg. by resaving your configuration) - When you change the default markup inserted by the toolbar button (throught the admin dashboard), you may need to purge your caches to have this change taken into effect (see also the bug report):
- Clean the cache of you DokuWiki
- Force your browser to reload it's cache, typically by pressing Ctrl+F5, or Shift+F5
Donate
nspages is a personal open source project started in 2008. I have put hundreds of hours to maintain and enhance it.
Donations to nspages will help support bugfix, keeping compatibility with upcoming versions of DokuWiki, and adding new features.
If you have found this plugin useful, consider donating, to help for its development.