Skip to content

Commit

Permalink
Finish Compile markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
reyoung committed Jan 22, 2017
1 parent 13274fa commit 385807a
Show file tree
Hide file tree
Showing 22 changed files with 6,506 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .tmpl/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

function find_line() {
local fn=$1
local x=0
cat $fn | while read line; do
local x=$(( x+1 ))
if echo $line | grep '${MARKDOWN}' -q; then
echo $x
break
fi
done
}

MD_FILE=$1
TMPL_FILE=$2
TPL_LINE=`find_line $TMPL_FILE`
cat $TMPL_FILE | head -n $((TPL_LINE-1))
cat $MD_FILE
cat $TMPL_FILE | tail -n +$((TPL_LINE+1))
Loading

0 comments on commit 385807a

Please sign in to comment.