linuxboot / heads-wiki

Documentation for the Heads firmware project
85 stars 44 forks source link

Track images in repo instead of hosting on flickr #2

Closed jpouellet closed 6 years ago

jpouellet commented 7 years ago

Was done automatically with:

mkdir images
for x in *.md; do
    perl -e 'while (<>) {
        if (/^(.*)!\[([^]]*)\]\(([^)]*)\)(.*)$/) {
            $b=$1;
            $n=$2;
            $u=$3;
            $e=$4;

            $c=$n;
            $c=~s/[^a-zA-Z0-9]/_/g;
            $c="images/$c.jpg";

            system("wget", "-qO", $c, $u);
            print "$b![$n]($c)$e\n";
        } else {
            print $_;
        }
    }' < "$x" > "$x.new"
    mv "$x.new" "$x"
done