2 # $Id: tdiary-demogen.sh,v 1.5 2005/01/15 14:54:46 henoheno Exp $
4 # tDiary demonstration generator: generates many [theme].php
9 echo " $base [-d path/to/theme-directory] list"
10 echo " $base [-d path/to/theme-directory] interwiki"
11 echo " $base [-d path/to/theme-directory] touch"
13 echo " lis|list - List themes"
14 echo " int|interwiki - Publish interwiki definition and setting for each theme"
15 echo " tou|touch - Generate \$theme.php that includes index.php"
19 cd "$dir" || echo "Error: directory '$dir' not found";
20 ls -1 | while read theme; do
21 test -f "$theme/$theme.css" && echo "$theme"
25 # ---- Argument check ----
27 if [ "x-d" = "x$1" ] ; then
36 ''|-h|hel|help ) usage ;;
37 lis|list ) theme_list ;;
39 int|inte|inter|interw|interwi|interwik|interwiki)
41 echo '- [./$1.php theme] raw tDiary theme selector'
43 theme_list | while read theme; do
44 echo -n "+ [[theme:$theme]]"
45 grep -q div.sidebar "$dir/$theme/$theme.css" && echo -n " (sidebar)"
51 theme_list | while read theme; do
52 if [ -f "$theme.php" ]
53 then echo "Warning: '$theme.php' is already available. Ignoreing..."
55 cat <<EOF > "$theme.php"
57 define('TDIARY_THEME', '$theme');
58 require('./index.php')