From: Jo-Philipp Wich Date: Sun, 3 Apr 2016 20:51:47 +0000 (+0200) Subject: Update generator script X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=daed6a5487edf5a688173595e5b2b75a8d6278d5;p=web.git Update generator script Signed-off-by: Jo-Philipp Wich --- diff --git a/generate.sh b/generate.sh index 8766717..ea6c42b 100755 --- a/generate.sh +++ b/generate.sh @@ -6,7 +6,28 @@ } D="$(pwd)" +O="-b html5 -a linkcss -a stylesdir=/css -a stylesheet=lede.css -a disable-javascript" -mkdir -p "$D/html/docs" -find "$D/pages/" -type f | xargs -L1 a2x -f xhtml -r "$D/" -a "toc!" -a "numbered!" -D "$D/html/" -find "$D/docs/" -type f | xargs -L1 a2x -f xhtml -r "$D/" -a "toc!" -a "numbered!" -D "$D/html/docs/" +copy() {( + cd "$1" + find . -type f | while read path; do + dest="$2/${path#./}" + mkdir -p "${dest%/*}" + cp -a "$path" "$dest" + done +)} + +render() {( + find "$1" -type f -name '*.txt' | while read path; do + dest="$2/${path#$1/}" + dest="${dest%.txt}.html" + mkdir -p "${dest%/*}" + asciidoc $O -o "$dest" "$path" + done +)} + +copy "$D/logo" "$D/html/logo" +copy "$D/css" "$D/html/css" + +render "$D/pages" "$D/html" +render "$D/docs" "$D/html/docs"