# genre.rb 2003-12-02 (Tue) 22:54:01 Asano # # ジャンル別タイトル一覧を生成するけどジャンルは

で囲んで # トピックのマークを消して全文リンクにするフィルタ。 # おもっくそ自分用なんでその。 # # HTML が分かってればふつーにカスタマイズ出来ます。 =begin usage: *.diary 上でのタイトルの書き方は、 ■リコールしま専科[GPED|GIJK] 生成される *.html は、

リコールしま専科

[ Genre : Everyday | Junk ]

見た目は、 リコールしま専科 <-- 全文リンクになる。 [ Genre : Everyday | Junk ] <-- ジャンル名が、各ジャンル別タイトル一覧ページへのリンクになる。 -------------------------------------------------------------------------------------------------- ndiary.conf 内での設定が必要なとこ。 # トピックを全文リンクにする(TOPIC_SENTENCE_LINK) # 記号のみリンク:false / 全文リンク:true TOPIC_SENTENCE_LINK = false # フィルタ FILTER = 'genre' # トピックに使うタグ TAG_TOPIC_LATEST = 'h3' TAG_TOPIC_PASTDAYS = 'h3' # トピック一覧の設定 TOPIC = genre_01_01.html (\s?\[.*?AnimeComic.*?\]) ■|(\s?\[(.*?)\]) TOPIC = genre_01_02.html (\s?\[.*?Junk.*?\]) ■|(\s?\[(.*?)\]) TOPIC = genre_04_03.html (\s?\[.*?Everyday.*?\]) ■|(\s?\[(.*?)\]) 以下こんな感じで、フィルタ内の記述に合わせてずらずらと設定しとく。 ちなみに「トピック一覧の設定」のスペースが空いてるとこは、 半角スペースでも全角スペースでも無く、タブ。 =end class Filter H3TOPIC = Regexp::compile(/

■<\/a>(.+?)

(.+?)<\/p><\/h3>/) def genre(str, type) case type when :TOPIC str.gsub!(/\[/, '

[ Genre : ]

') str.gsub!(/\|/, ' | AnimeComic') str.gsub!(/GIJK/, 'genre_01_02.html" title="ジャンル別タイトル一覧 - お遊び画像、下書き晒し等">Junk') str.gsub!(/GIVI/, 'genre_01_03.html" title="ジャンル別タイトル一覧 - その他諸々絵、映像関連">VariousImage') str.gsub!(/GMAT/, 'genre_02_01.html" title="ジャンル別タイトル一覧 - 音楽関連アーティスト">MusicArtist') str.gsub!(/GMNT/, 'genre_02_02.html" title="ジャンル別タイトル一覧 - Ninja Tune 関連">NinjaTune') str.gsub!(/GMOL/, 'genre_02_03.html" title="ジャンル別タイトル一覧 - オンラインラジオ・オンラインレコード店関連">On-lineMusic') str.gsub!(/GMVM/, 'genre_02_04.html" title="ジャンル別タイトル一覧 - その他諸々音楽関連">VariousMusic') str.gsub!(/GCND/, 'genre_03_01.html" title="ジャンル別タイトル一覧 - nDiary 関連">nDiary') str.gsub!(/GCXY/, 'genre_03_02.html" title="ジャンル別タイトル一覧 - xyzzy 関連">xyzzy') str.gsub!(/GC3D/, 'genre_03_03.html" title="ジャンル別タイトル一覧 - SOFTIMAGE|XSI EXP 関連">3D|XSI') str.gsub!(/GCMP/, 'genre_03_04.html" title="ジャンル別タイトル一覧 - MP3 関連">MP3') str.gsub!(/GCSW/, 'genre_03_05.html" title="ジャンル別タイトル一覧 - Web 制作関連">SiteWorks') str.gsub!(/GPMS/, 'genre_04_02.html" title="ジャンル別タイトル一覧 - 自サイト情報・自サイト制作記">MySite') str.gsub!(/GPRP/, 'genre_04_01.html" title="ジャンル別タイトル一覧 - お店、その他個人的なレポート">Report') str.gsub!(/GPED/, 'genre_04_03.html" title="ジャンル別タイトル一覧 - 自分の日常、独り言">Everyday') when :AFTER_TOPIC str.gsub!(H3TOPIC){ link = $1 title = $2 gname = $3 t = "

#{title}

\n" # t = "

#{title} " t << "

#{gname}

" # t << "#{gname}

\n" } end end end