Browse files

Automatic order files based on filename

  • Loading branch information...
1 parent 0b889bf commit 066210231aa98ac32a3c8ae0f7b4e5dd96654740 @ambs committed Jun 3, 2011
View
5 CPAN/Makefile
@@ -3,10 +3,7 @@ book.pdf: book.tex
xelatex book.tex
xelatex book.tex
-book.tex: build/latex.pl chapters/preamble.pod \
- chapters/database.pod chapters/oo.pod chapters/xml.pod\
- chapters/intro.pod chapters/templates.pod\
- chapters/markup.pod chapters/web.pod
+book.tex: build/latex.pl chapters/*.pod
build/latex.pl
View
8 CPAN/build/latex.pl
@@ -7,12 +7,16 @@
use File::Slurp qw.edit_file.;
use Pod::PseudoPod::LaTeX;
-my @files = (qw.preamble intro oo templates web database xml markup.);
+
my $pod = 'build/book.pod';
my $tex = "book.tex";
-@files = map { "chapters/$_.pod" } @files;
+my @files = sort {
+ $a =~ m!(\d+)-! and my $c = $1;
+ $b =~ m!(\d+)-! and my $d = $1;
+ $c <=> $d
+} <chapters/*pod>;
create_single_pod (pod => $pod, files => \@files);
create_tex_from_pod (pod => $pod, tex => $tex);
View
0 CPAN/chapters/preamble.pod → CPAN/chapters/00-preamble.pod
File renamed without changes.
View
0 CPAN/chapters/intro.pod → CPAN/chapters/01-intro.pod
File renamed without changes.
View
0 CPAN/chapters/oo.pod → CPAN/chapters/10-oo.pod
File renamed without changes.
View
0 CPAN/chapters/templates.pod → CPAN/chapters/20-templates.pod
File renamed without changes.
View
0 CPAN/chapters/web.pod → CPAN/chapters/30-web.pod
File renamed without changes.
View
0 CPAN/chapters/database.pod → CPAN/chapters/40-database.pod
File renamed without changes.
View
0 CPAN/chapters/xml.pod → CPAN/chapters/50-xml.pod
File renamed without changes.
View
0 CPAN/chapters/markup.pod → CPAN/chapters/60-markup.pod
File renamed without changes.

0 comments on commit 0662102

Please sign in to comment.