X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/6f6495d7a6a021245a9d636ceabb8491285f88f2..fe5c48f3a002df1867d045b3767900f83817038a:/IkiWiki/Plugin/map.pm diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm index f2e8722c8..0ae5c1002 100644 --- a/IkiWiki/Plugin/map.pm +++ b/IkiWiki/Plugin/map.pm @@ -2,9 +2,9 @@ # # Produce a hyerarchical map of links. # -# By Alessandro Dotti Contra +# by Alessandro Dotti Contra # -# Revision: 0.1 +# Revision: 0.2 package IkiWiki::Plugin::map; use warnings; @@ -34,25 +34,30 @@ sub preprocess (@) { #{{{ # Create the map. my $indent=0; + my $openli=0; my $map = "
\n"; + $map .= "
    \n"; foreach my $item (sort @mapitems) { - my $depth = ($item =~ tr/\//\//) + 1; + my $depth = ($item =~ tr/\//\//); while ($depth < $indent) { $indent--; - $map.="
\n"; + $map.="\n"; } while ($depth > $indent) { $indent++; $map.="
    \n"; + $openli=0; } + $map .= "\n" if $openli; $map .= "
  • " - .IkiWiki::htmllink($params{page}, $params{destpage}, $item) - ."
  • \n"; + .IkiWiki::htmllink($params{page}, $params{destpage}, $item) ."\n"; + $openli=1; } while ($indent > 0) { $indent--; - $map.="
\n"; + $map.="\n"; } + $map .= "\n"; $map .= "
\n"; return $map; } # }}}