Statistics
| Revision:

root / tmp / org.txm.setups / md2html2mail.sh @ 1120

History | View | Annotate | Download (1.3 kB)

1
#!/bin/bash
2
VERSION=`cat VERSION`
3
root="annonces"
4

    
5
function toHTML {
6
	source=$1
7
	output=$2
8
	title=$3
9

    
10
	rm $output
11
	echo '<?xml version="1.0" encoding="UTF-8"?>' >> "$output"
12
	echo "<!DOCTYPE html>" >> "$output"
13
	echo "<html>" >> "$output"
14
	echo " <head>" >> "$output"
15
	echo '  <meta charset="utf-8" />' >> "$output"
16
	echo "  <title>title</title>" >> "$output"
17
	echo " </head>" >> "$output"
18
	echo " <body>" >> "$output"
19
	echo "  <h1>$title</h1>" >> "$output"
20
	markdown $source >> "$output"
21
	echo " </body>" >> "$output"
22
	echo "</html>" >> "$output"
23
}
24

    
25
source="${root}/mail.md/${VERSION}_fr.md"
26
output="${root}/welcome.html/welcome_${VERSION}_fr.html"
27
toHTML $source $output "Bienvenue dans TXM $VERSION"
28

    
29
source="${root}/readme.md/${VERSION}beta_fr.md"
30
output="${root}/welcome.html/welcome_${VERSION}beta_fr.html"
31
toHTML $source $output "Bienvenue dans TXM $VERSION beta"
32
rm $output
33

    
34
source="${root}/readme.md/${VERSION}_en.md"
35
output="${root}/welcome.html/welcome_${VERSION}_en.html"
36
toHTML $source $output "Welcome in TXM $VERSION"
37
     
38
source="${root}/readme.md/${VERSION}beta_en.md"
39
output="${root}/welcome.html/welcome_${VERSION}beta_en.html"
40
toHTML $source $output "Welcome in TXM $VERSION beta"
41

    
42
source="${root}/readme.md/${VERSION}_ru.md"
43
output="${root}/welcome.html/welcome_${VERSION}_ru.html"
44
toHTML $source $output "Welcome in TXM $VERSION"
45

    
46
groovy MD2Mail.groovy