#!/bin/bash

# Loop through all .md files in the current directory
for file in *.md; do
    # Check if the file exists (prevents error if no .md files)
    [ -e "$file" ] || continue

    # Remove the .md extension to get the base name
    name="${file%.*}"

    # Create the .upphtml file with the specified contents
    echo '#!' > "./$name.upphtml"
    echo "lowdown \"\$1/$file\"" >> ./$name.upphtml
    echo '#!' >> "./$name.upphtml"

    # Print a status message
    echo "Created $name.upphtml"
done
