exportmd: Embed images en docx, rtf, epub

This commit is contained in:
Cat /dev/Nulo 2022-06-24 16:58:11 -03:00
parent 5960280976
commit c6c4c6b201
1 changed files with 4 additions and 2 deletions

View File

@ -59,8 +59,10 @@ if test "$format" = epub -o "$format" = rtf -o "$format" = docx; then
#if which pandoc >/dev/null; then
# pandoc --reference-doc=$HOME/template.docx -s -o "$output" "$htmlfile"
if which libreoffice >/dev/null; then
echo libreoffice --headless --writer --convert-to "$format" "$htmlfile"
libreoffice --headless --writer --convert-to "$format" "$htmlfile"
embed_dir="$(mktemp -d)"
libreoffice --headless --writer --convert-to "html:HTML (StarWriter):EmbedImages" --outdir "$embed_dir" "$htmlfile"
libreoffice --headless --writer --convert-to "$format" "$embed_dir"/*
rm -r "$embed_dir"
else
echo "No tengo libreoffice para convertir a $format."
rm "$htmlfile"