#!/bin/sh # create list with the first 7 lines of all scripts in markdown # author: @fabiantheblind # the headlines are formated to point to github raw files # # # #touch overview.md if [ -e "pygments_overview.md" ]; then echo "\"pygments_overview.md\" already exists. I will remove it" rm pygments_overview.md fi numfiles=(*) numfiles=${#numfiles[@]} echo "There are $numfiles .jsx / .txt / .sh files in this directory" #echo ls -l | grep -c "^-.*" echo "##Autogenerated Pygments Overview " >> pygments_overview.md; for file in *.{jsx,json,txt,sh}; do if [ -e "$file" ]; then echo "###[${file}](https://raw.github.com/fabiantheblind/auto-typo-adbe-id/master/fabiantheblind/${file}) " >> pygments_overview.md; #echo " \n" >> pygments_overview.md; echo "{% highlight js %} " >> pygments_overview.md; head -7 "${file}" >> pygments_overview.md; echo "{% endhighlight %} \n" >> pygments_overview.md; #echo " \n" >> pygments_overview.md; echo " \\n-------------- \\n " >> pygments_overview.md; fi done open pygments_overview.md