diff options
author | P. J. McDermott <pjm@nac.net> | 2012-08-10 18:02:29 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-08-10 18:02:29 (EDT) |
commit | ba9ef7040bec8bee6c419802c493f3e876bd35f6 (patch) | |
tree | c9d0ab3da3d2ac68c920cf1f3306adf361a517e0 /scripts/MarkdownBook/Book | |
parent | f6ac178cf3c53952129ed7bc40c6350cfccaebe6 (diff) |
Move templating to MarkdownBook::Document::HTML.
Diffstat (limited to 'scripts/MarkdownBook/Book')
-rw-r--r-- | scripts/MarkdownBook/Book/HTML.pm | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/scripts/MarkdownBook/Book/HTML.pm b/scripts/MarkdownBook/Book/HTML.pm index 864d3f1..1edc215 100644 --- a/scripts/MarkdownBook/Book/HTML.pm +++ b/scripts/MarkdownBook/Book/HTML.pm @@ -39,45 +39,4 @@ sub new return $self; } -sub output -{ - my ($self) = @_; - my $doc_tmpl; - my $doc; - my $doc_fh; - - $doc_tmpl = HTML::Template->new(filename => 'include/document.tmpl'); - - foreach $doc (@{$self->{'docs'}}) { - - $doc_tmpl->param( - IS_INDEX => (ref($doc) eq $self->get_document_module('Index'))); - - $doc_tmpl->param(BOOK_TITLE => $self->{'title'}); - $doc_tmpl->param(TITLE => $doc->title()); - $doc_tmpl->param(CHAPT_TITLE => $doc->full_title()); - - if (defined($doc->prev())) { - $doc_tmpl->param(PREV_LINK => $doc->prev()->file() . '.html'); - $doc_tmpl->param(PREV_TITLE => $doc->prev()->title()); - } else { - $doc_tmpl->param(PREV_LINK => undef); - $doc_tmpl->param(PREV_TITLE => undef); - } - if (defined($doc->next())) { - $doc_tmpl->param(NEXT_LINK => $doc->next()->file() . '.html'); - $doc_tmpl->param(NEXT_TITLE => $doc->next()->title()); - } else { - $doc_tmpl->param(NEXT_LINK => undef); - $doc_tmpl->param(NEXT_TITLE => undef); - } - - $doc_tmpl->param(BODY => $doc->output()); - - open($doc_fh, '>', $doc->file_path() . '.html'); - $doc_tmpl->output(print_to => $doc_fh); - close($doc_fh); - } -} - 1; |