#!/bin/bash
set -euxo pipefail

function convert_html() {
	echo "Now converting $1"
	[ -f $1 ] || return
	name=$(basename ${1%.md}.html)
	pandoc -f markdown $1 > html/$name || true
}
export -f convert_html

cd awesm-converter
cargo run ../lists --render-dir ../terminal --readme-dir ../readmes
cd ..
mkdir -p html
ls readmes | parallel convert_html readmes/{}

