smbdです
On Thu, 01 Jul 2004 20:35:41 +0900
TADA Tadashi <sho@...> wrote:
> tdiary_style.rbにbody_to_htmlを実装し、適切に<p>で囲まれるようにしました。
> tDiaryスタイルは個人的にはもう使ってないので(^^;、これであってるかどうか
> 自信がないですが。
まだanoncvsに落ちてきていないようなので後ほどレポートしようと思います
> ># subtitle_to_html, stripped_subtitle_to_htmlも同様の問題をはらんでると思いますが…
>
> subtitle_to_htmlは、そのまま<title>で囲まれたりするので、<h3>で囲んだり
> するとまずいですね。現仕様のままにしましょう。
<title>で囲まれるというのはmakerss.rbにおいて、でしょうか?
それとも他のpluginでも、と言うことでしょうか
どちらにしても<title>で囲むような物をsubtitle_to_htmlメソッドで変換している方が間違っていて、
subtitleメソッドで変換するのが正しいように見えるのですが、いかがでしょうか?
またmakerss.rbについていくつか提案なのですが
まず1点目として、現状では日記の各セクションのサブタイトルが、RSSにおいて各エントリの<title>と
<content:encode>の冒頭になっていますが、<title>で囲むという配慮からかapply_pluginでタグを
取り除くようになっています。
これだとサブタイトルのみにリンクが張ってある場合(URLのclipとか)は実際に日記を見ないことには
リンクがわかりません。なので<title>の部分はそのままに、<content:encode>の冒頭のサブタイトルは
タグを取り除かないようにするのはどうでしょうか?
また2点目として
SharpReaderなどのRSS Aggregatorで他のblogのRSS等を見ると、
Subjectの所にカテゴリが設定されていて、区分がわかりやすくなっています
これをmakerss.rbが吐くRSSにも適用させるのはどうでしょうか?
2つをあわせたpatchは以下のようになるかと思います
Index: makerss.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/makerss.rb,v
retrieving revision 1.8
diff -u -r1.8 makerss.rb
--- makerss.rb 26 Jun 2004 04:40:17 -0000 1.8
+++ makerss.rb 1 Jul 2004 15:41:40 -0000
@@ -159,15 +159,23 @@
@options['apply_plugin'] = true
body_enter_proc( date )
subtitle = apply_plugin( rdfsec.section.subtitle_to_html, true ).strip
- desc = subtitle + apply_plugin( rdfsec.section.body_to_html ).strip
+ desc = apply_plugin( rdfsec.section.subtitle_to_html ).strip + apply_plugin( rdfsec.section.body_to_html ).strip
body_leave_proc( date )
@options['apply_plugin'] = old_apply_plugin
rdf << %Q|<title>#{subtitle}</title>\n|
rdf << %Q|<dc:creator>#{CGI::escapeHTML( @conf.author_name )}</dc:creator>\n|
+ if ! rdfsec.section.categories.empty?
+ rdfsec.section.categories.each { |category|
+ rdf << %Q|<dc:subject>#{CGI::escapeHTML( category )}</dc:subject>\n|
+ }
+ else
+ rdf << %Q|<dc:subject>#{@makerss_noncategory_subject}</dc:subject>\n|
+ end
rdf << %Q|<content:encoded><![CDATA[#{desc}]]></content:encoded>\n|
else # TSUKKOMI
rdf << %Q|<title>#{makerss_tsukkomi_label( rdfsec.id )} (#{CGI::escapeHTML( rdfsec.section.name )})</title>\n|
rdf << %Q|<dc:creator>#{CGI::escapeHTML( rdfsec.section.name )}</dc:creator>\n|
+ rdf << %Q|<dc:subject>#{@makerss_comment}</dc:subject>\n|
rdf << %Q|<content:encoded><![CDATA[#{CGI::escapeHTML( rdfsec.section.body ).gsub( /\n/, '<br>' )}]]></content:encoded>\n|
end
rdf << "</item>\n"
それでは
--
1024D/F6AC9AF9 2002-06-25 Mitsuru Shimamura (smbd) <mitsuru@...>
Fingerprint = B14F C51C FA61 3F7E 4D22 35DF 1384 2E7B F6AC 9AF9
http://smbd.jp/
|