PPI-HTML-CodeFolder
view release on metacpan or search on metacpan
=begin classdoc
Returns the CSS used for the abbreviated classes and fold DIVs.
@return CSS as a string
=end classdoc
=cut
</span></pre></div>
<div id='ft620' class='folddiv'><pre id='preft620'><span class="hc"><style type="text/css">
<!--
body {
font-family: fixed, Courier;
font-size: 10pt;
} </span></pre></div>
<div id='ft636' class='folddiv'><pre id='preft636'><span class="ct">#</span>
<span class="ct"># !!!fix for (yet another) Firefox bug: need a dummy class
# at front of CSS or firefox ignores the first class...
# </span></pre></div>
<div id='ft651' class='folddiv'><pre id='preft651'><span class="pd">
=pod
=begin classdoc
Generate folded HTML from source PPI document.
Overrides base class <code>html()</code> to apply codefolding support.
@param $src a <cpan>PPI::Document</cpan> object, OR the
path to the source file, OR a scalarref of the
actual source text.
@optional $outfile name of the output HTML file; If not specified for a filename $src, the
default is "$src.html"; If not specified for either PPI::Document or text $src,
defaults to an empty string.
@optional $script a name used if source is a script file. Script files might not include
any explicit packages or method declarations which would be mapped into the
table of contents. By specifying this parameter, an entry is forced into the
table of contents for the script, with any "main" package methods within the
script reassigned to this script name. If not specified, and <code>$src</code>
is not a filename, an error will be issued when the TOC is generated.
@return on success, the folded HTML; undef on failure
@returnlist on success, the folded HTML and a hashref mapping packages to an arrayref of method names;
undef on failure
=end classdoc
=cut
</span></pre></div>
<div id='ft692' class='folddiv'><pre id='preft692'><span class="ct">#</span>
<span class="ct"># expand tabs as needed (we use 4 space tabs)
# have to adjust some spans that confuse tab processing
# </span></pre></div>
<div id='ft703' class='folddiv'><pre id='preft703'><span class="ct">#</span>
<span class="ct"># scan for and replace tabs; adjust positions
# of extracted tags as needed
# </span></pre></div>
<div id='ft745' class='folddiv'><pre id='preft745'><span class="ct">#</span>
<span class="ct"># split multiline comments into 2 spans: 1st line (in case its midline)
# and the remainder; note that the prior substitution avoids
# doing this to single line comments
# </span></pre></div>
<div id='ft751' class='folddiv'><pre id='preft751'><span class="ct">#</span>
<span class="ct"># keep folded fragments here for later insertion
# as fold DIVs; key is starting line number,
# value is [ number of lines, text ]
# </span></pre></div>
<div id='ft757' class='folddiv'><pre id='preft757'><span class="ct">#</span>
<span class="ct"># count <br> tags, and looks for any of
# comment, pod, or use/require keyword (depending on the options);
# keeps track of start and end position of foldable segments
# </span></pre></div>
<div id='ft784' class='folddiv'><pre id='preft784'><span class="ct">#</span>
<span class="ct"># trim small folds;
# since its used frequently, create a sorted list of the fold DIV lines;
# isolate positions of folds and extract folded content
# </span></pre></div>
<div id='ft802' class='folddiv'><pre id='preft802'><span class="ct">#</span>
<span class="ct"># now remove the folded lines; we work from bottom to top since
# we're changing the HTML as we go, which would invalidate the
# positional elements we've kept. If fold expansion is enabled, we replace
# w/ a hyperlink; otherwise we replace with a simple indication of the fold
# </span></pre></div>
<div id='ft829' class='folddiv'><pre id='preft829'><span class="ct">#</span>
<span class="ct"># now create the line number table (if requested)
# NOTE: this is where having the breakable lines would be really
# useful!!!
# </span></pre></div>
<div id='ft847' class='folddiv'><pre id='preft847'><span class="ct">#</span>
<span class="ct"># fix Firefox blank lines inside spans bug: add a single space to
# all blank lines
# </span></pre></div>
<div id='ft855' class='folddiv'><pre id='preft855'><span class="pd">
=pod
=begin classdoc
Return current package/method cross reference.
@return hashref of current package/method cross reference
=end classdoc
=cut
</span></pre></div>
<div id='ft869' class='folddiv'><pre id='preft869'><span class="pd">
=pod
=begin classdoc
Write out a table of contents document for the current collection of
sources as a nested HTML list. The output filename is 'toc.html'.
The caller may optionally specify the order of packages in the menu.
@param $path directory to write TOC file
@optional Order arrayref of packages in the order in which they should appear in TOC; if a partial list,
any remaining packages will be appended to the TOC in alphabetical order
@return this object on success, undef on failure, with error message in $@
=begin classdoc
Returns the CSS used for the abbreviated classes and fold DIVs.
@return CSS as a string
=end classdoc
=cut
</span></pre></div>
<div id='ft620' class='folddiv'><pre id='preft620'><span class="hc"><style type="text/css">
<!--
body {
font-family: fixed, Courier;
font-size: 10pt;
} </span></pre></div>
<div id='ft636' class='folddiv'><pre id='preft636'><span class="ct">#</span>
<span class="ct"># !!!fix for (yet another) Firefox bug: need a dummy class
# at front of CSS or firefox ignores the first class...
# </span></pre></div>
<div id='ft651' class='folddiv'><pre id='preft651'><span class="pd">
=pod
=begin classdoc
Generate folded HTML from source PPI document.
Overrides base class <code>html()</code> to apply codefolding support.
@param $src a <cpan>PPI::Document</cpan> object, OR the
path to the source file, OR a scalarref of the
actual source text.
@optional $outfile name of the output HTML file; If not specified for a filename $src, the
default is "$src.html"; If not specified for either PPI::Document or text $src,
defaults to an empty string.
@optional $script a name used if source is a script file. Script files might not include
any explicit packages or method declarations which would be mapped into the
table of contents. By specifying this parameter, an entry is forced into the
table of contents for the script, with any "main" package methods within the
script reassigned to this script name. If not specified, and <code>$src</code>
is not a filename, an error will be issued when the TOC is generated.
@return on success, the folded HTML; undef on failure
@returnlist on success, the folded HTML and a hashref mapping packages to an arrayref of method names;
undef on failure
=end classdoc
=cut
</span></pre></div>
<div id='ft692' class='folddiv'><pre id='preft692'><span class="ct">#</span>
<span class="ct"># expand tabs as needed (we use 4 space tabs)
# have to adjust some spans that confuse tab processing
# </span></pre></div>
<div id='ft703' class='folddiv'><pre id='preft703'><span class="ct">#</span>
<span class="ct"># scan for and replace tabs; adjust positions
# of extracted tags as needed
# </span></pre></div>
<div id='ft745' class='folddiv'><pre id='preft745'><span class="ct">#</span>
<span class="ct"># split multiline comments into 2 spans: 1st line (in case its midline)
# and the remainder; note that the prior substitution avoids
# doing this to single line comments
# </span></pre></div>
<div id='ft751' class='folddiv'><pre id='preft751'><span class="ct">#</span>
<span class="ct"># keep folded fragments here for later insertion
# as fold DIVs; key is starting line number,
# value is [ number of lines, text ]
# </span></pre></div>
<div id='ft757' class='folddiv'><pre id='preft757'><span class="ct">#</span>
<span class="ct"># count <br> tags, and looks for any of
# comment, pod, or use/require keyword (depending on the options);
# keeps track of start and end position of foldable segments
# </span></pre></div>
<div id='ft784' class='folddiv'><pre id='preft784'><span class="ct">#</span>
<span class="ct"># trim small folds;
# since its used frequently, create a sorted list of the fold DIV lines;
# isolate positions of folds and extract folded content
# </span></pre></div>
<div id='ft802' class='folddiv'><pre id='preft802'><span class="ct">#</span>
<span class="ct"># now remove the folded lines; we work from bottom to top since
# we're changing the HTML as we go, which would invalidate the
# positional elements we've kept. If fold expansion is enabled, we replace
# w/ a hyperlink; otherwise we replace with a simple indication of the fold
# </span></pre></div>
<div id='ft829' class='folddiv'><pre id='preft829'><span class="ct">#</span>
<span class="ct"># now create the line number table (if requested)
# NOTE: this is where having the breakable lines would be really
# useful!!!
# </span></pre></div>
<div id='ft847' class='folddiv'><pre id='preft847'><span class="ct">#</span>
<span class="ct"># fix Firefox blank lines inside spans bug: add a single space to
# all blank lines
# </span></pre></div>
<div id='ft855' class='folddiv'><pre id='preft855'><span class="pd">
=pod
=begin classdoc
Return current package/method cross reference.
@return hashref of current package/method cross reference
=end classdoc
=cut
</span></pre></div>
<div id='ft869' class='folddiv'><pre id='preft869'><span class="pd">
=pod
=begin classdoc
Write out a table of contents document for the current collection of
sources as a nested HTML list. The output filename is 'toc.html'.
The caller may optionally specify the order of packages in the menu.
@param $path directory to write TOC file
@optional Order arrayref of packages in the order in which they should appear in TOC; if a partial list,
any remaining packages will be appended to the TOC in alphabetical order
@return this object on success, undef on failure, with error message in $@
( run in 0.658 second using v1.01-cache-2.11-cpan-5511b514fd6 )