X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lilypond-texi2html.init;h=4e33ce43826461da048de62236e9b633cb19f012;hb=1f5e28e28f2d3faf57d6863080bf4ef8c04c9d60;hp=cf9a6df30cbde71eac45c0ef6c0a737de985ccc1;hpb=38d7d319eabc906e82fb42002678c6d42a23b6f7;p=lilypond.git diff --git a/lilypond-texi2html.init b/lilypond-texi2html.init index cf9a6df30c..4e33ce4382 100644 --- a/lilypond-texi2html.init +++ b/lilypond-texi2html.init @@ -312,7 +312,7 @@ my $node_to_filename_map = (); # according to node titles, which works by simply overriding the id element of # the $element hash. # If an external nodename<=>filename/anchor map file is found (loaded in -# lilypond_init_out, use the externally created values, otherwise use the +# the command handler, use the externally created values, otherwise use the # same logic here. sub lilypond_element_file_name($$$) { @@ -564,6 +564,19 @@ sub lilypond_external_href($$$) my $page_toc_depth = 2; my @default_toc = []; + +# Initialize the toc_depth to 1 if the command-line option -D=short_toc is given +sub lilypond_init_toc_depth () +{ + if (exists($main::value{'short_toc'}) and not exists($main::value{'bigpage'})) { + $page_toc_depth = 1; + } +} +# Set the TOC-depth (depending on a texinfo variable short_toc) in a +# command-handler, so we have them available when creating the pages +push @Texi2HTML::Config::command_handler_process, \&lilypond_init_toc_depth; + + # recursively generate the TOC entries for the element and its children (which # are only shown up to maxlevel. All ancestors of the current element are also # shown with their immediate children, irrespective of their level.