From ea75c43dedebe5b6f768841f1a8234d5ef855350 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 10 Aug 2012 17:36:29 -0400 Subject: Adjust book and document interfaces. --- (limited to 'scripts') diff --git a/scripts/MarkdownBook/Book.pm b/scripts/MarkdownBook/Book.pm index 77193fd..ac41631 100644 --- a/scripts/MarkdownBook/Book.pm +++ b/scripts/MarkdownBook/Book.pm @@ -42,6 +42,8 @@ sub new } close($control_fh); + $self->create_documents(); + return $self; } @@ -130,6 +132,16 @@ sub create_documents } } +sub parse +{ + my ($self) = @_; + my $doc; + + foreach $doc (@{$self->{'docs'}}) { + $doc->parse(); + } +} + sub list_documents { my ($self) = @_; diff --git a/scripts/MarkdownBook/Book/HTML.pm b/scripts/MarkdownBook/Book/HTML.pm index 662b347..864d3f1 100644 --- a/scripts/MarkdownBook/Book/HTML.pm +++ b/scripts/MarkdownBook/Book/HTML.pm @@ -39,17 +39,7 @@ sub new return $self; } -sub parse_documents -{ - my ($self) = @_; - my $doc; - - foreach $doc (@{$self->{'docs'}}) { - $doc->parse_html(); - } -} - -sub write_templated_documents +sub output { my ($self) = @_; my $doc_tmpl; diff --git a/scripts/MarkdownBook/Document/HTML.pm b/scripts/MarkdownBook/Document/HTML.pm index a7e901a..5dda99a 100644 --- a/scripts/MarkdownBook/Document/HTML.pm +++ b/scripts/MarkdownBook/Document/HTML.pm @@ -23,7 +23,7 @@ package MarkdownBook::Document::HTML; our @ISA = qw(MarkdownBook::Document); -sub parse_html +sub parse { my ($self) = @_; my $file = $self->{'book'}->dir() . '/' . $self->{'file'} . '.html.in'; diff --git a/scripts/postproc.pl b/scripts/postproc.pl index 3d8cbe9..5c33c72 100755 --- a/scripts/postproc.pl +++ b/scripts/postproc.pl @@ -27,6 +27,5 @@ my $book; $book = MarkdownBook::Book::HTML->new($doc_dir); -$book->create_documents(); -$book->parse_documents(); -$book->write_templated_documents(); +$book->parse(); +$book->output(); -- cgit v0.9.1