How to install tdiary-full-1.5.5.tar.gz

2003.08.16

from:
http://www.tdiary.org/
http://www.tdiary.org/20030805.html

tdiary-full-1.5.5.tar.gz

出たコトには気が付いていたんだけど、入れるのがめんどくさくて しばらく放っておいた。
だって、次は、メジャーアップらしいんだモン。

でも、やっぱり、入れちゃった。



Install
今までのヤツを保存。
   $ cd  ~/public_html/ 
   $ mv ./tdiary/  ./tdiary-1.5.4/
tdiary-full-1.5.5.tar.gz を適当な場所(~/work/tdiary/)で展開して、 ~/pulic_html/tdiary/ に移動。
   $ cp -dpR  ~/work/tdiary/tdiary-1.5.4/  ~/pulic_html/

index.rb と、update.rb のパーミッションの実行属性を確認。
   -rwxr-xr-x  1 jun1  jun1   2313 Nov 13 13:14 public_html/tdiary/index.rb*
   -rwxr-xr-x  1 jun1  jun1   1872 Nov 17 00:25 public_html/tdiary/update.rb*

~/public_html/tdiary/tdiary.conf の編集
一番始めに、いじらなきゃならないのが、これ。
  # @data_path = '/home/foo/diary'
  @data_path = '/home/jun1/lib/tdiary'
  ---
  # @html_title = 'hogehoge diary'
  @html_title = 'Web 日記 tdiary'
@html_title は変えなくても、どうというコトはないが、@data_path は設定しないと、動かなくなる。


.htaccess の作成
~public_html/tdiary/dot.htaccess を ~/.htaccess にリネームして、編集。
  <  AuthUserFile  /home/foo/.htpasswd
  <  Require user  foo
  ---
  >  AuthUserFile  /home/jun1/.htpasswd
  >  Require user  jun1 

この後の、httpd.conf で設定する、パスワードの設定ファイルになる。

/etc/httpd/conf/httpd.conf の編集
今までに、いろいろいじって来ているが、それを更に編集して、下の様にした。
 # I added for tdiary 2002.07.06
 <Directory "/home/*/public_html/cgi-bin">
   AddHandler cgi-script .rb .cgi
   Options FollowSymLinks ExecCGI
 </Directory>

 #<Directory "/home/*/public_html/diary">
 <Directory "/home/*/public_html/tdiary"> 
   AddHandler cgi-script .rb .cgi
   Options FollowSymLinks ExecCGI
   DirectoryIndex index.rb
 </Directory>

 <Files "*.rhml">
   deny from all
 </Files>

 <Files "tdiary.*">
   deny from all 
 </Files>

 <Files update.rb>
   AuthName tDiary
   AuthType Basic
   AuthUserFile /home/jun1/.htpasswd
   Require user jun1
 </Files>

 # I added for DAMEX 2002.07.31
 <Directory "/home/*/public_html/damex">
   AddHandler cgi-script .cgi
   Options FollowSymLinks ExecCGI
   DirectoryIndex index.html
 </Directory>

 # I added for namazu on WebNIKKI 2002.10.17
 <Directory "/home/*/public_html/namazu">
   AddHandler cgi-script .cgi
   Options FollowSymLinks ExecCGI
   DirectoryIndex index.html
 </Directory>

 # 2002.10.29    ちなみに、ここから下は、mod_ruby のための設定で、後でもとに戻す。
 # tDiary no kousoku ka
 #<IfDefine HAVE_RUBY>
 #  LoadModule ruby_module modules/mod_ruby.so
 #</IfDefine>

 #<IfDefine HAVE_RUBY>
 #  AddModule  mod_ruby.c
 #</IfDefine>

 #<IfModule mod_ruby.c>
 #  # for Apache::RubyRun
 #  RubyRequire apache/ruby-run
 #  # exec *.rb as ruby scripts.
 #  <Files *.rb>
 #    SetHandler ruby-object
 #    RubyHandler Apache::RubyRun.instance
 #  </Files>
 #</IfModule>

Wiki Style を使える様に
2003/02 から、tdiary style から、Wiki style に書き込むスタイルを変えている。
その為、200302.td2 の中には tdiary style と Wiki style が混在していて、 何もしないで次に逝くと、エラって、 http://localhost/~jun1/tdiary/ アクセス出来ない。

するコトは簡単。
1.キャッシュのクリア
  PluginList にある、 clear.rb を使って、1.5.3 のキャッシュをクリア。


    あるいは、直接、キャッシュファイルを手で消す。
    $ su -
    # cd /home/jun1/lib/tdiary/cache/
       parser と、parser~ と、lastest.rb  を消す。
       tdiary.conf も、消す。
 
2.tDiary(1.5.3) を閉じる
  ブラウザ上の Web 日記を閉じるってコト。

3.ブラウザのキャッシュをクリア
  そのまんま。ブラウザのディスクキャッシュをクリアする。

4.tDiary 本体の入れ換え
  $ cd ~/pulic_html/
  
  $ mv ./tdiary/  ./tdiary-1.5.3/
  $ mv ~/work/tdiary/tdiary-1.5.4/  ./tdiary/ 
5.tdiary.conf の修正
  @style = 'tDiary'
   を、
  @style = 'wiki' 
   に、変更。
6.Wiki Style のファイルのインストール
  ~/public_html/tdiary/misc/style/wiki/ 以下にある、
   wiki_parser.rb
   wiki_style.rb
を、~/public_html/tdiary/tdiay/ にコピー。

http://localhost/~jun1/tdiary/ にアクセス
すると、プラグインが入っていない tdiary のページにアクセス出来る。

過去のデーターの移行 -> する必要ナシ
Wiki style の混入が原因だったけど、上で Wiki style を使える様にしたので、必要ナシ。

過去データーが ~/lib/tdiary-1.4/、
たった今作ったばかりのデーターの置き場所は ~/lib/tdiary/2002/。

ここで、無理矢理、過去データーに新規データーを追加。
$ mv ~/lib/tdiary/2002/ ~/lib/tdiary-1.4/

過去データーを今のデーターに偽装。
$ rm -rf ~/lib/tdiary/
$ mv ~/lib/tdiary-1.4/ ~/lib/tdiary/
$ chmod 777 ~/lib/tdiary/
$ su -
# cd /home/jun1/lib/tdiary/
# chown apache:apache -R .


tdiary 1.5 用の特殊なテキスト形式に変換 -> する必要ナシ
PStore 形式の移行に伴う固定バージョン
  1.4 -> 1.5
の場合のみに必要な作業。
1.5.1 の過去データ−をパックって書いているので、出てきた。
必要ないけど、一様、残しておく。

# cd /home/jun1/pulic_html/tdiary/
# ruby misc/convert2.rb
を実行すると、
 <span class="canchor">_</span>
 2001-09
 2001-10
 2001-11
 2001-12
 2002-01
 2002-05
 2002-07
 2002-08
 2002-09
 2002-10
 2002-11
 2002-12
ってなメッセージが出て、~/lib/tdiary/ 以下に、
tdiary 1.5 用に変換された過去データーが、 年ごとに作られる。
もともとあった、~/lib/tdiary/ 直下のファイルは不要らしい
が、恐いので、しばらく取っておく。


apache を再起動
これも、今回は、必要なし。

# /etc/rc.d/init.d/httpd restart


設定
まずは、「トップ」で飛べるトップページを

http://localhost/~jun1/damex/frame.html

に変更して、タイトルを Web 日記 tdiary に変更。
やっぱり見慣れたタイトルの方が落ち着くね。


お次ぎは、やっぱりサイドバー化と、スタイルの変更でしょう
以下、内容、古し。
default のスタイルがそのままでした。
いじる必要なし

Asumi日記 のページソースを見ると、
theme/default/default.css ってな記述があるので、
wget http://sho.tdiary.net/theme/default/default.css をしてみる。

で、~/public_html/tdiary/theme/default/ を default.org にして、新しく作りなおした、
default/ に default.css を入れてみる。
んで、再起動。
んがーーー、って、変わってないじゃん。
default がそのまま Asumi 日記のスタイルだったのね。


サイドバー化
1.5.3 の設定のコピペで済ます。
1.5.3 そのままなので、各種プラグインへの設定も入っているので、 見た目はかなりヘンになるけど、気にせず、設定して逝くベシ。

ヘッダ:
  <div class="main">
  <%=navi%><br>
  <h1><a href="http://localhost/~jun1/tdiary/">Web 日記 tDiary</a></h1>
  <div style="margin-left: 1em;">
    <%=todo%>
  </div>
  <%= till "20030528|(05/28 水) コンタクト交換日"%><br>
  <%= till "20030524|(05/24 土) 鴻池の結婚式"%>
  <div align="right"><%= calendar %></div>
フッタ:
  </div>
  <div class="sidebar">
  <div align="center">
    <%= calendar2 %><hr>
    <div class="search">
      <%= namazu_form("../namazu/namazu.cgi","探す","16","")%>
    </div>
    <%=category_form %>
  </div><hr>
  <div align="center">
  <!-- <%= navi_a "a.rb"  %>   ボタンは、使わない-->
  <!-- <%= navi_t "todo" %> -->
  <!-- <%= navi_plugin %> -->
      <a href="http://www.tdiary.org/"><img src="./plugin/tdiary1.gif"  style="border: 0px"></a>
      <a href="http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi"><img src="./plugin/tdiaryu5.gif"  style="border: 0px"></a><br>
      <%=a "http://localhost/~jun1/waste/battle.rhtml", "散財自慢" %><br>
      <%=a "http://localhost/~jun1/damex/frame.html", "DAMEX" %><br>
      <%=a "http://localhost/~jun1/sanzai/", "散在日記" %><br>
      <%=a "http://www.google.com/intl/ja/", "Google" %><br>
      <%=a "http://vinelinux.org/", "Vine Linux" %><br>
      Vine FTP Site<br>
      <%=a "ftp://core.ring.gr.jp/pub/linux/Vine/", "core.ring" %>
      <%=a "ftp://ftp.ryukyu.ad.jp/pub/Vine/", "  ftp.ryukyu" %><br><hr>
      <%=a "http://localhost/~jun1/tdiary/pluginviewer.rb","Plugin Viewer" %><br>
      <%=a "http://localhost/~jun1/tdiary/a_conf.rb", "a_conf" %><br>
      <%=a "http://localhost/~jun1/tdiary/todo.rb", "todo" %><br>
      <%=a "http://localhost/~jun1/tdiary/?year=2003&month=ALL&category=ALL","CATEGORY 2003 ALL"%><br>
      <%=a "http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?Wiki%A5%B9%A5%BF%A5%A4%A5%EB","Wiki Style" %><br>
      <%=a "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tdiary/#dirlist","Source Forge" %><br><hr></div>

    <%= title_list(true) %><hr>
  </div> <!-- サイドバーここまで -->

  <div align="right">
    <%=calendar%>
    <%=navi%><br>
    <h3><a href="http://localhost/~jun1/tdiary/">ページの頭に帰る</a></h3>
    <br><br>
  </div>
  <%=nazo%>


default.css
~/public_html/tdiary/theme/default/default.css を直接編集。
ちょびっと見た目を変える。

 左上に出している、良く見る型のカレンダーを大きくする
 
  /* calendar2 */
  table.calendar {
  /*      font-size: x-small; */
          font-size: small;
          line-height: 1.1em;
          border-style: solid;
          border-color: #aaf;
          border-width: 1px;
  }
 サイドバーの左側に出す、最近のタイトルの文字を小さくする。
  div.recentsubtitles {
  /*      font-size: 0.9em; */
          font-size: 0.8em;
          margin-top: 0px;
          margin-bottom: 1em;
          margin-left: 1em;
  }
 こんだけで、随分、見た目の印象が変わって来る。
 記入フォームの編修:
 update.rb から入れる、記入する窓の大きさを大きくする。
 
   form.update textarea {
   /*    width: 35em; */
         width: 43em;
   /*    height: 15em; */
         height: 23em; 
   }

 /* Set calendar2 from card.css */
 /*
 全体の外枠の色を変えるときはborder-color:を変更する
 */
 table.calendar {
 	text-align: center;
	color: #000000;
 /*	background-color: #eee;  */
	border-style: solid;
	border-color: #818ccc;
	border-width: 1px;
	margin-bottom: 1em;
	padding: 2px;
 }

 td.calendar-current-month {
	font-size: 1em;
	text-align: center;
 }

 td.calendar-next-month {
	font-size: 1em;
	text-align: right;
 }

 td.calendar-prev-month {
	font-size: 1em;
	text-align: left;
 }

 td.calendar-sunday {
	color: red;
	background-color: #fbb;
	font-size: 1em;
	text-align: center;
 }

 td.calendar-saturday {
	color: blue;
	background-color: #bbf;
	font-size: 1em;
	text-align: center;
 }

 td.calendar-weekday {
	color: #000000;
	background-color: #ddd;
	font-size: 1em;
	text-align: center;
 }

 td.calendar-day {
	font-size: 1em;
	text-align: right;
 }

 /* Set color for red.rb */
 .attention {
        color: red;
        background-color: transparent;
 }

mod_ruby による、高速化
参考:yamk 日記 と、DAMEX の tDiary Web 日記 の高速化

1.mod_ruby-0.9.7-0vl2.src.rpm をインストール。
   # rpm -ivh mod_ruby-0.9.7-0vl2.i386.rpm 

2./etc/httpd/conf/httpd.conf を修正
 以下の記述が「あったら」コメントにする。
   <IfDefine HAVE_RUBY>
     LoadModule ruby_module modules/mod_ruby.so
   </IfDefine>

   <IfDefine HAVE_RUBY>
     AddModule  mod_ruby.c
   </IfDefine>

   <IfModule mod_ruby.c>
     # for Apache::RubyRun
     RubyRequire apache/ruby-run
     # exec *.rb as ruby scripts.
     <Files *.rb>
       SetHandler ruby-object
       RubyHandler Apache::RubyRun.instance
     </Files>
   </IfModule> 
3.~/.htaccess を修正
AddHandler cgi-script .rb
をコメントにする。

4.apache を再起動
# /etc/rc.d/init.d/httpd restart

5.tDiary をリロード。
ってか、再読み込みをするだけ。

以外にも、イッパツで成功。
いや〜、速いって、いいねー。ページの切替えのトキや、記入フォームに入るトキ、なんかに、違いが出るね。


プラグイン squeeze.rb
yasqueeze.rb を使わずに、tdiary 添付の squeeze.rb を使用。
要は、namazu 用の検索フォームを出してくれる。

squeeze.rb の方が新しくて、yasqueeze.rb は squeeze.rb に吸収され たそうだ。
ってか、名前を変えただけらしい、と、だれかのページ に書いてあった。

やり方は、俺のインストール記録 と、tdiary-plugin-howto を 参照。

設定
~/public_html/tdiary/misc/plugin/squeeze.rb を、
プラグインディレクトリ( ~/public_html/tdiary/plugin/ )
にコピー。
@data_path は、デフォのまま( ~/lib/tdiary/cache/html/ ) でヨイのだが、一様、tdiary.conf を修正。
 プラグインのパス【オプション】 の部分に、
   @options['squeeze.output_path'] = '/home/jun1/lib/tdiary/cache/html'
 を、追加。

全ての日記を日別にHTML化
squeeze.rb を ~/pulic_html/diary/ に置いて、
~/lib/tdiary/cache/html/ を作って、 ルートで、入って、
# chown apache:apache -R ./html/ (cache もかな?)
# chmod 755 . もして、
# chmod 755 squeeze.rb 。

んで、ブラウザから http://localhost/~jun1/tdiary/squeeze.rb にアクセス。
すると、変換しましたよーってなメッセージがずらーと出る。
    Squeeze for tDiary 
    $Revision: 1.9 $ 
    Copyright (C) 2002 MUTOH Masao 

    Start! 
     0922 0923 0924 0925 0926 0927 0928 0929 0930 1001 1002 1003 1004
     1007 1008 1009 1010 1011 1012 1013 1014 1015 1020 1021 1022 1023 
     1024 1025 1026 1027 1028 1029 1030 1031 1101 1102 1103 1104 1105 
     1107 1110 1111 1116 1117 1202 1203 1204 1206 1208 1209 0113 0214 
     0308 0423 0509 0510 0511 0513 0514 0515 0707 0708 0711 0713 0714 
     0715 0719 0720 0721 0722 0723 0725 0726 0728 0729 0730 0731 0805 
     0806 0808 0809 0810 0811 0812 0813 0814 0815 0816 0819 0821 0826 
     0827 0828 0831 0901 0902 0904 0905 0907 0908 0909 0911 0912 0913 
     0914 0915 0916 0917 0918 0919 0920 0921 0922 0923 0925 0926 0928 
     0929 0930 1001 1002 1014 1015 1017 1018 1019 1020 1021 1023 1024 
     1026 1027 1028 1029 1030 1031 1101 1102 1103 1104 1105 1106 1107 
     1108 1109 1110 1111 1114 1117 1118 1119 1120 1121 1122 1123 1124 
     1127 1128 1129 1130 1201 1202 1203 1204 1205 1206 1207 1208 1209 
     1210 1211 1212 1214 1215 1216 1217 1218 1219 1221 1222 1223 1224 
     1225 1227 1228 1229 0104 0105 0106 0108 0109 0110 0111 0112 0113 
     0114 0116 0119 0120 0121 0122 0125 0126 0127 0128 0129 0130 0131 
     0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 
     0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 0225 0226 
     0227 0306 0307 0308 0309 0310 0311 0312 0313 0314 0315 0316 0317 
     0318 0319 0320 0321 0322 0323 0324 0325 0326 0327 0328 0329 0330 
     0331 0401 0402 0403 0404 0405 0406 0407 0408 0409 0410 0411 0412 
     0413 0414 0415 0416 0418 0419 0420 0421 0422 0423 0424 0425 0426 
     0427 0428 0429 0430 0501 0502 0503 0504 0505 0506 0507 0508 0509 
     0510 0511 0512 0513 0514 0515 0516 0517 0518 0519 0520 0521 0522

    End! 
ズラズラ〜 って出てきて、全ての日記を日別にHTML化するのが、終了。
~/lib/tdiary/cache/html/200?/ のサブディレクトリ以下に、HTML 化された日記が入っている。

つぎは、namazu の設定
  $ mkdir ~/public_html/namazu/ 
  $ cp /home/httpd/cgi-bin/namazu.cgi  ~/pulic_html/namazu/  
  $ vi ~/public_html/namazu/.namazurc 
  > Index      /home/jun1/lib/namazu 
  > Replace    /home/jun1/lib/tdiary/cache/html/(\d\d\d\d)/  http://localhost/~jun1/tdiary/?date=\1  

 namazu インデックスの作成:
  $ mknmz /home/jun1/lib/tdiary/cache/html/  --output-dir=/home/jun1/lib/namazu/ 

そん時のメッセージ
 athene :~:$ mknmz /home/jun1/lib/tdiary/cache/html/  --output-dir=/home/jun1/lib/namazu/ 
  検索対象のファイルを調べています...
  85個のファイルがインデックス作成の対象として見つかりました
  1/85 - /home/jun1/lib/tdiary/cache/html/2001/0922 [text/html]
  2/85 - /home/jun1/lib/tdiary/cache/html/2001/0923 [text/html]
  3/85 - /home/jun1/lib/tdiary/cache/html/2001/0924 [text/html]]
   -- 略 --
  83/85 - /home/jun1/lib/tdiary/cache/html/2002/0814 [text/html]
  84/85 - /home/jun1/lib/tdiary/cache/html/2002/0815 [text/html]
  85/85 - /home/jun1/lib/tdiary/cache/html/2002/0816 [text/html]
  インデックスを書き出しています...
  [基本]
  日付:                Thu May 22 22:56:55 2003
  追加された文書の数:  13
  更新された文書の数:  3
  サイズ (bytes):      62,285 
  合計の文書数:        312
  追加キーワード数:    471
  合計キーワード数:    22,338
  わかち書き:          module_kakasi -ieuc -oeuc -w
  経過時間 (秒):       4
  ファイル/秒:         4.00
  システム:            linux
  Perl:                5.006001
  Namazu:              2.0.12
~/lib/namazu/ に、namazu index file( NMZ で始まるファイル )が沢山生成されて、終了。

alias の設定:
.bash_profile で、設定。
   alias td.nmz='mknmz /home/jun1/lib/tdiary/cache/html --output-dir=/home/jun1/lib/namazu/' 
以後、上のコマンドは、td.nmz で実行。


ブラウザに検索フォームを作る:
search_form.rb を、misc/plugin/ から持ってきて、プラグインディレクトリにコピー。

フッタを編集
   <div class="search">
    <%= namazu_form("../namazu/namazu.cgi","探す","16","")%>
  </div>
 
すれば、検索フォ-ムから、検索が出来るようになる。


プラグイン a.rb
1.5.4 から、デフォで収録された。
なので、以下の内容は古いものになっている。

 a.rb:
   ~/public_html/tdiary/misc/plugin/ から、
   ~/public_html/tdiary/plugin/ にコピー
 a_conf.rb:
   ~/public_html/tdiary/misc/plugin/a/ から、
   ~/public_html/tdiary/ にコピーして、
   パーミッション755 を付ける。 
 a_conf.rhtml:
   ~/public_html/tdiary/misc/plugin/a/ から、
   ~/public_html/tdiary/skel/ にコピー。

http://localhost/~jun1/tdiary/a_conf.rb をブラウザから開くと、 アクセス出来る。

登録した辞書は、~/lib/tdiary/cache/ 以下の、
  a.dat になる。

---- 以下、1.5.3 につき、内容古し ---
アンカー自動生成プラグイン。
http://home2.highway.ne.jp/mutoh/tools/ruby/ja/a.html

a.rb を プラグインディレクトリ(~/public_html/tdiary/plugin/) に落とす。
a_conf.rb を tdiary直下(~/public_html/tdiary/) に落とし、実行属性(755)をつける。
a_conf.rhtml( 辞書ファイル編集CGI PC用 ) を~/public_html/diary/skel/ に落とす。
http://localhost/~jun1/tdiary/a_conf.rb にアクセスすると、辞書が作れる。
ハズが、出来ない。http://localhost/~jun1/tdiary/a_conf.rb にアクセスすると、
  undefined superclass `TDiary' (TypeError) 
  /home/jun1/public_html/tdiary/a_conf.rb:51
なんて、理解不能なメッセージが出てしまう。

小手先だけど、前に使っていた辞書ファイルを持ってきたら、短縮だけは使えるようになった。
  # cd /home/jun1/lib/tdiary/cache/ 
  # cp /home/jun1/lib/tdiary-1.4.bak/cache/a.dat*  . 
うーーん、それにしても、なんで a._conf.rb にアクセスできないんだろ。
一晩、寝たけど、やっぱり直っていなかった。
  $ chmod +x a_conf.rb 
を、するのを、忘れずに。


プラグイン edit.rb
日毎表示で「更新」を「編集」に置き換えてくれる。
その日の日記を表示すれば、すぐに編集できる。
このファイルをpluginにコピーするだけで自動的に置き変わって、使用可能。

http://www.tdiary.org/20030805.html より、
   >  edit.rb: 本体統合に伴い廃止
なので、misc/plugin/ にある edit.rb は、ダミー。

プラグイン navi_user.rb
日毎表示で「更新」を「編集」に置き換えてくれる。
その日の日記を表示すれば、すぐに編集できる。
このファイルをpluginにコピーするだけで自動的に置き変わって、使用可能。

編集モードでも前の日記とか次の日記とかを編集出来る様にする。
  このヒト の手による修正を入れる。

と、いっても、navi_user.rb 自身が何も変更されていないので、 1.5.3 のトキの navi_user.rb にパッチを当てたものをそのまま 1.5.4 のプラグインディレクトリに持ってきただけ。

本体への統合につき、
  ~/public_html/tdiary/misc/plugin/navi_user.rb
を、~/pulic_html/tdiary/plugin/
に、コピーするだけ。

プラグイン calendar2.rb
どこぞで見たことのある、カレンダーを表示してくれる。

~/public_html/tdiary/plugin/ にコピーするだけで、使用可能。


プラグイン dropdown_calendar.rb
横長に月別に表示している calenar (一覧形式でカレンダーを表示するデフォルトのcalendar、といふらしい)をドロップダウンにしてくれる。

~/public_html/tdiary/plugin/ にコピーするだけで、使用可能。


title_list
現在表示している月のタイトルリストを表示。
サイドバーにしていると、威力100倍。
サイドバー化しないと、威力1/100倍。
ってか、意味なし。

ヘッダ、フッタをいじらないと逝けいない。
詳しくは、上のヘッダ、フッタを見るべし。

~/public_html/tdiary/misc/plugin/title_list.rb を、
~/public_html/tdiary/plugin/
に、コピーするだけ。

~/public_html/tdiary/plugin/recent_list.rb を直接編集
表示する日数を30日から、60日に変更。
 #def recent_list(days = 30, date_format = nil, title_with_body = nil, show_size = nil, show_title = nil, extra_erb = nil)
 def recent_list(days = 60, date_format = nil, title_with_body = nil, show_size = nil, show_title = nil, extra_erb = nil) 

プラグイン navo.rb
~/public_html/tdiary/plugin に置くだけで、使用可能。
ジャンプ先のエレメントをハイライトしてくれる。


プラグイン footnote.rb
~/public_html/tdiary/plugin に置くだけで、使用可能。
脚注を付けられる様にする。


プラグイン category.rb
これがないと、もう生活出来ません。
ってぐらい便利な機能。
日記をカテゴリ分けしてくれまふ。

~/public_html/tdiary/plugin に置くだけで、使用可能だけど、 「設定」に入力フォームを入れると、更に、過去のカテゴリを見ることも可能。

参考:
  trial


プラグイン jdate.rb
jdate.rb 日本語の曜日名を出すプラグイン。
~/public_html/tdiary/plugin/ に入れて、日付フォーマットを「%J」にすると、使用可能。
ずっと前から欲しかった機能。
今までどう設定しても曜日がローマ字表示にしかならなかったらその機能が含まれていなかったんだね。
ローマ字って、見にくいんだよな。

「編集」-「設定」から、
%Y-%m-%d を、
<font size=+1>%Y-%m-%d(%J)</font>
に、変更。

%J を、%j にしてしまうと、とんでもないコトになるので、注意。

更に、size=+1 を、size="+1" にしてしまうと、画面一番上の一行目の、
サイドバーの境目に、ヘンな文字が出てしまうので、これも、注意。

プラグイン weather.rb
weather.rb を ~/public_html/tdiary/plugin/ に入れる。

~/public_html/tdiary/tdiary.conf を修正
  @options['weather.url'] = 'http://weather.noaa.gov/weather/current/RJTT.html' 
  @options['weather.url'] = 'http://weather.noaa.gov/weather/current/RJOO.html' 
を、追加。

参考は、
http://localhost/~jun1/tdiary/?date=20030312#p05
http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?weather%2Erb


1.5.5 から、正式に取り込まれた模様。
misc/plugin/ に weather.rb が入っていた。

misc/plugin/weather.rb を、
~/public_html/tdiary/plugin/ にコピー。

tDiary の設定画面に「その日の天気」の項目が追加される。

http://weather.noaa.gov/weather/current/RJTT.html
を、天気データ に、入力して、お終い。

あとは、新しい日に、新しい日記を追加すれば、自動的にその日の天気が表示される ハズ。


Plugin Viewer
参考:
http://localhost/~jun1/tdiary/?date=20030225#p07
http://ponx.s5.xrea.com/hiki/ja/plugin_viewer.html

作者のページから、 tDiary-1.5.x向けの、pluginviewer-1.0.3.tar.gz を落として来て、 適当な場所で展開。

1.Diary本体のディレクトリ直下(index.rb, update.rbがあるディレクトリ)に pluginviewer.rb, pluginlist.rbをコピー。

2. pluginviewer.rb に index.rb, update.rb と同じアクセス権,パーミッション(755)を付ける。 WWWサーバ(apache) が CGI として実行出来る様になる状態にするってコト。

3.plugin ディレクトリに plugin/plugin.rb をコピー。

4.skel ディレクトリにskel/plugin*.rhtmlをコピー。

確認ページ、http://localhost/~jun1/tdiary/pluginviewer.rb にブラウザからアクセスして、設定が正しいか、確認。

<%= navi_plugin %>
を、ヘッダ/フッタの入れたい箇所に追加する。


プラグイン till.rb
「〜の日まであと○日」と日数を表示するプラグイン。
取説ページから直接コピペで落とすべし。なぜなら、ダウンロードのページは無いから。

記入箇所がヘッダに直接なのが、ちょっと。 だけど、使える。まさに、これぞ、俺が求めていたプラグイン!

でも、早速修正を入れさせてもらいました。
つっても、フォントの設定部分に赤色を入れて、 日にちを見やすくしただけなんだけどね。

予定の書き方は、表示したいヘッダ/フッタに、
    <%= till "20030409|(04/09 wed) コンタクト交換日"%>
ってなカンジで書き込むだけ。
これで、
  (04/09 wed) コンタクト交換日まで,あと 11
ってなカンジで表示される。


プラグイン todo
cf:
  DAMEX 2002/02/25

1.5.3 から、misc/todo/ 以下に標準装備された。

1.todo.rb を、pluginディレクトリにコピー。
2.todo.rb を index.rb と同じディレクトリにコピーして、
   実行属性を付ける。
3.todo.rhtml を、skelディレクトリにをコピー。
4.ヘッダーや,フッターの入れたい箇所に <%=todo%> を追加。
5.todo.rb へのアクセスの認証設定
  #   .htaccess の設定例)
  #   
  #      AuthName      tDiary
  #      AuthType      Basic
  #      AuthUserFile  /home/foo/.htpasswd
  #      Require user  foo
  # 
   は、しなかった。
   だって、ローカルの中でやっているから俺しかアクセスしないはずだし。
   ってか、この日記が他人に読まれている時点で、すでにヤバ杉。
6.バックアップしておいた todo, todo~(は、いらん鴨) を、
   ~/lib/tdiary/cache/ にコピー。
   アクセス権は、apache:apache
7.<%=category_form %>
   を、ヘッダ、フッタに入れる。
8.Todo 編修画面
   ブラウザで
      http://localhost/~jun1/tdiary/todo.rb 
   にアクセスすると、ToDo 編集画面になる。


プラグイン br.rb
cf:
  trial
  DAMEX 2003/02/23

Wiki Style で改行をする為のプラグイン。
  # br.rb $Revision: 1.1 $
  #
  # br:  insert br tag on Wiki Style
 
  def br( )
         %Q[<br>]
  end 
br.rb をプラグインディレクトリにコピーするだけ。

使いかたは、本文中で、{{br}} を入れるだけ。

プラグイン red.rb
赤くなーーれ
  def red(str)
     result = "<span class=\"attention\">#{str}</span>"
  end 
http://orange.sakura.ne.jp/~mpc/d/20030414.html#p03
http://localhost/~jun1/tdiary/?date=20030414#p01
http://localhost/~jun1/tdiary/?date=20030415#p01
http://localhost/~jun1/tdiary/?date=20030415#p02


プラグイン center.rb
センターにします。
red.rb を参考に作ってみた。

  # cf. red.rb
  #
  # center:  insert center tag on Wiki Style
  
  def center(str)
        %Q[
#{str}
] end
使いかた:
   Wiki Style
     {{ center '真中に置きたい文字' }}

   tDiary Style
     <%= center( 真中に置きたい文字 ) %> で、いいと思う


以下、古い内容。
   # cf. br.rb
   #
   # center:  insert center tag on Wiki Style

   def center( )
       %Q[<center>]
   end

その、終点。
cctenter.rb
   # cf. br.rb
   #
   # center:  insert center tag on Wiki Style

   def ccenter( )
        %Q[</center><p>]
   end 

使いかた:
   {{center}}
まんなかにおきたいもじ

   {{ccenter}}

プラグイン gazou.rb
image.rb を使いたかったけど、使えない。どーやっても使えない。使えなければ、自分で使えるものを作っちゃえ、ってコトで、作成。

   def gazou(str)
       %Q[<img src="./images/#{str}">]
   end 

使いかたは、

Wiki Style なら、
  {{ gazou 'hoge.gif' }}

tDiary Style なら、
  <%= gazou(hoge.gif) %>

表示したいイメージファイルは、~/public_html/images/ に入れておく。 images/ のパーミッションは、
  drwxrwxrwx   2 jun1  jun1  4096 Jun  1 17:08  images/ 

ホントは、イメージファイルは、~/lib/tdiary/ 以下に置きたいんだけど、ブラウザからアクセス出来る場所でないと表示できないから、やむを得ないまま使用。
プラグイン bigfont.rb
center.rb と、同じ動機。
Wiki Style では、HTML Tag が使えないので、フォントを大きくするプラグインを、自前で用意。
  # cf. center.rb
  #
  # big-font:  insert font size="+2" tag
  
  def bigfont(str)
       %Q[<font size=\"+2\">#{str}</font>]
  end
使いかた:

Wiki Style
   {{ bigfont 'でっかくしたい文字' }}

tDiary Style では、そのまま <font size="+2"> が使えるので、説明は省略。

プラグイン banner.rb
  # banner.rb  バナー画像をランダムに表示 
  #
  # from:
  # http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?banner%2Erb
  #
  def banner( key, w, h, url )
     ary = @options["banner.#{key}"]
     return '' unless ary

     %Q|<a href="#{url}"><img src="#{ary[rand( ary.size )]}" alt="#{key}" width="#{w}" height="#{h}" style="border: 0px"></a>|
  end 

表示したい画像をプラグインディレクトリに入れる。
「設定」から、ヘッダ、フッタを修正して、画像を出したい場所に、、、
しまった、やり方が判らん。
banner.rb を入れるの、ヤメ


プラグイン その他
うーーん、入れてもいいんだけど、入れるメリットと使いかたがいまいち判らんのよね。

tlink.rb ?
my-ex.rb

長年日記
「設定」から設定する。
「表示」に、するだけ。

プラグイン clear.rb zz_clear.rb
tDiary 1.5.4 にも入れた。
tDiary のページ から、clear.rb と、zz_clear.rb コピペで、ローカルに保存する。
直接ファイルを落とすコトは出来ない。ってか、作ってくれていない。

clear.rb を tdiary ディレクトリ(~/public_html/ )に保存して、parmition を、777 にする。

zz_clear.rb を plugin ディレクトリに保存。

「更新」から入ると、 「キャッシュクリア」ってボタンが出来ていて、これを押せば、 キャッシュ(~/lib/tdiary/cache/ 以下の *.parser と、latest.rb )がクリア(消去)される。

でも、バックアップの *.parser~ は、消してくれない
なので、念を押すトキには、これらのファイルを手動で消した方が良い鴨。

心残り
pluginviewer.rb と、長年日記が使えないコトと、a.rb の辞書登録画面が出ないコト。
でも、実用上、問題ないから、次のバージョンアップまでこのままで逝きましょう。
参考:

http://localhost/~jun1/tdiary/?date=20030209
http://localhost/~jun1/tdiary/?date=20030201#p04
http://localhost/~jun1/tdiary/?date=20030210#p01
















戻る