#!/bin/sh # Generates an index.html with support for rendering a README.md if present. # With -R an entire directory hierarchy can be converted. # generate-index-html [-R]
' # Assumes a BSD ls. ls -Flha | grep -Ev ' (\./|index\.html|README\.md|\.git/|\.gitignore)$' | \ cut -w -f 5- | sed -E 's|^([^\t]+\t+)([^ ]+ +)([^ ]+ +)([^ ]+ +)(.*[^*])\*?$|\1\2\3\4\5|' echo '' ) >index.html