forked from FRRouting/frr-www
-
Notifications
You must be signed in to change notification settings - Fork 0
/
format-community
executable file
·40 lines (33 loc) · 1.05 KB
/
format-community
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
#! /bin/bash
#-----------------------------------------------------------------------------------------
#
# Copyright 2017 Cumulus Networks, inc all rights reserved
# author: [email protected]
# license: GPL-2
#
# generate community html files from markdown files
#
#-----------------------------------------------------------------------------------------
usage() {
[ "$*" == "" ] || echo; echo "ERROR: $*"
echo
echo "$0 generates community html files from markdown files"
echo
echo "usage: $0"
echo
exit 1
}
#-----------------------------------------------------------------------------------------
# sanity check
#
[ $(which markdown) ] ||
usage "Need access to markdown, you should run this on the web server"
#-----------------------------------------------------------------------------------------
for I in community/*.md; do
F="www/community/$(basename ${I} .md).html"
echo "converting ... $I"
cat templates/header.html > $F
markdown $I >> $F
cat templates/footer.html >> $F
done
exit 0