summaryrefslogtreecommitdiff
path: root/doc/todo
diff options
context:
space:
mode:
authorhttp://kerravonsen.dreamwidth.org/ <http://kerravonsen.dreamwidth.org/@web>2009-12-25 19:40:59 +0000
committerJoey Hess <joey@finch.kitenet.net>2009-12-25 19:40:59 +0000
commit6e632de82550e5d028391e74beb302b80bd9f7a6 (patch)
tree42ecddf4e0449a146d56c57aacf355aec2225e5c /doc/todo
parent3a1c8c2b463b8a4f6b3b2c866c5e1b1500f95193 (diff)
patch in diff -u format
Diffstat (limited to 'doc/todo')
-rw-r--r--doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn47
1 files changed, 33 insertions, 14 deletions
diff --git a/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn b/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn
index ce51d90a3..53cb0dd7c 100644
--- a/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn
+++ b/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn
@@ -10,19 +10,38 @@ Currently, the levels=X parameter lets you tweak how deep it will go for small h
> > projects prefer to receive changes as unified diffs (or as
> > branches in their chosen VCS, which is [[git]] here). --[[smcv]]
- 56,57c56,57
- < my $curlevel;
- < my $startlevel=0;
- ---
- > my $startlevel=($params{startlevel} ? $params{startlevel} : 0);
- > my $curlevel=$startlevel-1;
- 69a70
- > # unless we're given startlevel as a parameter
- 73a75,79
- > elsif (defined $params{startlevel}
- > and $level < $params{startlevel})
- > {
- > return;
- > }
+> > > Done. -- [[KathrynAndersen]]
+
+
+ --- /files/git/other/ikiwiki/IkiWiki/Plugin/toc.pm 2009-11-16 12:44:00.352050178 +1100
+ +++ toc.pm 2009-12-26 06:36:06.686512552 +1100
+ @@ -53,8 +53,8 @@
+ my $page="";
+ my $index="";
+ my %anchors;
+ - my $curlevel;
+ - my $startlevel=0;
+ + my $startlevel=($params{startlevel} ? $params{startlevel} : 0);
+ + my $curlevel=$startlevel-1;
+ my $liststarted=0;
+ my $indent=sub { "\t" x $curlevel };
+ $p->handler(start => sub {
+ @@ -67,10 +67,16 @@
+
+ # Take the first header level seen as the topmost level,
+ # even if there are higher levels seen later on.
+ + # unless we're given startlevel as a parameter
+ if (! $startlevel) {
+ $startlevel=$level;
+ $curlevel=$startlevel-1;
+ }
+ + elsif (defined $params{startlevel}
+ + and $level < $params{startlevel})
+ + {
+ + return;
+ + }
+ elsif ($level < $startlevel) {
+ $level=$startlevel;
+ }
[[!tag patch]]