From 5bf642a56141f8cb5484332e4e83140ca1d4d6ba Mon Sep 17 00:00:00 2001 From: christian taillon Date: Sat, 11 Mar 2023 17:24:03 -0700 Subject: [PATCH 1/4] Add newline option in flag generation section. --- bg2obs.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/bg2obs.sh b/bg2obs.sh index 233c7b08..c6d6509c 100644 --- a/bg2obs.sh +++ b/bg2obs.sh @@ -52,7 +52,7 @@ do i) verbose="true" ;; c) breadcrumbs_inline="true" ;; y) breadcrumbs_yaml="true" ;; - h|?) usage ;; + h|?) usage ;; esac done @@ -168,14 +168,18 @@ filename=${export_prefix}$chapter # Setting the filename fi fi - if [[ $boldwords = "true" && $headers = "false" ]] ; then - text=$(ruby bg2md.rb -e -c -b -f -l -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script - elif [[ $boldwords = "true" && $headers = "true" ]] ; then - text=$(ruby bg2md.rb -c -b -f -l -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script - elif [[ $boldwords = "false" && $headers = "true" ]] ; then - text=$(ruby bg2md.rb -e -c -f -l -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script - else - text=$(ruby bg2md.rb -e -c -f -l -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script + if [[ $boldwords = "true" && $headers = "false" && $newline = "false" ]] ; then + text=$(ruby bg2md.rb -e -c -b -f -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script + elif [[ $boldwords = "true" && $headers = "true" && $newline = "false" ]] ; then + text=$(ruby bg2md.rb -c -b -f -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script + elif [[ $boldwords = "false" && $headers = "true" && $newline = "false" ]] ; then + text=$(ruby bg2md.rb -e -c -f -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script + elif [[ $boldwords = "true" && $headers = "false" && $newline = "true" ]] ; then + text=$(ruby bg2md.rb -e -c -b -f -l -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script + elif [[ $boldwords = "true" && $headers = "true" && $newline = "true" ]] ; then + text=$(ruby bg2md.rb -c -b -f -l -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script + elif [[ $boldwords = "false" && $headers = "true" && $newline = "true" ]] ; then + text=$(ruby bg2md.rb -e -c -f -l -r -v "${translation}" "${book} ${chapter}") # This calls the 'bg2md_mod' script fi @@ -222,7 +226,7 @@ alias="Aliases: [${book} ${chapter}]" # Add other aliases or 'Tags:' here if des elif [ ${aliases} == "false" ] && [ ${breadcrumbs_yaml} == "true" ]; then yaml="${yaml_start}${bc_yaml}${yaml_end}" fi - + export="${yaml}${export}" # Export @@ -269,4 +273,4 @@ find . -name "*.md" -print0 | xargs -0 perl -pi -e 's/\ Date: Sat, 11 Mar 2023 17:25:47 -0700 Subject: [PATCH 2/4] Add new line option in command line args processing. --- bg2obs.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bg2obs.sh b/bg2obs.sh index c6d6509c..267691f8 100644 --- a/bg2obs.sh +++ b/bg2obs.sh @@ -42,7 +42,7 @@ breadcrumbs_inline="false" # Print breadcrumbs in the file breadcrumbs_yaml="false" # Print breadcrumbs in the YAML # Process command line args -while getopts 'v:beaicy?h' c +while getopts 'v:beaincy?h' c do case $c in v) translation=$OPTARG ;; @@ -50,6 +50,7 @@ do e) headers="true" ;; a) aliases="true" ;; i) verbose="true" ;; + n) newline="true" ;; c) breadcrumbs_inline="true" ;; y) breadcrumbs_yaml="true" ;; h|?) usage ;; From 4bcaf3d2c4b6168ddc1f2e7e7b07e2d179bb838e Mon Sep 17 00:00:00 2001 From: christian taillon Date: Sat, 11 Mar 2023 17:27:13 -0700 Subject: [PATCH 3/4] Set newline option in defaults. --- bg2obs.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bg2obs.sh b/bg2obs.sh index 267691f8..63a76eca 100644 --- a/bg2obs.sh +++ b/bg2obs.sh @@ -38,6 +38,7 @@ boldwords="false" # Set words of Jesus in bold headers="false" # Include editorial headers aliases="false" # Create an alias in the YAML front matter for each chapter title verbose="false" # Show download progress for each chapter +newline="false" # Start chapters and verses on a new line breadcrumbs_inline="false" # Print breadcrumbs in the file breadcrumbs_yaml="false" # Print breadcrumbs in the YAML From 739fb139c0b63eec1d8104b0a7456d5088855ad6 Mon Sep 17 00:00:00 2001 From: christian taillon Date: Sat, 11 Mar 2023 17:48:39 -0700 Subject: [PATCH 4/4] Updating documentation to reflect the addition of the new line flag. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a31fe06c..6606af5e 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ Several options are available via command-line switches. Type `bash bg2obs.sh -h | `-e` | Include editorial headers (default is Off)| | `-a` | Create an alias in the YAML front matter with a more user-friendly chapter title (e.g., "Genesis 1") (default is Off)| | `-i` | Show progress information while the script is running (i.e. "verbose" mode) (default is Off)| +| `-n` | Start chapters and verses on a new line that starts with an H5 or H6 heading (default is Off)| | `-c` | Include *inline* navigation for the [breadcrumbs](https://github.com/SkepticMystic/breadcrumbs) plugin (e.g. 'up', 'next','previous') (default is Off)| | `-y` | Include navigation for the breadcrumbs plugin in the *frontmatter* (YAML) (default is Off)| | `-h` | Display help |