⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmlhelp.pm

📁 ARM上的如果你对底层感兴趣
💻 PM
📖 第 1 页 / 共 5 页
字号:
      <a href="./lib/pod/perlfaq6.html" alt="Regexps"> perlfaq6 </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl frequently asked questions">&nbsp; 
      <a href="./lib/pod/perlfaq7.html" alt="General Perl Language Issues"> perlfaq7 
      </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl frequently asked questions">&nbsp; 
      <a href="./lib/pod/perlfaq8.html" alt="System Interaction"> perlfaq8 </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl frequently asked questions">&nbsp; 
      <a href="./lib/pod/perlfaq9.html" alt="Networking"> perlfaq9 </a><br>
      <img id="Foldergif_63" src="folder.gif" alt="Standard Distribution Documentation">&nbsp; 
      <b><a name="CorePerlDocs">Core Perl Docs</a><BR>
      </b> &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif">&nbsp; <a href="./lib/pod/perl.html"> 
      Introduction</a><BR>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl internal IO abstraction interface">&nbsp; 
      <a href="./lib/pod/perlapio.html"> perlapio </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl book information">&nbsp; 
      <a href="./lib/pod/perlbook.html"> perlbook </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl OO tricks and examples">&nbsp; 
      <a href="./lib/pod/perlbot.html"> perlbot </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl calling conventions from C">&nbsp; 
      <a href="./lib/pod/perlcall.html"> perlcall </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl Data Structures">&nbsp; 
      <a href="./lib/pod/perldata.html"> perldata </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl debugging">&nbsp; 
      <a href="./lib/pod/perldebug.html"> perldebug </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl changes since previous version">&nbsp; 
      <a href="./lib/pod/perldelta.html"> perldelta </a><BR>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl diagnostic messages">&nbsp; 
      <a href="./lib/pod/perldiag.html"> perldiag </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl data structures intro">&nbsp; 
      <a href="./lib/pod/perldsc.html"> perldsc </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl ways to embed perl in your C or C++ application">&nbsp; 
      <a href="./lib/pod/perlembed.html"> perlembed </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl formats">&nbsp; 
      <a href="./lib/pod/perlform.html"> perlform </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl builtin functions">&nbsp; 
      <a href="./lib/pod/perlfunc.html"> perlfunc </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl internal functions for those doing extensions">&nbsp; 
      <a href="./lib/pod/perlguts.html"> perlguts </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl history records">&nbsp; 
      <a href="./lib/pod/perlhist.html"> perlhist </a><br>
      <b> </b>&nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl interprocess communication">&nbsp; 
      <a href="./lib/pod/perlipc.html"> perlipc </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl locale support">&nbsp; 
      <a href="./lib/pod/perllocale.html"> perllocale </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl data structures: lists of lists">&nbsp; 
      <a href="./lib/pod/perllol.html"> perllol </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl modules: how they work">&nbsp; 
      <a href="./lib/pod/perlmod.html"> perlmod </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl modules: hot to write and use them">&nbsp; 
      <a href="./lib/pod/perlmodlib.html"> perlmodlib </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl objects">&nbsp; 
      <a href="./lib/pod/perlobj.html"> perllobj </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl operators and precedence">&nbsp; 
      <a href="./lib/pod/perlop.html"> perlop </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl plain old documentation">&nbsp; 
      <a href="./lib/pod/perlpod.html"> perlpod </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl regular expressions">&nbsp; 
      <a href="./lib/pod/perlre.html"> perlre </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl references">&nbsp; 
      <a href="./lib/pod/perlref.html"> perlref </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl execution and options">&nbsp; 
      <a href="./lib/pod/perlrun.html"> perlrun </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl security">&nbsp; 
      <a href="./lib/pod/perlsec.html"> perlsec </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl style guide">&nbsp; 
      <a href="./lib/pod/perlstyle.html"> perlstyle </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl subroutines">&nbsp; 
      <a href="./lib/pod/perlsub.html"> perlsub </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl Syntax">&nbsp; 
      <a href="./lib/pod/perlsyn.html"> perlsyn </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl objects hidden behind simple variables">&nbsp; 
      <a href="./lib/pod/perltie.html"> perltie </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl documentation table of contents">&nbsp; 
      <a href="./lib/pod/perltoc.html" alt="Perl documentation table of contents"> 
      perltoc </a><BR>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl OO tutorial">&nbsp; 
      <a href="./lib/pod/perltoot.html"> perltoot </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl traps for the unwary">&nbsp; 
      <a href="./lib/pod/perltrap.html"> perltrap </a><br>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl predefined variables">&nbsp; 
      <a href="./lib/pod/perlvar.html"> perlvar </a><BR>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl XS application programming interface">&nbsp; 
      <a href="./lib/pod/perlxs.html"> perlxs </a><BR>
      &nbsp;&nbsp;&nbsp; <img id="Pagegif_63" src="page.gif" alt="Perl XS tutorial">&nbsp; 
      <a href="./lib/pod/perlxstut.html"> perlxstut </a>
    </p>
    <hr>
    <h4><a name="ModuleDocs">Module Docs</a></h4>
END_OF_MAIN_TOC
}

#####################################################################
# FUNCTION      GetHtmlFilesFromTree (recursive)
# RECEIVES      Base directory to look in
# RETURNS       List of html files
# SETS          None
# EXPECTS       None
# PURPOSE       Searches an entire for html files, returns a list of
#               html files found including path information
sub GetHtmlFilesFromTree {
    my $basedir = shift;
    my @dirs;
    my @htmlfiles;
    my %ret;

    unless(opendir(DIR, $basedir)) {
        $! = "Can't read from directory $basedir\n";
        return 0;
    }
    @files = readdir(DIR);
    closedir(DIR);

    @dirs = grep {-d "$basedir\\$_" and /[^.]$/} @files;
    @htmlfiles = grep {/\.html?$/i} @files;

    foreach $dir (@dirs) {
        unless(%ret = (%ret, GetHtmlFilesFromTree("$basedir\\$dir"))) {
            return 0;
        }
    }

    %ret = (%ret, $basedir => \@htmlfiles);
}

#####################################################################
# FUNCTION      MakePerlHelp
# RECEIVES      None
# RETURNS       1 | 0
# SETS          None
# EXPECTS       None
# PURPOSE       Creates html help for the perl system. This is the
#               html help core build. If MAKE_HTML_FOR_HHELP is set
#               to a true vale, then it builds the help from POD,
#               otherwise it depends on the pod being there already.
sub MakePerlHelp {
    if($MAKE_HTML_FOR_HHELP) {
        unless(MakeHelpFromPodTree($HTMLHELP, $HTMLHELP, $LIB, "$HTML\\lib")) {
            return 0;
        }
        unless(MakeHelpFromPodTree($HTMLHELP, $HTMLHELP, $SITELIB, "$HTML\\lib\\site")) {
            return 0;
        }
    } else {
        unless(MakeHelpFromTree($HTMLHELP, $HTMLHELP, "$HTML\\lib")) {
            return 0;
        }
    }

    unless(MakePerlHelpMain) {
        return 0;
    }

    # This handles MakePerlHtml too, since we've created all the html
    unless(MakePerlHtmlIndex("$HTML\\lib", "$HTML\\perltoc.html")) {
        return 0;
    }

    return 1;
}

#####################################################################
# FUNCTION      MakePerlHelpMain;
# RECEIVES      None
# RETURNS       None
# SETS          None
# EXPECTS       None
# PURPOSE       Creates the main perl helpfile from all the little
#               helpfiles already created.
sub MakePerlHelpMain {
    my @files;

    print "Generating main library helpfile\n";

    unless(opendir(DIR, $HTMLHELP)) {
        $! = "Directory $HTMLHELP could not be read\n";
        return 0;
    }

    unless(-e "$HTMLHELP/default.htm") {
        copy("$HTML/libmain.html", "$HTMLHELP/default.htm");
    }

    @files = grep {/\.hhc/i} readdir(DIR);
    closedir(DIR);

    $CLEANUP=0;
    $MERGE_PACKAGES = 1;

    MakeHelp("libmain.chm", $HTMLHELP, $HTMLHELP, @files);
    
    $CLEANUP = 1;
    $MERGE_PACKAGES = 0;

    return 1;
}

#####################################################################
# FUNCTION      MakeHelpFromPodTree
# RECEIVES      Working directory, Output directory, Source Diretory,
#               HtmlOutput Directory
# RETURNS       0 | 1
# SETS          None
# EXPECTS       None
# PURPOSE       Takes a tree's worth of pod and turns them first
#               into html and then into htmlhelp.
sub MakeHelpFromPodTree {
    my ($workdir, $outdir, $fromdir, $htmldir) = @_;

    unless(MakeHtmlTree($fromdir, $htmldir)) {
        return 0;
    }
    
    unless(MakeHelpFromTree($workdir, $outdir, $htmldir)) {
        return 0;
    }

#   if(opendir(DIR, $outdir)) {
#       unlink(map {"$outdir/$_"} grep {/\.hhp/i} readdir(DIR));
#       closedir(DIR);
#   } else {
#       warn "Could not clean up project files in $outdir\n";
#   }

    return 1;
}

#####################################################################
# FUNCTION      MakeHtmlTree
# RECEIVES      Source Directory, Html Output Directory
# RETURNS       0 | 1
# SETS          None
# EXPECTS       None
# PURPOSE       Makes a tree's worth of html from a tree's worth
#               of pod.
sub MakeHtmlTree {
    my ($fromdir, $htmldir) = @_;
    my @files;
    my @podfiles;
    my @dirs;
    my $podfile;
    my $htmlfile;
    my $dir;

    # Get list of files and directories to process
    if(!-d $fromdir) {
        $! = "Directory $fromdir does not exist\n";
        return 0;
    }
    unless(opendir(DIR, $fromdir)) {
        $! = "Directory $fromdir couldn't be read\n";
        return 0;
    }
    @files = readdir(DIR);
    closedir(DIR);

    @podfiles = map {"$fromdir\\$_"} grep {/\.pod$|\.pm$/i} @files;
    @dirs = grep {-d "$fromdir\\$_" and /[^.]$/} @files;

    if(@podfiles) {
        # Create the copy directory
        if(!-d $htmldir) {
            unless(mkdir($htmldir, 0777)) {
                $! = "Directory $htmldir could not be created\n";
                return 0;
            }
        }
        
        foreach $podfile (@podfiles) {
            $htmlfile = $podfile;
            $htmlfile =~ s/.*(\\|\/)(.*)/$2/;
            $htmlfile =~ s/\.pod|\.pm$/.html/i;
            $htmlfile = "$htmldir\\$htmlfile";
            unlink($htmlfile) if(-e $htmlfile);
            pod2html("--infile=$podfile", "--outfile=$htmlfile");
        }
    }

    foreach $dir (@dirs) {
        MakeHtmlTree("$fromdir\\$dir", "$htmldir\\$dir");
    }

    return 1;
}

#####################################################################
# FUNCTION      MakeHelpFromTree
# RECEIVES      Working directory, Output directory, Source directory
# RETURNS       0 | 1
# SETS          None
# EXPECTS       None
# PURPOSE       Creates html help from a tree's worth of html
sub MakeHelpFromTree {
    my ($workdir, $outdir, $fromdir) = @_;
    my %files;
    my $file;
    my $key;
    my $file_root;

    unless(%files = GetHtmlFileTreeList($fromdir, $fromdir)) {
        return 0;
    }

    $file_root = $fromdir;
    $file_root =~ s/(.*)(\\|\/)$/$1/;

    foreach $key (sort(keys(%files))) {
        $file = $key;
        $file = substr($key, length($file_root));
        $file =~ s/^(\\|\/)//;
        $file =~ s{\\|\/}{-}g;
        $file =~ s/ //g;
        if($file eq "") {
            if($file_root =~ /lib$/i) {
                $file = "lib";
            } else {
                $file = "lib-site";
            }
        } elsif ($file_root =~ /lib$/i) {
            $file = "lib-" . $file;
        } elsif ($file_root =~ /site$/i) {
            $file = "lib-site-" . $file;
        }
        $file .= ".chm";
        unless(MakeHelp("$file", $workdir, $outdir, map {"$key/$_"} @{$files{$key}})) {
            return 0;
        }
    }

    return 1;
}

#####################################################################
# FUNCTION      GetHtmlFileTreeList (recursive)
# RECEIVES      Original root (from first call), Root (successive)
# RETURNS       Hash of files
# SETS          None
# EXPECTS       None
# PURPOSE       Get a list of html files throughout a tree
sub GetHtmlFileTreeList {
    my $origroot = shift;
    my $root = shift;
    my @files;
    my @htmlfiles;
    my @dirs;
    my $dir;
    my %ret;

    unless(opendir(DIR, "$root")) {
        $! = "Can't open directory $root\n";
        return undef;
    }    
    @files = readdir(DIR);
    @dirs = grep {-d "$root/$_" and /[^.]$/} @files;
    @htmlfiles = grep {/\.html?/i} @files;
    closedir(DIR);

    %ret = ($root => \@htmlfiles) if @htmlfiles;

    foreach $dir (@dirs) {
        unless(%ret = (%ret, GetHtmlFileTreeList($origroot, "$root/$dir"))) {
            return undef;
        }
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -