[dokuwiki] Re: Alternate views/presentations (Re: table of contents)

  • From: Myron Turner <turnermm02@xxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 04 Aug 2007 22:48:10 -0500

Jason Keltz wrote:

I wonder if instead of using the standard DokuWiki TOC, if I wrote a TOC "plugin" that allows you to insert a TOC anywhere in the page using something like "~~TOC~~". I guess the user would have to disable the standard toc (through I think ~~NOTOC~~) somewhere in the page, and then use ~~TOC~~ somewhere (which I don't think is presently in use). I guess (although I'm not sure since I'm not overly familiar with the DokuWiki code) would just be a call to whatever function in DokuWiki is already called to generate a TOC. Now, I could have a plugin option to enable/disable printing of the TOC. The toc that I display might be wrapped in some kind of class which indicates whether the toc would get displayed, or just printed... Chris? Andi? does this make any sense.

jas.
Why go through all this trouble? You could simply write a bit of php code that inserts a style sheet into the main page somewhere after the stylesheets have been loaded:

if ($_GET['toc']) {
echo ' <style media="print" type="text/css">.toc {display: block;}</style>';
}

Then the user who wants a table of contents could add the toc parameter to the url:
   http:///web_site/wiki/doku.php?id=start&toc=1

I actually played with a few javascript options, severalk of which work in Firefox, none of them in IE6.

--

_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/


--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: