From 9c45d1f1ad7243aac19bba1e700c8aebad20b6a9 Mon Sep 17 00:00:00 2001 From: Lilian Besson Date: Fri, 23 Oct 2015 18:44:06 +0200 Subject: [PATCH] Small change. (New: if the title is not in the file, use the filename). --- strapdown2pdf | 3 +++ strapdown2pdf.sh | 1 + 2 files changed, 4 insertions(+) create mode 120000 strapdown2pdf.sh diff --git a/strapdown2pdf b/strapdown2pdf index 10805ab..88aa560 100755 --- a/strapdown2pdf +++ b/strapdown2pdf @@ -160,6 +160,9 @@ StrapDown2PDF() { # Now we have a pure Markdown file (at least we hope) title="$(grep -o -m 1 "[^<]*" "${input}" | grep -o ">.*<" | sed s/">"/""/ | sed s/"<"/""/)" + # New: if the title is not in the file, use the filename ! + defaulttitle="$(echo -e "${name}" | tr _ ' ')" + title="${title:-$defaulttitle}" echo -e "${cyan}I found this as a possible title${white} : $u${title}$U." | tee -a /tmp/strapdown2pdf.log if [ X"${htm}" = "Xtrue" ]; then diff --git a/strapdown2pdf.sh b/strapdown2pdf.sh new file mode 120000 index 0000000..3589074 --- /dev/null +++ b/strapdown2pdf.sh @@ -0,0 +1 @@ +strapdown2pdf \ No newline at end of file