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
6
Merge Requests
6
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
6211cd43
You need to sign in or sign up before continuing.
Commit
6211cd43
authored
Sep 04, 2018
by
Arnaud Legrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy HTML generating Makefile
parent
6580ba57
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
Makefile
module4/ressources/Makefile
+15
-0
html_png_inliner.pl
module4/ressources/html_png_inliner.pl
+17
-0
No files found.
module4/ressources/Makefile
0 → 100644
View file @
6211cd43
all
:
resources.html
NLINES
=
10000000
%.html
:
%.org
emacs
-batch
$^
--funcall
org-html-export-to-html
sed
-i
-e
's/<pre /<pre style="padding-left: 30px; background-color: #f6f8fa;" /g'
\
-e
's/<li>/<li style="margin-bottom:0;">/g'
\
-e
's/<ul>/<ul style="margin:0 0;">/g'
$@
mv
$@
$@
.bak
html_png_inliner.pl <
$@
.bak |
grep
-A
$(NLINES)
-e
'<body>'
|
grep
-B
$(NLINES)
-e
'<div id="postamble" class="status">'
|
grep
-v
-e
'<body>'
-e
'<div id="postamble" class="status">'
>
$@
rm
$@
.bak
clean
:
rm
-f
*
~
module4/ressources/html_png_inliner.pl
0 → 100755
View file @
6211cd43
#!/usr/bin/perl -w
use
strict
;
my
(
$line
);
while
(
defined
(
$line
=<
STDIN
>
))
{
if
(
$line
=~
/^(.*)<img *src="([^"]*)"(.*)$/g
)
{
my
(
$pre
,
$image
,
$post
)
=
(
$1
,
$2
,
$3
);
$image
=~
s
|
file:
//
||
;
# print "$image\n";
my
$base64
=
`base64 -w 0 $image`
;
my
$format
=
$image
;
$format
=~
s/.*\.//g
;
print
$pre
.
"<img src=\"data:image/$format;base64,"
.
$base64
.
'"'
.
$post
;
}
else
{
print
$line
;
}
}
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