From c65925791047e80cec18ae116bc9e1cd89bf6c6f Mon Sep 17 00:00:00 2001 From: wael Date: Sat, 4 Sep 2021 19:50:58 +0300 Subject: [PATCH] Documentation-generating script done mostly, just need to make it detect the files automatically or as input arguments. --- docs/generate_docs.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/generate_docs.sh b/docs/generate_docs.sh index 7b1ea7b..0bd309e 100755 --- a/docs/generate_docs.sh +++ b/docs/generate_docs.sh @@ -4,6 +4,27 @@ # TODO: create options for generating different file types (pdf, html or utf8 to console/file). # Prompt user at the start for what type they want. +# Prompt the user for the option they want (pdf/html/utf8). +echo "Please choose an output option: pdf, html or utf8." +select choice in "pdf" "html" "utf8"; do + case $choice in + pdf ) + filetype="pdf"; + break;; + + html ) + filetype="html"; + break;; + + utf8 ) + filetype="utf8"; + break;; + esac +done + +# Debug print. +#echo $filetype + # Get the initial root. root_directory=$(pwd) @@ -18,7 +39,7 @@ for i in $filepaths; do # Get the input and output file names. input_file=$(basename $i) - output_file=$(echo $input_file | sed 's/ms/pdf/') + output_file=$(echo $input_file | sed "s/ms/$filetype/") # Debug prints. #echo "current_directory = $current_directory"