mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
commandref: add more language links (Forum #81087)
git-svn-id: https://svn.fhem.de/fhem/trunk@15629 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
155d6a32fd
commit
ac34b6cce5
@ -74,6 +74,20 @@ printList($)
|
||||
last;
|
||||
}
|
||||
}
|
||||
my $var;
|
||||
sub
|
||||
chkAndGenLangLinks($$$)
|
||||
{
|
||||
my ($l, $lang, $fh) = @_;
|
||||
$var = $1 if($l =~ m/<a name="(.*?)"(.*?)><\/a>/);
|
||||
if($l =~ m/(.*?)<\/h3>/ && $var) {
|
||||
print $fh "<div class='langLinks'>[".join(" ", map {
|
||||
$_ eq $lang ? $_ :
|
||||
"<a href='commandref".($_ eq "EN" ? "":"_$_").".html#$var'>$_</a>"
|
||||
} @lang) . "]</div>\n";
|
||||
$var = undef;
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $lang (@lang) {
|
||||
my $suffix = ($lang eq "EN" ? "" : "_$lang");
|
||||
@ -100,6 +114,8 @@ foreach my $lang (@lang) {
|
||||
while(my $l = <IN>) { # Header
|
||||
last if($l =~ m/name="perl"/);
|
||||
print OUT $l;
|
||||
chkAndGenLangLinks($l, $lang, \*OUT);
|
||||
|
||||
printList($1) if($l =~ m/<!-- header:(.*) -->/);
|
||||
}
|
||||
|
||||
@ -110,8 +126,11 @@ foreach my $lang (@lang) {
|
||||
|
||||
# Copy the tail
|
||||
print OUT '<a name="perl"></a>',"\n";
|
||||
$var = "perl";
|
||||
|
||||
while(my $l = <IN>) {
|
||||
print OUT $l;
|
||||
chkAndGenLangLinks($l, $lang, \*OUT);
|
||||
}
|
||||
close(OUT);
|
||||
}
|
||||
@ -147,15 +166,11 @@ generateModuleCommandref($$;$$)
|
||||
|
||||
} elsif($l =~ m/^=end html$suffix$/) {
|
||||
$skip = 1;
|
||||
print $fh "<p>" if($fh);
|
||||
|
||||
} elsif(!$skip) {
|
||||
print $fh $l if($fh);
|
||||
if($l =~ m,<h3>$mod</h3>,i && $fh) {
|
||||
print $fh "<div class='langLinks'>".join(" ", map {
|
||||
$_ eq $lang ? $_ :
|
||||
"<a href='commandref".($_ eq "EN" ? "":"_$_").".html#$mod'>$_</a>"
|
||||
} @lang) . "</div>\n";
|
||||
}
|
||||
chkAndGenLangLinks($l, $lang, $fh);
|
||||
|
||||
$docCount++;
|
||||
$hasLink = ($l =~ m/<a name="$mod"/) if(!$hasLink);
|
||||
|
@ -18,7 +18,6 @@
|
||||
<div id="logo"></div>
|
||||
<div id="menu">
|
||||
<h3>fhem.pl reference</h3>
|
||||
Version: <b>EN</b> <a href="commandref_DE.html">DE</a>
|
||||
<br><br>
|
||||
<a href="#doctop">Scroll to top</a>
|
||||
<br><br>
|
||||
|
@ -18,7 +18,6 @@
|
||||
<div id="logo"></div>
|
||||
<div id="menu">
|
||||
<h3>fhem.pl Referenz</h3>
|
||||
Version: <a href="commandref.html">EN</a> <b>DE</b>
|
||||
<br><br>
|
||||
<a href="#doctop">Zum Anfang</a>
|
||||
<br><br>
|
||||
|
@ -27,13 +27,16 @@ tr.column > td { padding:0; vertical-align:top;}
|
||||
.col2 { text-align:center; }
|
||||
|
||||
/* Documentation */
|
||||
h2,h3,h4 { color:#52865D; line-height:1.3;
|
||||
h2,h4 { color:#52865D; line-height:1.3;
|
||||
margin-top:1.5em; font-family:Arial,Sans-serif; }
|
||||
h3 { display: inline; color:#52865D; line-height:1.3;
|
||||
margin-top:1.5em; font-family:Arial,Sans-serif; }
|
||||
div.dist { padding-top:0.3em; }
|
||||
button.dist { margin:10px; background:transparent; border:0px; cursor:pointer; }
|
||||
div.block { border:1px solid gray; background: #F8F8E0; padding:0.7em; }
|
||||
#right { position:absolute; top:20px; left:180px; bottom:5px; right: 5px; }
|
||||
|
||||
.langLinks { font-size: 0.6em; }
|
||||
|
||||
/* Widgets */
|
||||
.makeTable { display:inline; float:left; clear:left; /*detail-selector,slider*/
|
||||
|
Loading…
Reference in New Issue
Block a user