(no commit message)
[ikiwiki] / doc / todo / toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn
1 It would be nice if the [[plugins/toc]] plugin let you specify a header level "ceiling" above which (or above and including which) the headers would not be incorporated into the toc.
2
3 Currently, the levels=X parameter lets you tweak how deep it will go for small headers, but I'd like to chop off the h1's (as I use them for my page title) -- [[Jon]]
4
5 > This change to toc.pm should do it. --[[KathrynAndersen]]
6
7 > > The patch looks vaguely OK to me but it's hard to tell without
8 > > context. It'd be much easier to review if you used unified diff
9 > > (`diff -u`), which is what `git diff` defaults to - almost all
10 > > projects prefer to receive changes as unified diffs (or as
11 > > branches in their chosen VCS, which is [[git]] here). --[[smcv]]
12
13         56,57c56,57
14         <       my $curlevel;
15         <       my $startlevel=0;
16         ---
17         >       my $startlevel=($params{startlevel} ? $params{startlevel} : 0);
18         >       my $curlevel=$startlevel-1;
19         69a70
20         >                       # unless we're given startlevel as a parameter
21         73a75,79
22         >                       elsif (defined $params{startlevel}
23         >                              and $level < $params{startlevel})
24         >                       {
25         >                           return;
26         >                       }
27
28 [[!tag patch]]