Changes between Version 4 and Version 5 of NavigationMenuPlugin


Ignore:
Timestamp:
Dec 9, 2006, 8:57:27 PM (8 years ago)
Author:
Beider
Comment:

New way more advanced version

Legend:

Unmodified
Added
Removed
Modified
  • NavigationMenuPlugin

    v4 v5  
    33== Description ==
    44
    5 This is a combination of the SubWiki and TocMacro plugin/macros. Basically it let's you have subtree browsing in a TracGuideToc menu style. Also allows for some usage of default menus.
     5=== General ===
    66
    7 Most of the credit goes to the creators of the original hacks. I just combined them into one big ugly hack.
     7This is a newer version of the menu. It was originally just a simple menu based on SubWiki and TocMacro but now I have expanded it with a bunch of new functionality to make it more flexible. This menu is intended to be a heavy setup / low maintainance menu.
    88
    9     If no parameters are supplied it generates the menu from the current page and any
    10     subpages it may have.
    11     {{{
    12         [[TOC]]
    13     }}}
    14     To generate subtrees from multiple pages you may pass in something like.
    15     {{{
    16     [[TOC(Trac, Wiki)]]
    17     }}}
    18     The following ''control'' arguments change the default behaviour of
    19     the TOC macro:
    20     || '''Argument'''    || '''Meaning''' ||
    21     || {{{heading=<x>}}} || Override the default heading of &#34;Table of Contents&#34; ||
    22     || {{{noheading}}}   || Suppress display of the heading. ||
    23     || {{{inline}}}      || Display TOC inline rather than as a side-bar. ||
    24     || {{{defmenu=<x>}}} || A default menu. Usefull if you add / remove subtrees often. ||
    25     Note that the current page must also be specified if individual wiki
    26     pages are given in the argument list.
    27    
    28     Defmenu usage:
    29    
    30     First make a page like:
    31    
    32     !http://localhost:8000/my-project/wiki/DefaultMenu
    33    
    34     Then on this page write a couple of comma separated pages you would like to have listed,
    35     just like you would do with normal parameters:
    36    
    37     Trac,Wiki
    38    
    39     Then add {{{[[TOC(defmenu=DefaultMenu)]]}}} to every page you want the menu on, now instead of
    40     having to change every page when you want to change the menu. You can just change the defaultmenu
    41     page.
     9Here is a list of the most general features.
     10
     11 - A default menu for all pages read from a wikipage (DefaultNavigationMenu)
     12 - Ability to add sections or include other menus within menus (like the default one)
     13 - Ability to generate subtrees from pages
     14 - Ability to use WikiFormatting inside the menu
     15 - Generate a menu over headings on the current page
     16
     17=== Menu scripting documentation ===
     18
     19First of all make a new page called !DefaultNavigationMenu, and then add the {{{[[TOC]]}}} reference into some page where you want the menu, NOT on !DefaultNavigationMenu
     20
     21''Optional Way''[[BR]]
     22Make a new page called whatever you like, example : !MyMenu. Then add {{{[[TOC(incmenu=MyMenu]]}}} to the page where you want to display the menu.
     23
     24Now go and edit either DefaultNavigationMenu or the page you decided on for your menu. Then just start designing the menu as you like with the commands below, use new line (enter) to separate commands. You may also add empty lines but you may not have two commands on the same line.
     25
     26|| '''Argument'''       || '''Meaning''' ||
     27|| SETTINGS             ||               ||
     28|| {{{heading=<x>}}}    || Override the default heading of "Table of Contents" ||
     29|| {{{noheading}}}      || Suppress display of the heading. ||
     30|| {{{inline}}}         || Display TOC inline rather than as a side-bar. ||
     31|| ACTIONS              ||                             ||
     32|| #text                || A comment line. Start the line with a has sign (#) ||
     33|| {{{[CPH]}}}          || Creates a page header list for the current page ||
     34|| {{{[S]Some/Page/Path}}} || Starts a section. If you specify something like !GameDesign, it will display on the !GameDesign page and all subpages !GameDesign/*. Sections can have multiple subsections. Note: It will also display on any similar pages like !GameDesign2/*. ||
     35|| {{{[!S]x}}}  || Ends the last opened section. You may place a comment where it says x to make it easier to read ||
     36|| {{{[N]}}}    || New line. Adds an empty line, similar to {{{[[BR]]}}} for WikiFormatting ||
     37|| {{{[H]x}}}   || Adds a header with the text x. ||
     38|| {{{[***}}}   || Starts a WikiFormatting section. Make sure you close it because all menu commands are ignored inside it, and it will not be rendered unless it is closed. You may include macros / other plugins or just wiki format code. Has to be written on a line by itself. ||
     39|| {{{***]}}}   || Ends the WikiFormatting section. Make sure you close all WikiFormatting sections or they will not render. ||
    4240
    4341== Bugs/Feature Requests ==
     
    5957== Example ==
    6058
    61 Some examples:
     59=== Page : !TestMyMenu ===
     60{{{
     61== Test My Menu ==
     62[[TOC]]
     63}}}
    6264
     65=== Page: !DefaultNavigationMenu ===
    6366{{{
    64 [[TOC(defmenu=DefaultMenu)]]
     67# This is the default navigation menu page
     68# Any page that simply specify {{{[[TOC]]}}} will get this menu.
    6569
    66 [[TOC(heading=My Heading,Wiki,Trac,defmenu=SomeDefMenuPage)]]
     70heading=Default Navigation Menu
    6771
    68 [[TOC]]
     72#This will create a subtree for all pages that starts with Wiki
     73Wiki
    6974
    70 [[TOC(RootPageOne,RootPageTwo,RootPageThree)]]
     75#Makes a new line
     76[N]
     77#Creates a link to all pages starting with TracNotification
     78TracNotification
     79
     80#Only Show this section on pages starting with Trac
     81[S]Trac
     82
     83   #Overwrite the heading
     84   heading=Trac Section!
     85
     86   #A new line and a header saying Trac
     87   [N]
     88   [H]Trac
     89   #Generate subtree for all pages starting with Trac
     90   Trac
     91
     92   [S]TracNotification
     93      #Only show this on pages starting with TracNotification
     94     
     95      [N]
     96      [H]Where am i?
     97      [*** Start of WikiFormatting code
     98
     99         You are now on the TracNotification page!
     100
     101      ***] End WikiFormatting Code
     102      [N]
     103
     104      #Imports another menu at this point
     105      incmenu=Menus/TracNotificationMenu
     106
     107   [!S] End TracNotification Section
     108
     109[!S]End Trac Section
     110
     111[N]
     112[H]The time is
     113[*** WikiFormatting Begins
     114[[Timestamp]]
     115***] WikiFormatting Ends
    71116}}}
    72117