fabianmoronzirfas
10/26/2012 - 7:44 AM

create html syntax for all images in dir

create html syntax for all images in dir

    #!/bin/sh
    # create list with all images in the wiki in markdown
    # author: @fabiantheblind
    # the headlines are formated to point to github raw files
    # https://raw.github.com/wiki/fabiantheblind/auto-typo-adbe-id/stripes.png
    #
    #
#touch overview.md
if [ -e "image_overview.md" ]; then
    echo "\"image_overview.md\" already exists. I will remove it"
    rm image_overview.md
fi
# numfiles=(*)
# numfiles=${#numfiles[@]}
# echo "There are $numfiles .jsx / .txt / .sh files in this directory"
#echo ls -l | grep -c "^-.*"
echo "##Autogenerated Image Overview  " >> image_overview.md;
echo '<div class="row-fluid">' >> image_overview.md;

for file in *.png; do
    if [ -e "$file" ]; then
        # echo "###[${file}](https://raw.github.com/fabiantheblind/auto-typo-adbe-id/master/fabiantheblind/${file})  " >> image_overview.md;
        #echo  "  \n" >> image_overview.md;
        # echo  "{% highlight js %} " >> image_overview.md;
        echo '<div class="span1">' >> image_overview.md;
        echo '<div class="crop" style="overflow: hidden">' >> image_overview.md;

        echo "<a href=\"https://raw.github.com/wiki/fabiantheblind/auto-typo-adbe-id/${file}\">" >> image_overview.md;
        echo "<img src=\"https://raw.github.com/wiki/fabiantheblind/auto-typo-adbe-id/${file}\" style=\"\" id=\"wikiimages\" width=\"256px\">" >> image_overview.md;
        echo "</a>" >> image_overview.md;

        # echo "![${file}](https://raw.github.com/wiki/fabiantheblind/auto-typo-adbe-id/${file})" >> image_overview.md;
        # echo  "{% endhighlight %} \n" >> image_overview.md;
        echo '</div>' >> image_overview.md;
        echo '</div>' >> image_overview.md;
        #echo  "  \n" >> image_overview.md;
        # echo "  \\n--------------  \\n  " >> image_overview.md;
    fi
done
echo '</div>' >> image_overview.md;

open image_overview.md