From e4ebc014011c8c1ae98a5de6d15c2aed76885e70 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 26 Feb 2025 20:15:06 -0600 Subject: [PATCH] Fix EPICS::PodXHtml and generate section links Overrides an internal method in Pod::Simple::XHTML that appends a section sign which links to this section. --- src/tools/EPICS/PodXHtml.pm | 23 +++++++++++++++++++++-- src/tools/style.css | 5 +++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/tools/EPICS/PodXHtml.pm b/src/tools/EPICS/PodXHtml.pm index d39212988..3a5e64502 100644 --- a/src/tools/EPICS/PodXHtml.pm +++ b/src/tools/EPICS/PodXHtml.pm @@ -7,8 +7,8 @@ use base 'Pod::Simple::XHTML'; BEGIN { if ($Pod::Simple::XHTML::VERSION < '3.16') { - # encode_entities() wasn't a method, add it - our *encode_entities = sub { + # Add encode_entities() as a method + sub encode_entities { my ($self, $str) = @_; my %entities = ( q{>} => 'gt', @@ -37,4 +37,23 @@ sub resolve_pod_page_link { return $ret; } +sub _end_head { + my $h = delete $_[0]{in_head}; + + my $add = $_[0]->html_h_level; + $add = 1 unless defined $add; + $h += $add - 1; + + my $id = $_[0]->idify($_[0]{htext}); + my $text = $_[0]{scratch}; + my $hid = qq{}; + my $link = qq{ §}; + $_[0]{'scratch'} = $_[0]->backlink && ($h - $add == 0) + # backlinks enabled && =head1 + ? qq{$hid$text $link} + : qq{$hid$text $link}; + $_[0]->emit; + push @{ $_[0]{'to_index'} }, [$h, $id, delete $_[0]{'htext'}]; +} + 1; diff --git a/src/tools/style.css b/src/tools/style.css index 09647403b..06df90945 100644 --- a/src/tools/style.css +++ b/src/tools/style.css @@ -69,6 +69,11 @@ A[href="#POD_ERRORS"] { color: #FF0000; } +A.sect { + color: #99ccff; + vertical-align: super; +} + TD { margin: 0; padding: 0;