2 # $Id: tdiary-demogen.sh,v 1.6 2005/01/16 03:26:14 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 echo '- (s) = sidebar CSS exists in this theme'
44 theme_list | while read theme; do
45 echo -n "+ [[theme:$theme]]"
46 grep -q div.sidebar "$dir/$theme/$theme.css" && echo -n " (s)"
52 theme_list | while read theme; do
53 if [ -f "$theme.php" ]
54 then echo "Warning: '$theme.php' is already available. Ignoreing..."
56 cat <<EOF > "$theme.php"
58 define('TDIARY_THEME', '$theme');
59 require('./index.php')