Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrote html builder in perl, renders index now how i like it even ba…
…ckround gone shady again
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |