[svn:parrot] r48129 - branches/html_cleanup/lib/Parrot/Docs
coke at svn.parrot.org
coke at svn.parrot.org
Tue Jul 20 17:20:01 UTC 2010
Author: coke
Date: Tue Jul 20 17:20:00 2010
New Revision: 48129
URL: https://trac.parrot.org/parrot/changeset/48129
Log:
cleanup comments, remove really dead code,
(make it obvious what was commented out just to make this work.)
Modified:
branches/html_cleanup/lib/Parrot/Docs/PodToHtml.pm
Modified: branches/html_cleanup/lib/Parrot/Docs/PodToHtml.pm
==============================================================================
--- branches/html_cleanup/lib/Parrot/Docs/PodToHtml.pm Tue Jul 20 16:54:24 2010 (r48128)
+++ branches/html_cleanup/lib/Parrot/Docs/PodToHtml.pm Tue Jul 20 17:20:00 2010 (r48129)
@@ -31,7 +31,6 @@
our $VERSION = '1.0';
use Parrot::Docs::HTMLPage;
-#use Parrot::Distribution;
=item C<new()>
@@ -82,23 +81,20 @@
sub do_beginning {
my $self = shift;
- # We have to do this because it has the side effect of setting
- # content_seen.
- $self->get_short_title();
-
- return unless $self->content_seen;
-
my $title = esc($self->get_title());
+
# If the name of the document is IN the document title (a common pod
- # idiom), strip it out.
+ # idiom), strip it out. We assume anything with a dot is the filename.
if ($title =~ m/(.*?)-/) {
- # assume it's a filename if it has a dot in it.
if ($1 =~ m/\./) {
$title =~ s/^.*?-\s*//;
}
}
+ # Figure out what the relative docroot will be and setup
+ # our breadcrumbs & resource paths.
+
my $dirCount = ( $self->{source_filename} =~ tr{/}{/} );
my $docroot = join('/', (('..') x ++$dirCount)) ;
my $resources_URL = $docroot . '/resources';
@@ -124,7 +120,7 @@
Does the middle of the document. This splits up the long C<do_middle()>
method in C<Pod:Simple::HTML>, calling the various C<process_*> methods
-below. This makes it easier to where the custom bits of Parrot-specific
+below. This makes it easier to see where the custom bits of Parrot-specific
formatting have to be inserted.
=cut
@@ -168,9 +164,9 @@
if ( $tagname eq 'L' ) {
$self->process_link_start_token($token);
}
- #elsif ( $tagname eq 'F' ) {
- #$self->process_file_start_token($token);
- #}
+ elsif ( $tagname eq 'F' ) {
+ $self->process_file_start_token($token);
+ }
elsif ( $tagname eq 'C' ) {
$self->process_code_start_token($token);
}
@@ -239,6 +235,9 @@
my $text = $next->text;
+
+ ## XXX re-enable this
+
#if ( $text =~ /^Parrot::/o ) {
#my $href = $self->href_for_perl_module($text);
@@ -264,14 +263,16 @@
documentation file.
=cut
-##
-##sub process_file_start_token {
- ##my $self = shift;
- ##my $token = shift;
- ##my $tagname = $token->tagname;
- ##my $next = $self->get_token;
-##
-##
+
+
+sub process_file_start_token {
+ my $self = shift;
+ my $token = shift;
+ my $tagname = $token->tagname;
+ my $next = $self->get_token;
+
+ ## XXX re-enable this.
+
##if ( $next->type eq 'text' ) {
##my $text = $next->text;
##my $dist = Parrot::Distribution->new;
@@ -299,10 +300,10 @@
##}
##}
##else {
- ##$self->unget_token($next);
- ##print { $self->{'output_fh'} } $self->{'Tagmap'}{$tagname};
+ $self->unget_token($next);
+ print { $self->{'output_fh'} } $self->{'Tagmap'}{$tagname};
##}
-##}
+}
=item C<process_item_text_or_head_start_token($token)>
@@ -543,6 +544,8 @@
my $to = shift;
my $section = shift;
+ ## XXX re-enable this
+
#if ( $to =~ /^Parrot::/o ) {
#my $href = $self->href_for_perl_module($to);
@@ -584,6 +587,8 @@
my $path = $self->append_html_suffix( $dist->relative_path($file) );
+ ## XXX re-enable this
+
# This is the docs file for the module.
## $file = $self->{TARGET}->file_with_relative_path($path);
@@ -625,47 +630,6 @@
return $string;
}
-=item C<write_html($source, $target, $rel_path, $item)>
-
-Writes an HTML version of the file specified by C<$rel_path> in
-C<$source> to the equivalent location in C<$target>.
-
-=cut
-
-## sub write_html {
- ## my $self = shift;
- ## my $source = shift;
- ## my $target = shift;
- ## my $rel_path = shift;
- ## my $item = shift;
- ## my $file = $source->file_with_relative_path($rel_path);
-##
- ## return unless $file->contains_pod;
-##
- ## $self->{TARGET} = $target;
-##
- ## # Use our own method for consistency.
- ## $self->{'Title'} = $file->title;
-##
- ## $rel_path = $self->append_html_suffix($rel_path);
-##
- ## my $docs_file = $target->file_with_relative_path($rel_path);
-##
- ## $self->{DOCS_FILE} = $docs_file;
-##
- ## $rel_path = $self->href_path( $docs_file->parent->relative_path( $target->parent_path ) );
-##
- ## my $name = $target->name;
-##
- ## # This is a cheat because we know that all top-level sections
- ## # have their indexes in the root directory - but it works.
-##
- ## $self->{NAV_BAR} = $item->html_navigation("$rel_path/$name");
- ## $self->{RESOURCES_URL} = "$rel_path/resources";
-##
- ## $docs_file->write( $self->html_for_file($file) );
-## }
-
=item C<append_html_suffix($path)>
Returns C<$path> with and HTML file suffix added.
More information about the parrot-commits
mailing list