2023-12-08 18:07:31 +00:00
|
|
|
#!/opt/homebrew/bin/bash
|
2023-06-14 19:15:13 +00:00
|
|
|
|
|
|
|
#set -x
|
|
|
|
|
2023-12-08 18:07:31 +00:00
|
|
|
[[ -f $SCRIPT_DIR/utils/journals.sh ]] && . $SCRIPT_DIR/utils/journals.sh
|
|
|
|
JOURNAL_FULL_INDEX=$PROJ_DIR/full_index.wiki
|
2023-06-14 19:15:13 +00:00
|
|
|
|
|
|
|
declare -a journals
|
|
|
|
get_journals journals
|
|
|
|
|
|
|
|
echo "
|
|
|
|
%title Full Index
|
|
|
|
|
|
|
|
# Journals: Times & Topics
|
|
|
|
$(
|
2023-12-08 18:07:31 +00:00
|
|
|
for file_path in ${journals[@]}; do
|
|
|
|
file="${file_path/*\/}"
|
|
|
|
journal_full_path=$PROJ_DIR$file_path
|
2023-06-14 19:15:13 +00:00
|
|
|
echo -e '\n\n'
|
2023-12-08 18:07:31 +00:00
|
|
|
echo "[[$file_path|$(echo $file | cut -d '.' -f 1 | tr '-' '/')]]"
|
2023-06-14 19:15:13 +00:00
|
|
|
|
|
|
|
echo "# Times"
|
|
|
|
while read time; do
|
2023-12-08 18:07:31 +00:00
|
|
|
echo " - [[$file_path#$time|$time]]"
|
|
|
|
done <<< "$( grep '== ' $journal_full_path | grep -Eo '[0-9]+:[0-9]+ [A-Za-z]{2} [A-Za-z]{3}')"
|
2023-06-14 19:15:13 +00:00
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo "# Topics"
|
|
|
|
while read topic; do
|
2023-12-08 18:07:31 +00:00
|
|
|
echo " - [[$file_path#$topic|$topic]]"
|
|
|
|
done <<< "$( grep -Eo '^===[=]* .+ ===[=]*' $journal_full_path | tr '=' ' ' | sort -u)"
|
2023-06-14 19:15:13 +00:00
|
|
|
done
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
" > $JOURNAL_FULL_INDEX
|