From be877a4b045e6d9ea61b2cd53491772aa92b9310 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Sun, 17 Dec 2017 12:16:50 +0000 Subject: [PATCH] commandref: add more language links (Forum #81087) git-svn-id: https://svn.fhem.de/fhem/trunk@15629 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/commandref_join.pl | 27 +++++++++++++++++++++------ fhem/docs/commandref_frame.html | 1 - fhem/docs/commandref_frame_DE.html | 1 - fhem/www/pgm2/defaultCommon.css | 5 ++++- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/fhem/contrib/commandref_join.pl b/fhem/contrib/commandref_join.pl index 1a5d17260..d964b9675 100755 --- a/fhem/contrib/commandref_join.pl +++ b/fhem/contrib/commandref_join.pl @@ -74,6 +74,20 @@ printList($) last; } } +my $var; +sub +chkAndGenLangLinks($$$) +{ + my ($l, $lang, $fh) = @_; + $var = $1 if($l =~ m/<\/a>/); + if($l =~ m/(.*?)<\/h3>/ && $var) { + print $fh "\n"; + $var = undef; + } +} foreach my $lang (@lang) { my $suffix = ($lang eq "EN" ? "" : "_$lang"); @@ -100,6 +114,8 @@ foreach my $lang (@lang) { while(my $l = ) { # Header last if($l =~ m/name="perl"/); print OUT $l; + chkAndGenLangLinks($l, $lang, \*OUT); + printList($1) if($l =~ m//); } @@ -110,8 +126,11 @@ foreach my $lang (@lang) { # Copy the tail print OUT '',"\n"; + $var = "perl"; + while(my $l = ) { print OUT $l; + chkAndGenLangLinks($l, $lang, \*OUT); } close(OUT); } @@ -147,15 +166,11 @@ generateModuleCommandref($$;$$) } elsif($l =~ m/^=end html$suffix$/) { $skip = 1; + print $fh "

" if($fh); } elsif(!$skip) { print $fh $l if($fh); - if($l =~ m,

$mod

,i && $fh) { - print $fh "\n"; - } + chkAndGenLangLinks($l, $lang, $fh); $docCount++; $hasLink = ($l =~ m/