root / tmp / org.txm.setups / md2html2mail.sh @ 1603
Historique | Voir | Annoter | Télécharger (1,34 ko)
| 1 | 728 | mdecorde | #!/bin/bash |
|---|---|---|---|
| 2 | 728 | mdecorde | VERSION=`cat VERSION` |
| 3 | 728 | mdecorde | root="annonces" |
| 4 | 728 | mdecorde | |
| 5 | 728 | mdecorde | function toHTML {
|
| 6 | 728 | mdecorde | source=$1 |
| 7 | 728 | mdecorde | output=$2 |
| 8 | 728 | mdecorde | title=$3 |
| 9 | 728 | mdecorde | |
| 10 | 728 | mdecorde | rm $output |
| 11 | 728 | mdecorde | echo '<?xml version="1.0" encoding="UTF-8"?>' >> "$output" |
| 12 | 728 | mdecorde | echo "<!DOCTYPE html>" >> "$output" |
| 13 | 728 | mdecorde | echo "<html>" >> "$output" |
| 14 | 728 | mdecorde | echo " <head>" >> "$output" |
| 15 | 728 | mdecorde | echo ' <meta charset="utf-8" />' >> "$output" |
| 16 | 728 | mdecorde | echo " <title>title</title>" >> "$output" |
| 17 | 728 | mdecorde | echo " </head>" >> "$output" |
| 18 | 728 | mdecorde | echo " <body>" >> "$output" |
| 19 | 728 | mdecorde | echo " <h1>$title</h1>" >> "$output" |
| 20 | 728 | mdecorde | markdown $source >> "$output" |
| 21 | 728 | mdecorde | echo " </body>" >> "$output" |
| 22 | 728 | mdecorde | echo "</html>" >> "$output" |
| 23 | 728 | mdecorde | } |
| 24 | 728 | mdecorde | |
| 25 | 728 | mdecorde | source="${root}/mail.md/${VERSION}_fr.md"
|
| 26 | 728 | mdecorde | output="${root}/welcome.html/welcome_${VERSION}_fr.html"
|
| 27 | 728 | mdecorde | toHTML $source $output "Bienvenue dans TXM $VERSION" |
| 28 | 728 | mdecorde | |
| 29 | 728 | mdecorde | source="${root}/readme.md/${VERSION}beta_fr.md"
|
| 30 | 728 | mdecorde | output="${root}/welcome.html/welcome_${VERSION}beta_fr.html"
|
| 31 | 728 | mdecorde | toHTML $source $output "Bienvenue dans TXM $VERSION beta" |
| 32 | 728 | mdecorde | rm $output |
| 33 | 728 | mdecorde | |
| 34 | 728 | mdecorde | source="${root}/readme.md/${VERSION}_en.md"
|
| 35 | 728 | mdecorde | output="${root}/welcome.html/welcome_${VERSION}_en.html"
|
| 36 | 728 | mdecorde | toHTML $source $output "Welcome in TXM $VERSION" |
| 37 | 728 | mdecorde | |
| 38 | 728 | mdecorde | source="${root}/readme.md/${VERSION}beta_en.md"
|
| 39 | 728 | mdecorde | output="${root}/welcome.html/welcome_${VERSION}beta_en.html"
|
| 40 | 728 | mdecorde | toHTML $source $output "Welcome in TXM $VERSION beta" |
| 41 | 728 | mdecorde | |
| 42 | 728 | mdecorde | source="${root}/readme.md/${VERSION}_ru.md"
|
| 43 | 728 | mdecorde | output="${root}/welcome.html/welcome_${VERSION}_ru.html"
|
| 44 | 728 | mdecorde | toHTML $source $output "Welcome in TXM $VERSION" |
| 45 | 728 | mdecorde | |
| 46 | 728 | mdecorde | groovy MD2Mail.groovy |