# HG changeset patch # User Yasutaka Higa # Date 1391145007 -32400 # Node ID e0c4a349c94fdadadbd3457fef725c1185f40b88 # Parent f6d65d2a806f45827609a4798770089f55024417 Copy template when generate new slide diff -r f6d65d2a806f -r e0c4a349c94f build.sh --- a/build.sh Thu Jan 30 22:08:04 2014 +0900 +++ b/build.sh Fri Jan 31 14:10:07 2014 +0900 @@ -17,7 +17,7 @@ } build_slides() { - target_list=`find $(dirname $0) -name "${build_target_filename}"` + target_list=`find "$(dirname $0)/${slide_root_dirname}" -name "${build_target_filename}"` for target in ${target_list}; do build $target done diff -r f6d65d2a806f -r e0c4a349c94f config/definition.sh --- a/config/definition.sh Thu Jan 30 22:08:04 2014 +0900 +++ b/config/definition.sh Fri Jan 31 14:10:07 2014 +0900 @@ -1,13 +1,14 @@ #!/bin/sh -# build definitions - -build_command="slideshow" -build_template_option="-t s6syntax" -build_target_filename="*.md" - # new slide definitions slide_root_dirname="slides" slide_date_format="%Y%m%d" slide_name="slide.md" +slide_template_file="template/${slide_name}" + +# build definitions + +build_command="slideshow" +build_template_option="-t s6syntax" +build_target_filename=${slide_name} diff -r f6d65d2a806f -r e0c4a349c94f new_slide.sh --- a/new_slide.sh Thu Jan 30 22:08:04 2014 +0900 +++ b/new_slide.sh Fri Jan 31 14:10:07 2014 +0900 @@ -35,6 +35,7 @@ slide_full_path="${dir_full_path}/${slide_name}" mkdir -p ${dir_full_path} -touch ${slide_full_path} +if !([ -f ${slide_full_path} ];) then + cp ${slide_template_file} ${slide_full_path} +fi echo ${slide_full_path} - diff -r f6d65d2a806f -r e0c4a349c94f template/slide.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/template/slide.md Fri Jan 31 14:10:07 2014 +0900 @@ -0,0 +1,6 @@ +title: Presentation title + +# hoge + +* fuga +* piyo