2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

Preparing THE SPLIT

git-svn-id: https://svn.fhem.de/fhem/trunk@2075 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2012-11-04 13:29:55 +00:00
parent 82b312330b
commit 6bfffbb57b
10 changed files with 1327 additions and 1270 deletions

View File

@ -7,6 +7,7 @@
- feature: optional second parameter to fhem() to make it silent - feature: optional second parameter to fhem() to make it silent
- feature: autoloading commands, XmlList/etc renamed from 99 to 98. - feature: autoloading commands, XmlList/etc renamed from 99 to 98.
- feature: FHEMWEB returns external files in chunks to save memory - feature: FHEMWEB returns external files in chunks to save memory
- feature: commandref.html splitted: documentation is now appended to the modules.
- 2012-10-28 (5.3) - 2012-10-28 (5.3)
- feature: added functions trim, ltrim, rtrim, UntoggleDirect, UntoggleIndirect - feature: added functions trim, ltrim, rtrim, UntoggleDirect, UntoggleIndirect

View File

@ -475,13 +475,3 @@ ZWave_Undef($$)
} }
1; 1;
=begin html
<a name="CUL"></a>
<h3>CUL</h3>
<ul>
text
</ul>
=end html

View File

@ -333,3 +333,5 @@ energy_Undef($$)
return undef; return undef;
} }
1;

View File

@ -345,3 +345,4 @@ if ( $kind ne 0 ){
} }
} }
1;

View File

@ -0,0 +1,74 @@
#!/usr/bin/perl
use strict;
use warnings;
my $docIn = "docs/commandref_frame.html";
my $docOut = "docs/commandref.html";
my @modDir = ("FHEM");
open(IN, "$docIn") || die "Cant open $docIn: $!\n";
open(OUT, ">$docOut") || die "Cant open $docOut: $!\n";
my %mods;
foreach my $modDir (@modDir) {
opendir(DH, $modDir) || die "Cant open $modDir: $!\n";
while(my $l = readdir DH) {
next if($l !~ m/^\d\d_.*\.pm$/);
my $of = $l;
$l =~ s/.pm$//;
$l =~ s/^[0-9][0-9]_//;
$mods{$l} = "$modDir/$of";
}
}
# First run: check what is a command and what is a helper module
my $status;
my %noindex;
while(my $l = <IN>) {
last if($l =~ m/<h3>Introduction/);
$noindex{$1} = 1 if($l =~ m/href="#(.*)"/);
}
seek(IN,0,0);
# Second run: create the file
# Header
while(my $l = <IN>) {
print OUT $l;
last if($l =~ m/#global/);
}
# index for devices.
foreach my $mod (sort keys %mods) {
next if($noindex{$mod});
print OUT " <a href='#$mod'>$mod</a> &nbsp;\n";
}
# Copy the middle part
while(my $l = <IN>) {
last if($l =~ m/name="perl"/);
print OUT $l;
}
# Copy the doc part from the module
foreach my $mod (sort keys %mods) {
open(MOD, $mods{$mod}) || die("Cant open $mods{$mod}:$!\n");
my $skip = 1;
while(my $l = <MOD>) {
if($l =~ m/^=begin html/) {
$skip = 0;
} elsif($l =~ m/^=end html/) {
$skip = 1;
} elsif(!$skip) {
print OUT $l;
}
}
close(MOD);
}
# Copy the tail
print OUT '<a name="perl"></a>',"\n";
while(my $l = <IN>) {
print OUT $l;
}
close(OUT);

View File

@ -0,0 +1,63 @@
#!/usr/bin/perl
use strict;
use warnings;
my $docIn = "docs/commandref.html";
my $docOut = "docs/commandref_frame.html";
my @modDir = ("FHEM", "contrib", "webfrontend/pgm5");
open(IN, "$docIn") || die "Cant open $docIn: $!\n";
open(OUT, ">$docOut") || die "Cant open $docOut: $!\n";
my %mods;
foreach my $modDir (@modDir) {
opendir(DH, $modDir) || die "Cant open $modDir: $!\n";
while(my $l = readdir DH) {
next if($l !~ m/^\d\d_.*\.pm$/);
my $of = $l;
$l =~ s/.pm$//;
$l =~ s/^[0-9][0-9]_//;
$mods{lc($l)} = "$modDir/$of" if(!$mods{lc($l)});
}
}
my %fnd;
my $modFileName;
while(my $l = <IN>) {
$l =~ s/[\r\n]//g;
if($l =~ m,^<a name="(.*)"></a>$,) {
if($modFileName) {
print MODOUT "=end html\n=cut\n";
close(MODOUT);
rename "$modFileName.NEW", $modFileName;
}
my $mod = lc($1);
if($mods{$mod}) {
print "Double-Fnd: $mod\n" if($fnd{$mod});
$fnd{$mod} = 1;
$modFileName = $mods{$mod};
open(MODIN, "$modFileName") || die("Cant open $modFileName: $!\n");
open(MODOUT, ">$modFileName.NEW") || die("Cant open $modFileName.NEW: $!\n");
my $seen1;
while(my $l = <MODIN>) {
$seen1 = 1 if($l =~ m/^1;[\r\n]*/);
last if($l =~ m/=pod/ && $seen1);
print MODOUT $l;
}
print MODOUT "\n\=pod\n=begin html\n\n";
} else {
print "Not a module: $mod\n";
$modFileName = "";
}
}
if($modFileName){
print MODOUT "$l\n";
} else {
print OUT "$l\n";
}
}
foreach my $mod (sort {$mods{$a} cmp $mods{$b}} keys %mods) {
print "Missing doc for $mods{$mod}\n" if(!$fnd{$mod});
}

File diff suppressed because it is too large Load Diff

View File

@ -75,7 +75,7 @@
Nightly SVN version: a Nightly SVN version: a
<a href="http://www.dhs-computertechnik.de/downloads/fhem-cvs.tgz"> <a href="http://www.dhs-computertechnik.de/downloads/fhem-cvs.tgz">
tarball</a>, or from the fhem commandline via <a tarball</a>, or from the fhem commandline via <a
href="commandref.html#updatefhem">updatefhem</a>. <br><br> href="commandref.html#update">update</a>. <br><br>
Please fill out our <a href="survey.pl">survey</a>, Please fill out our <a href="survey.pl">survey</a>,