File: md2html

package info (click to toggle)
backup2l 1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 680 kB
  • sloc: sh: 7,343; makefile: 7
file content (36 lines) | stat: -rwxr-xr-x 912 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

source=README.md
target=README.html
title="backup2l: README"

if test ! -e ${source}
then
    echo "Please add file ${source} into the current directory!"
    exit 1
fi

if test -x /usr/bin/pandoc
then

    echo "Converting ..."
    pandoc --quiet \
        -r markdown -w html \
        --title-prefix="XXTITELXX" \
        --email-obfuscation=references \
        --standalone   ${source}  |\
      sed "s#XXTITELXX...#${title}#" |\
      sed "s#line-height: 1.5#line-height: 1.35#" |\
      sed "s#font-size: 20px#font-size: 18px#" |\
      sed "s#max-width: 36em#max-width: 42em#" |\
      sed "s#max-width: 600px#max-width: 720px#" |\
      sed "s#font-size: 85%#font-size: 75%#" |\
      sed "s#overflow: auto#overflow: auto;\n      line-height: 1.15#" >${target}

    sleep 0.4
    echo "${source} converted to ${target}."

else
    echo "Please install the tool pandoc - Abort!"
    exit 1
fi