From 135014d24a092ccdd9f996f2b33f006552090907 Mon Sep 17 00:00:00 2001 From: Jose Falanga Date: Mon, 3 Nov 2025 16:52:54 -0300 Subject: [PATCH] build markdown on indexes --- lib/functions/subshell/build_page.sh | 2 +- lib/functions/subshell/build_toc.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/functions/subshell/build_page.sh b/lib/functions/subshell/build_page.sh index 881b40b..352db5a 100644 --- a/lib/functions/subshell/build_page.sh +++ b/lib/functions/subshell/build_page.sh @@ -17,7 +17,7 @@ cd $(dirname $1) get_page_metadata $page if [[ $is_toc == "true" ]]; then - build_toc $page + build_toc "$page" "$process_markdown" elif [[ $process_markdown == "false" ]]; then build_header index.html cat $page | sed -e '1,/END ARISE/d' | cat >> index.html diff --git a/lib/functions/subshell/build_toc.sh b/lib/functions/subshell/build_toc.sh index 382d435..633fedc 100644 --- a/lib/functions/subshell/build_toc.sh +++ b/lib/functions/subshell/build_toc.sh @@ -12,6 +12,7 @@ build_toc() ( # Throw the metadata header together and add the source file to the list of files to remove in cleanup toc_source=$(basename $1) +append_markdown="$2" cd $(dirname $1) get_page_metadata $toc_source echo "$(realpath $toc_source)" >> $removelist @@ -42,6 +43,12 @@ done sort -r $toc_tmp >> index.html rm $toc_tmp +# After building TOC table +if [[ "$append_markdown" == "true" ]]; then + # append markdown content from the same page + sed -e '1,/END ARISE/d' "$toc_source" | pandoc -f markdown -t html >> index.html +fi + # Final page bits cat >> index.html <