Skip to content

Commit

Permalink
rewrote html builder in perl, renders index now how i like it even ba…
Browse files Browse the repository at this point in the history
…ckround gone shady again
  • Loading branch information
lichtkind committed Apr 20, 2012
1 parent 3c38887 commit fcffb67
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/build-html.pl
@@ -0,0 +1,21 @@
#!/usr/bin/perl -w
use strict;
use v5.10;

my $pandoc_cmd = {
normal => 'pandoc -s --toc -N --css=styles.css -H _head-inc -B _nav-header -A _nav-footer -o %s %s',
appendixAG => 'pandoc -s --css=styles.css -H _head-inc -B _nav-header -A _nav-footer -o %s %s',
index => 'pandoc -s --css=styles.css -H _head-inc -o %s %s',
};

for my $txt_file (<*.txt>) {
my $html_file = substr($txt_file,0,-3) . 'html';
my $cmd;
if ($txt_file eq 'index.txt') {
$cmd = $pandoc_cmd->{'index'};
} elsif ($txt_file ~~ [qw(appendix-a-index.txt appendix-g-glossary.txt)]) {
$cmd = $pandoc_cmd->{'appendixAG'};
} else { $cmd = $pandoc_cmd->{'normal'}; }
#print "Processing:", $txt_file, '-->', $html_file
system sprintf $cmd, $html_file, $txt_file;
}

0 comments on commit fcffb67

Please sign in to comment.