#!/bin/bash
# noter 1.0.2 - @k@layer8.space - mit
nlog() {
local ORANGE='\033[0;33m'
local NO_COLOR='\033[0m'
echo -e "${ORANGE}[noter] | ${1} ${NO_COLOR}"
}
generate_note_html() {
local note_date="$(date -d "$(basename "$1" .txt)" +"%B %d, %Y")"
echo "
notes
" >"$output_file"
# loop for every note in notes
nlog "generating page..."
for file in $(ls -r notes/*.txt); do
nlog "processing: $file"
if [ -f "$file" ] && [ -s "$file" ]; then
generate_note_html "$file" >>"$output_file"
fi
done
# bottom navigation
echo "
" >>"$output_file"
echo "
" >>"$output_file"
echo "
last Updated: $(date +"%Y-%m-%d %H:%M:%S")
" >>"$output_file"
echo "
" >>"$output_file"
nlog "Done, please see: $output_file."