Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr-ressources
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Learning Lab
mooc-rr-ressources
Commits
9d07c07f
Commit
9d07c07f
authored
Mar 22, 2019
by
Arnaud Legrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics
parent
ea0d0d3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
pandoc_fixer.pl
bin/pandoc_fixer.pl
+7
-4
No files found.
bin/pandoc_fixer.pl
View file @
9d07c07f
...
@@ -7,7 +7,7 @@ my($usage) = "Usage: pandox_fixer.pl input.md";
...
@@ -7,7 +7,7 @@ my($usage) = "Usage: pandox_fixer.pl input.md";
my
(
$input
)
=
shift
(
@ARGV
);
my
(
$input
)
=
shift
(
@ARGV
);
########### Git date #################
########### 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
);
chomp
(
$gitdate
);
$gitdate
=~
s/Date: *//g
;
$gitdate
=~
s/Date: *//g
;
$gitdate
=~
s/\s*\+.*$//g
;
$gitdate
=~
s/\s*\+.*$//g
;
...
@@ -43,12 +43,12 @@ open OUTPUT, "> ".$output or die;
...
@@ -43,12 +43,12 @@ open OUTPUT, "> ".$output or die;
while
(
defined
(
my
$line
=<
INPUT
>
))
{
while
(
defined
(
my
$line
=<
INPUT
>
))
{
if
(
$line
=~
/<p
>AUTHOR:
/
)
{
next
;
}
if
(
$line
=~
/<p
class="author"
/
)
{
next
;
}
if
(
$line
=~
/<h1 class="title"/
)
{
next
;
}
if
(
$line
=~
/<h1 class="title"/
)
{
next
;
}
if
(
$line
=~
/<
h1
class="date"/
)
{
next
;
}
if
(
$line
=~
/<
p
class="date"/
)
{
next
;
}
# $line =~ s|https://gitlab.inria.fr/learninglab/|https://learninglab.gitlabpages.inria.fr/|g; ## Not such a good idea!
# $line =~ s|https://gitlab.inria.fr/learninglab/|https://learninglab.gitlabpages.inria.fr/|g; ## Not such a good idea!
if
(
$line
=~
/<body>/
)
{
if
(
$line
=~
/<body>/
)
{
if
(
$
in
put
=~
/_fr.html/
)
{
if
(
$
out
put
=~
/_fr.html/
)
{
$line
=~
s
|<
body
>|<
body
>
Les
<
a
href
=
'$gitlab_origin/$input'
>
sources
de
ce
document
sont
disponibles
sur
gitlab
</
a
>.|
g
;
$line
=~
s
|<
body
>|<
body
>
Les
<
a
href
=
'$gitlab_origin/$input'
>
sources
de
ce
document
sont
disponibles
sur
gitlab
</
a
>.|
g
;
$line
.=
"<br><i>Version du $gitdate.</i><br><hr/>\n"
$line
.=
"<br><i>Version du $gitdate.</i><br><hr/>\n"
}
else
{
}
else
{
...
@@ -72,3 +72,6 @@ while(defined(my $line=<INPUT>)) {
...
@@ -72,3 +72,6 @@ while(defined(my $line=<INPUT>)) {
print
OUTPUT
$line
;
print
OUTPUT
$line
;
}
}
close
OUTPUT
;
close
INPUT
;
unlink
(
$output_temp
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment