Outliner plugin

This DokuWiki plugin introduces outline page layout.

Fragments of page can consist from nested collapsible nodes. Clicking on outline node title will expand or collapse it. If the node is collapsed, floating tip with node content is displayed on
mouse hover (this can be disabled per node).

Each node state is saved into cookie, so state of whole outline tree is remembered on each page visit.

Prerequisities

You will need dokuwiki version later than 2005-08-02 which has support for plugin subfolders.

Example code

--> Top level text

 --> Next level information
 Stuff in next level

 <-- Next level information
^ Closes next-level section


<-- Top level text
^ Closes top level section


--> Second top-level section

<-- Second top-level section

Make sure you have the line breaks!

Syntax

To define simple outline layout, use:

--> Outline title

To open outline node, and:

<-- Outline title

to close it.

Outline node tag must start on new line and can be preceeded by any amount of space. Text after node closing tag is ignored,
it‘s useful for marking each closing tag to pair it with starting tag easily when reading the raw dokuwiki text.

You can append ^ at the end of opening tag, to specify that such node will be initially expanded:

--> Outline title ^

You can append # at the end of opening tag, to disable mouseover popup on that node:

--> Outline title #

Of course yo can combine these, no matter in what order you put it:

--> Outline title #^

or

--> Outline title ^#

or even

--> Outline title  #  ^

Nodes can be nested:

--> Outline 1
This text is part of node 1

  --> Outline 2

This text is part of node 2

    --> Outline 4

This text is part of node 4

    <-- Outline 4

This text is part of node 2

  <-- Outline 2

This text is part of node 1

  --> Outline 3

This text is part of node 3

  <-- Outline 3

This text is part of node 1
<-- Outline 1

Example

F16 Shelter
--> Outline 1 initially open ^
This text is part of node 1
  --> Outline 2
This text is part of node 2
    --> Outline 4 without popup #
This text is part of node 4
    <-- Outline 4
    --> Outline 5
This text is part of node 5
    <-- Outline 5
This text is part of node 2
  <-- Outline 2
This text is part of node 1
  --> Outline 3
This text is part of node 3
  <-- Outline 3
This text is part of node 1
<-- Outline 1

Download

NOTE: This version of outliner is not compatible with Dokuwiki versions above 2006-11-06.

There is latest version 1.7.1 for download.
Mirror 1
Mirror 2

Unzip it into dokuwiki plugins folder.
Then edit included style.css file and define your favorite style.

History

  • , Version 1.7.1:
    • Fixed: Typo in CSS for floating hints. Thanks to Chris.
    • Fixed: Starting regexp destroyed page layout in some cases. Thanks to Henry Olders.
  • , Version 1.7:
    • Changed: Changed the way how spacing is done. Removed blank.gif approach, changed to style sizing
    • Tweak: Renamed layers and javascript function names to avoid conflicts (appended outliner_)
    • Added: # flag to specify no-popup
    • Tweak: Changed flags detection at the end of line
    • Tweak: New line after closing tag is no more needed
  • , Version 1.6.1:
    • Fixed: Changed the code so it does work with the latest development Dokuwiki (js and css compression issue)
  • , Version 1.6:
    • Fixed: IDs of nodes generated randomly, now works with ifauth plugin
    • Fixed: Change plugin order to work with some other plugins correctly
    • Fixed: Some small changes in generated markup
  • , Version 1.5:
    • Fixed: Ending tag without preceding starting tag will be ignored
  • , Version 1.4:
    • Fixed starting regexp to accept all characters after -->
  • , Version 1.3:
    • Added checking for ending <-- tag in starting regex
  • , Version 1.2:
    • Added ^ modifier to specify initially open node
    • Fixed reading of node state from cookies
    • Changed PType from block to normal so redundant paragraphs are not created
    • Tweaked CSS block sizes little bit
    • Commented CSS
  • , Version 1.1:
    Fixed ending tag detection so the text after <-- is not required.
  • Version 1.0:
    Initial version

Bugs

  • When title contains non-ascii characters, it doesn‘t recognize node start (have to change regexp).
  • Some flickering in Mozilla/Firefox. No idea what causes it. domTT javascript doing something weird?
  • If ACL is used, you lose your Login Information after expanding a Outliner, and need to relogin!
  • It seems there‘s a bug using tables inside. Try this code :
--> Try with a table inside

^ Title 1 ^ Title 2 ^ Title 3 ^
| cont 1  | cont 2  | cont 3  |
| cont 1.1  | cont 2.1  | cont 3.1  |
| cont 1.2  | cont 2.2  | cont 3.2  |
| cont 1.3  | cont 2.3  | cont 3.3  |

<-- Try with a table inside

Fred 2007/06/18

  • This plug-in does not work with Dokuwiki versions newer than 2006-11-06 — Gary 2007/08/04

Todo

  • Add tag to define initially expanded node 1.2 Done
  • Add modifier to force always collapsed/expanded node (no state saving). + and - should be used.
  • domTT script is filling the tooltip div after showing it, it causes unpleasant sluggish redrawing when tooltip is first shown.
  • Make nodes editable separately (like sections). No idea how to achieve this.
  • Cleanup code
  • Add this page to dokuwiki official (?)

Notes

  • Plugin uses domTT.js javascript to manipulate floating hints. This file should be included in latest versions of DokuWiki, located inside /lib/scripts/ folder.
  • This plugin needs support for subfolders inside plugin folder. It was introduced in DokuWiki on 08-02-2005. So it will not work in older releases. It is possible to make it working in older version by splitting plugin into two plugins.

Feature suggestions

Great work on the outliner! It would be great to be able to specify a numbering scheme for the outline. In particular, we often use 1.0, 1.1, 1.1.1, 1.2.1.x…. style number for requirements and other docs that we create using DokuWiki - but this is only one type of numbering that people might like to see. If you could implement a framework for specifying a numbering scheme, and one or two implementations, I‘m sure the community would add more variants to the package.
Interesting idea. I will consider what can be done here, will not be easy task… — Pavel 2005/11/04 14:04

Discussion

I am using this plugin with DokuWiki on a Stick http://www.splitbrain.org/blog/2007-12/01-dokuwiki_on_a_stick#MTC_form which is version 2007-06-26b but it seems that the plugin is not working. It will not expand when I click on it, the cursor changes to a hand but when I click on it nothing. I have tried it with FireFox and two versions of IE but its all the same. Any ideas

Expand
 
dokuwiki/plugin/outliner.txt · Last modified: 2008/04/16 13:50 UTC by 92.195.16.22
 
Recent changes RSS feed Creative Commons License Donate to DokuWiki author Valid XHTML 1.0 Valid CSS Driven by DokuWiki Debian served Run on Apache Powered by PHP eAccelerated