diff --git a/bin/pandoc_fixer.pl b/bin/pandoc_fixer.pl index 66c587bbe54f6329762562bb154de94b9f1c4617..6d80d5521b22e83ee56332a762a173957d0e8ed0 100755 --- a/bin/pandoc_fixer.pl +++ b/bin/pandoc_fixer.pl @@ -7,7 +7,7 @@ my($usage) = "Usage: pandox_fixer.pl input.md"; my($input)=shift(@ARGV); ########### Git date ################# -my($gitdate)=`git log $input | grep Date | head -n 1`; +my($gitdate)=`git log --date=short $input | grep Date | head -n 1`; chomp($gitdate); $gitdate =~ s/Date: *//g; $gitdate =~ s/\s*\+.*$//g; @@ -43,12 +43,12 @@ open OUTPUT, "> ".$output or die; while(defined(my $line=)) { - if($line =~ /

AUTHOR:/) { next; } + if($line =~ /

/) { - if($input=~ /_fr.html/) { + if($output=~ /_fr.html/) { $line =~ s||Les sources de ce document sont disponibles sur gitlab.|g; $line .= "
Version du $gitdate.


\n" } else { @@ -72,3 +72,6 @@ while(defined(my $line=)) { print OUTPUT $line; } +close OUTPUT; +close INPUT; +unlink($output_temp);