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

  • From: Jason Keltz <jas@xxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 4 Aug 2007 21:26:19 -0400 (EDT)

On Sat, 4 Aug 2007, Sander Tekelenburg wrote:

At 11:52 -0400 UTC, on 2007-08-04, Jason Keltz wrote:
I can't think of what to do in the CSS
stylesheet for printing to toggle whether the TOC gets printed or not IN
the print.css.

In principle this should be solved by providing one or more extra Style
Sheets as alternates:

...
A reasonable way around that might be to not serve the print CSS as a
separate file, but serve all CSS as one file. Serve it as media=all (will be
the default in HTML5), and section parts of it to apply to specific media,
like so:

@media print
{
        .toc {display: none}
}

Any rules that are not within a media specific section will apply to all
media. (For an example: <http://webrepair.org/> uses this approach.)

If you then serve multiple such media=all Style Sheets, with differing print
rules, I would expect that to meet your goal nicely. I'd expect browsers
would give users  access to these Style Sheets through their built-n Style
Sheet selector, and apply the selected Style Sheet's print rules. (I haven't
actually tested it, but it seems likely.)

In fact, it might perhaps be practical if serving all CSS within a single
Style Sheet would be the default Dokuwiki set-up. Has that ever been
considered?

The only problem with this is that most browsers do not allow users to define
that a certain author Style Sheet must always be used at a site. So a
selection other than the default doesn't 'stick' across pages or subsequent
visits. (Could be solved at the server end with cookies ro some such, but
really should be solved by browsers.)

Hi.

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.
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: