#!/usr/bin/perl -w use strict; if($#ARGV!=0) { die "Usage: pandox_fixer.pl input.md"; } my($input)=shift(@ARGV); if(!($input =~ /.md$/)) { die "Usage: pandox_fixer.pl input.md"; } my($line); my($gitdate)=`git log $input | grep Date | head -n 1`; chomp($gitdate); $gitdate =~ s/Date: *//g; $gitdate =~ s/\s*\+.*$//g; $input =~ s/.md/.html/; open INPUT, $input or die; my($input_path)=$input; $input_path =~ s|/[^/]*$||g; # print $input."\n\n"; my($url_path) = "https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/blob/master/".$input_path; my($gitlab_origin)= "https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/blob/master/"; while(defined($line=)) { # $line =~ s|https://gitlab.inria.fr/learninglab/|https://learninglab.gitlabpages.inria.fr/|g; ## Not such a good idea! if($input=~ /_fr.html/) { $line =~ s|
|Les sources de ce document sont disponibles sur gitlab.|g; } else { $line =~ s||The source of this this document is available on gitlab.|g; } $line =~ s|---|AUTHOR:/) { next; } print $line; }