Commit 6211cd43 authored by Arnaud Legrand's avatar Arnaud Legrand

Copy HTML generating Makefile

parent 6580ba57
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 *~
#!/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;
}
}
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