✨(project) first proof of concept printing pdf from markdown
This is a boilerplate inspired from https://github.com/openfun/joanie
This commit is contained in:
22
src/mail/bin/html-to-plain-text
Executable file
22
src/mail/bin/html-to-plain-text
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
# Run html-to-text to convert all html files to text files
|
||||
DIR_MAILS="../backend/core/templates/mail/"
|
||||
|
||||
if [ ! -d "${DIR_MAILS}" ]; then
|
||||
mkdir -p "${DIR_MAILS}";
|
||||
fi
|
||||
|
||||
if [ ! -d "${DIR_MAILS}"html/ ]; then
|
||||
mkdir -p "${DIR_MAILS}"html/;
|
||||
exit;
|
||||
fi
|
||||
|
||||
for file in "${DIR_MAILS}"html/*.html;
|
||||
do html-to-text -j ./html-to-text.config.json < "$file" > "${file%.html}".txt; done;
|
||||
|
||||
if [ ! -d "${DIR_MAILS}"text/ ]; then
|
||||
mkdir -p "${DIR_MAILS}"text/;
|
||||
fi
|
||||
|
||||
mv "${DIR_MAILS}"html/*.txt "${DIR_MAILS}"text/;
|
||||
9
src/mail/bin/mjml-to-html
Executable file
9
src/mail/bin/mjml-to-html
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Run mjml command to convert all mjml templates to html files
|
||||
DIR_MAILS="../backend/core/templates/mail/html/"
|
||||
|
||||
if [ ! -d "${DIR_MAILS}" ]; then
|
||||
mkdir -p "${DIR_MAILS}";
|
||||
fi
|
||||
mjml mjml/*.mjml -o "${DIR_MAILS}";
|
||||
Reference in New Issue
Block a user