Small change. (New: if the title is not in the file, use the filename).

This commit is contained in:
Lilian Besson
2015-10-23 18:44:06 +02:00
parent 21ff5a1d7c
commit 9c45d1f1ad
2 changed files with 4 additions and 0 deletions

View File

@@ -160,6 +160,9 @@ StrapDown2PDF() {
# Now we have a pure Markdown file (at least we hope)
title="$(grep -o -m 1 "<title>[^<]*</title>" "${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

1
strapdown2pdf.sh Symbolic link
View File

@@ -0,0 +1 @@
strapdown2pdf