Commit 75791358 authored by Arnaud Legrand's avatar Arnaud Legrand

[HTML] Trying to fix paths to internal documents

parent cc1560a7
...@@ -30,7 +30,8 @@ my($output_temp) = $output."tmp"; ...@@ -30,7 +30,8 @@ my($output_temp) = $output."tmp";
my($input_path)=$input; my($input_path)=$input;
$input_path =~ s|/[^/]*$||g; $input_path =~ s|/[^/]*$||g;
my($url_path) = "https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/raw/master/".$input_path; my($raw_path) = "https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/raw/master/".$input_path;
my($tree_path) = "https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/tree/master/".$input_path;
my($gitlab_origin)= "https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/blob/master/"; my($gitlab_origin)= "https://gitlab.inria.fr/learninglab/mooc-rr/mooc-rr-ressources/blob/master/";
########### Pandoc ################# ########### Pandoc #################
...@@ -63,9 +64,13 @@ while(defined(my $line=<INPUT>)) { ...@@ -63,9 +64,13 @@ while(defined(my $line=<INPUT>)) {
# $line =~ s|<p>TITLE:\(.*\)<br|<b>TITLE:$1</b><br|g; # $line =~ s|<p>TITLE:\(.*\)<br|<b>TITLE:$1</b><br|g;
$line =~ s|img src="http|img src="%|g; $line =~ s|img src="http|img src="%|g;
$line =~ s|img src="([^%][^"]*)"|img src="$url_path/$1?inline=false"|g; $line =~ s|img src="([^%][^"]*)"|img src="$raw_path/$1"|g; # ?inline=false
$line =~ s|img src="%|img src="http|g; $line =~ s|img src="%|img src="http|g;
$line =~ s|href="http|href="%|g;
$line =~ s|href="([^%][^"]*)"|href="$tree_path/$1"|g; # ?inline=false
$line =~ s|href="%|href="http|g;
# if($line =~ /img src="([^%][^"]*)"/) { # if($line =~ /img src="([^%][^"]*)"/) {
# $line = "\t".$line; # $line = "\t".$line;
# } # }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment