File: mk-mlton-guide.sh

package info (click to toggle)
mlton 20130715-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 60,900 kB
  • ctags: 69,386
  • sloc: xml: 34,418; ansic: 17,399; lisp: 2,879; makefile: 1,605; sh: 1,254; pascal: 256; python: 143; asm: 97
file content (44 lines) | stat: -rwxr-xr-x 1,022 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
37
38
39
40
41
42
43
44
#!/bin/sh

pages=$(for page in $@; do echo $page; done | LC_ALL=C sort -f)

xform () {
    page=$1
    echo ":mlton-guide-page: ${page}"
    echo "[[${page}]]"
    # echo "include::${page}.txt[]"
    cat txt/${page}.txt |
    # sed -e '1 { s/\(.*\)/[['${page}']]\1/; h; N; g; s/./=/g; x; G; }' |
    sed -e '/^:toc:$/ { d; }' |
    cat
}

echo "MLton Guide ({mlton-version})"
echo "============================="
echo ":toc:"
echo ":mlton-guide-page!:"
echo ""
echo "[abstract]"
echo "--"
echo "This is the guide for MLton, an open-source, whole-program, optimizing Standard ML compiler."
echo ""
echo "This guide was generated automatically from the MLton website, available online at http://mlton.org. It is up to date for MLton {mlton-version}."
echo "--"
echo ""
echo ""
echo ":leveloffset: 1"
for page in Home; do
    echo ""
    xform ${page}
    echo ""
    echo "<<<"
done
for page in ${pages}; do
    case ${page} in
        Home) continue;;
    esac
    echo ""
    xform ${page}
    echo ""
    echo "<<<"
done