Permalink
Browse files

rewrote html builder in perl, renders index now how i like it even ba…

…ckround gone shady again
  • Loading branch information...
1 parent 3c38887 commit fcffb67cd240bc9527bb479c9f2b769dac93d971 @lichtkind lichtkind committed Apr 20, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 docs/build-html.pl
View
@@ -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.