I started to take a screenshot of almost every step of my KiCad HowTo. It turned out I created 86 screenshots that needed to be referenced from the Markdown sources using a Jekyll include. The screenshots were already grouped into folders for subsections.

Writing HowTos is a lot of work

The Solution

// go through all directories
for i in $(ls -d */);
     // print the directory as subsection
    echo "## The ${i%/}";

    // find all files that ar not "*.sm.*" files and sort naturally
    for f in $(ls $i | grep -v ".sm" | sort -t - -k2 -g);
        // print each file to be included via the howto-image snippet
        echo "{% include howto-image.html src=\"/assets/kicad-howto/$i${f%.*}\" ext=\"${f##*.}\"";
        echo "   caption=\"Some Caption\" %}";

Which creates the following Markdown output:

## The 01-general
{% include howto-image.html src="/assets/kicad-howto/01-general/screen-1" ext="png"
   caption="Some Caption" % }
{ % include howto-image.html src="/assets/kicad-howto/01-general/screen-2" ext="png"
   caption="Some Caption" % }
{ % include howto-image.html src="/assets/kicad-howto/01-general/screen-3" ext="png"
   caption="Some Caption" % }