help-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Struggling with a targeted [Contents] button


From: Rudolf Adamkovič
Subject: Struggling with a targeted [Contents] button
Date: Fri, 13 Sep 2024 18:56:22 +0200

Hi,

[I have been fighting the problem below for 3+ hours.]

In my HTML export, I would like to have

  a navigation button that links the current node in TOC,

the way

  texinfo_set_from_init_file('TOC_LINKS', 'true');

does.

So far, I have the following:

  sub _my_experiment_button {
      my ($self, $direction) = @_;

      # I SHOULD PROBABLY PASS IN SOME "COMMAND" ?!
      my $href = $self->command_contents_href(1, 'contents');
  
      return ("<a href=\"$href\">Contents</a>", 1);
  }
  
  my $experiment_button = ['This', \&_my_experiment_button];
  my $section_buttons = [ ... <snip> ..., $experiment_button];
  
  texinfo_set_from_init_file('SECTION_BUTTONS', $section_buttons);
  texinfo_set_from_init_file('SECTION_FOOTER_BUTTONS', $section_buttons);

The resulting [Contents] button

  links to the TOC file --- YAY! ---

but the link

  is missing the '#toc-...' anchor.

Any help would be *deeply* appreciated.

Thank you!

P.S. I am not a subscriber, so please CC.

Rudy
-- 
"All you have to do is write one true sentence.  Write the truest
sentence that you know."  --- Ernest Miller Hemingway (1899-1961)

Rudolf Adamkovič <rudolf@adamkovic.org> [he/him]
http://adamkovic.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]