tdiary-contrib 3.2.2.20130518
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +35 -0
- data/README.en.md +12 -0
- data/README.md +13 -0
- data/Rakefile +41 -0
- data/doc/en/filter/spambayes.txt +3 -0
- data/doc/en/plugin.txt +1 -0
- data/doc/en/style/hatena.txt +10 -0
- data/doc/en/style/markdown.txt +16 -0
- data/doc/en/util.txt +1 -0
- data/doc/ja/filter/antirefspam.history.txt +59 -0
- data/doc/ja/filter/antirefspam.txt +86 -0
- data/doc/ja/filter/comment_key.ja.html +182 -0
- data/doc/ja/filter/spambayes.txt +3 -0
- data/doc/ja/plugin/add_bookmark.txt +50 -0
- data/doc/ja/plugin/category_to_tag.txt +21 -0
- data/doc/ja/plugin/cocoment.txt +31 -0
- data/doc/ja/plugin/google_adsense.txt +25 -0
- data/doc/ja/plugin/google_analytics.txt +7 -0
- data/doc/ja/plugin/image_detail.txt +69 -0
- data/doc/ja/plugin/image_gps.txt +36 -0
- data/doc/ja/plugin/image_gps2.txt +41 -0
- data/doc/ja/plugin/livedoor_weather.txt +105 -0
- data/doc/ja/plugin/opensearch_ad.txt +16 -0
- data/doc/ja/plugin/section_footer.txt +84 -0
- data/doc/ja/plugin/select_theme.txt +1 -0
- data/doc/ja/plugin.txt +13 -0
- data/doc/ja/style/hatena.txt +10 -0
- data/doc/ja/style/markdown.txt +13 -0
- data/doc/ja/util.txt +12 -0
- data/filter/antirefspam.rb +263 -0
- data/filter/commentkey.rb +29 -0
- data/filter/commentsize.rb +18 -0
- data/filter/hidecomment.rb +13 -0
- data/filter/iplookup.rb +55 -0
- data/filter/plugin/antirefspam.rb +59 -0
- data/filter/plugin/commentkey.rb +58 -0
- data/filter/plugin/commentsize.rb +12 -0
- data/filter/plugin/en/iplookup.rb +9 -0
- data/filter/plugin/en/spambayes.rb +123 -0
- data/filter/plugin/iplookup.rb +39 -0
- data/filter/plugin/ja/antirefspam.rb +91 -0
- data/filter/plugin/ja/commentkey.rb +17 -0
- data/filter/plugin/ja/commentsize.rb +6 -0
- data/filter/plugin/ja/iplookup.rb +9 -0
- data/filter/plugin/ja/spambayes.rb +124 -0
- data/filter/plugin/spambayes.rb +501 -0
- data/filter/plugin/zh/iplookup.rb +9 -0
- data/filter/rblcheck.rb +36 -0
- data/filter/spambayes.rb +535 -0
- data/filter/spamlookup.rb +37 -0
- data/io/dbi_io/ChangeLog +19 -0
- data/io/dbi_io/README.ja +39 -0
- data/io/dbi_io/dbi_io.rb +181 -0
- data/io/dbi_io/plugin/refererDbiIO.rb +76 -0
- data/io/dbi_io/tdiary_table.sql +42 -0
- data/js/appstore.js +109 -0
- data/js/datepicker.js +69 -0
- data/js/editor.js +82 -0
- data/js/flickr.js +157 -0
- data/js/image_ex.js +79 -0
- data/js/jquery.socialbutton.js +842 -0
- data/js/nicovideo.js +17 -0
- data/js/picasa.js +322 -0
- data/js/plugin_checker.js +71 -0
- data/js/prettify/lang-apollo.js +2 -0
- data/js/prettify/lang-clj.js +18 -0
- data/js/prettify/lang-css.js +2 -0
- data/js/prettify/lang-go.js +1 -0
- data/js/prettify/lang-hs.js +2 -0
- data/js/prettify/lang-lisp.js +3 -0
- data/js/prettify/lang-lua.js +2 -0
- data/js/prettify/lang-ml.js +2 -0
- data/js/prettify/lang-n.js +4 -0
- data/js/prettify/lang-proto.js +1 -0
- data/js/prettify/lang-scala.js +2 -0
- data/js/prettify/lang-sql.js +2 -0
- data/js/prettify/lang-tex.js +1 -0
- data/js/prettify/lang-vb.js +2 -0
- data/js/prettify/lang-vhdl.js +3 -0
- data/js/prettify/lang-wiki.js +2 -0
- data/js/prettify/lang-xq.js +3 -0
- data/js/prettify/lang-yaml.js +2 -0
- data/js/prettify/prettify.css +1 -0
- data/js/prettify/prettify.js +28 -0
- data/js/referer.js +17 -0
- data/js/show_and_hide.js +39 -0
- data/js/socialbutton.js +126 -0
- data/js/twitter_anywhere.js +28 -0
- data/js/yahoo_kousei.js +21 -0
- data/lib/bayes/convert.rb +34 -0
- data/lib/bayes.rb +232 -0
- data/lib/exifparser/BUGS +1 -0
- data/lib/exifparser/ChangeLog +169 -0
- data/lib/exifparser/README +15 -0
- data/lib/exifparser/install.rb +1015 -0
- data/lib/exifparser/lib/exifparser/makernote/canon.rb +502 -0
- data/lib/exifparser/lib/exifparser/makernote/fujifilm.rb +415 -0
- data/lib/exifparser/lib/exifparser/makernote/minolta.rb +84 -0
- data/lib/exifparser/lib/exifparser/makernote/mk_nikonflensname.rb +39 -0
- data/lib/exifparser/lib/exifparser/makernote/nikon.rb +267 -0
- data/lib/exifparser/lib/exifparser/makernote/nikon2.rb +581 -0
- data/lib/exifparser/lib/exifparser/makernote/nikonflensname.rb +438 -0
- data/lib/exifparser/lib/exifparser/makernote/olympus.rb +225 -0
- data/lib/exifparser/lib/exifparser/makernote/prove.rb +84 -0
- data/lib/exifparser/lib/exifparser/makernote/sigma.rb +237 -0
- data/lib/exifparser/lib/exifparser/pre-setup.rb +1 -0
- data/lib/exifparser/lib/exifparser/scan.rb +278 -0
- data/lib/exifparser/lib/exifparser/tag.rb +2298 -0
- data/lib/exifparser/lib/exifparser/thumbnail.rb +76 -0
- data/lib/exifparser/lib/exifparser/utils.rb +88 -0
- data/lib/exifparser/lib/exifparser.rb +265 -0
- data/lib/exifparser/sample/exifview.rb +279 -0
- data/lib/tdiary-contrib.rb +19 -0
- data/lib/wgs2tky.rb +93 -0
- data/misc/section_footer2/buzzurl.yaml +6 -0
- data/misc/section_footer2/fc2.yaml +6 -0
- data/misc/section_footer2/ldc.yaml +6 -0
- data/misc/section_footer2/retweet.yaml +7 -0
- data/misc/section_footer2/twitter.yaml +7 -0
- data/misc/section_footer2/yahoo.yaml +6 -0
- data/misc/tdiarygraph/tdiarygraph120x90e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph125x125e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph240x180e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph468x60e.swf +0 -0
- data/misc/tdiarygraph/tdiarygraph728x90e.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125r.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125r7.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x125s.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes125x30.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes234x30.swf +0 -0
- data/misc/tdiarytimes/tdiarytimes468x30.swf +0 -0
- data/plugin/add_bookmark.rb +89 -0
- data/plugin/apple_webclip.rb +26 -0
- data/plugin/appstore.rb +47 -0
- data/plugin/bigpresen.rb +86 -0
- data/plugin/bitly.rb +39 -0
- data/plugin/bootstrap-navi.rb +54 -0
- data/plugin/canonical.rb +9 -0
- data/plugin/category_similar.rb +73 -0
- data/plugin/category_to_tag.rb +60 -0
- data/plugin/category_to_tagcloud.rb +172 -0
- data/plugin/cocomment.rb +37 -0
- data/plugin/code-prettify.rb +23 -0
- data/plugin/coderwall.rb +34 -0
- data/plugin/datepicker.rb +28 -0
- data/plugin/day2section.rb +20 -0
- data/plugin/del_footer.rb +111 -0
- data/plugin/description_from_body.rb +23 -0
- data/plugin/development.rb +16 -0
- data/plugin/editor.rb +11 -0
- data/plugin/en/add_bookmark.rb +20 -0
- data/plugin/en/del_footer.rb +10 -0
- data/plugin/en/git-register.rb +3 -0
- data/plugin/en/livedoor_weather.rb +25 -0
- data/plugin/en/microsummary.rb +18 -0
- data/plugin/en/nicovideo.rb +38 -0
- data/plugin/en/openid.rb +8 -0
- data/plugin/en/section_footer.rb +6 -0
- data/plugin/en/section_footer2.rb +3 -0
- data/plugin/en/socialbutton.rb +5 -0
- data/plugin/everytrail.rb +39 -0
- data/plugin/facebook_comments.rb +59 -0
- data/plugin/flickr.rb +209 -0
- data/plugin/gist.rb +16 -0
- data/plugin/git-register.rb +240 -0
- data/plugin/github_badge.rb +27 -0
- data/plugin/github_link.rb +9 -0
- data/plugin/goo_gl.rb +42 -0
- data/plugin/google_adsense.rb +132 -0
- data/plugin/google_analytics.rb +39 -0
- data/plugin/google_map.rb +168 -0
- data/plugin/google_sitemaps.rb +60 -0
- data/plugin/google_webmaster.rb +22 -0
- data/plugin/hatena_bookmark_nocomment.rb +9 -0
- data/plugin/hatena_star.rb +66 -0
- data/plugin/hb_footer.rb +255 -0
- data/plugin/hb_footer4sec.rb +244 -0
- data/plugin/hb_footer4sec_js.rb +30 -0
- data/plugin/hide_comment_form.rb +4 -0
- data/plugin/hide_sidebar_iphone.rb +21 -0
- data/plugin/iddy.rb +81 -0
- data/plugin/image_detail.rb +143 -0
- data/plugin/image_ex.rb +462 -0
- data/plugin/image_gps.rb +128 -0
- data/plugin/inline_wiki.rb +6 -0
- data/plugin/instagr.rb +64 -0
- data/plugin/ja/add_bookmark.rb +20 -0
- data/plugin/ja/del_footer.rb +10 -0
- data/plugin/ja/flickr.rb +62 -0
- data/plugin/ja/git-register.rb +3 -0
- data/plugin/ja/google_sitemaps.rb +35 -0
- data/plugin/ja/livedoor_weather.rb +25 -0
- data/plugin/ja/microsummary.rb +18 -0
- data/plugin/ja/nicovideo.rb +41 -0
- data/plugin/ja/openid.rb +7 -0
- data/plugin/ja/section_footer.rb +6 -0
- data/plugin/ja/section_footer2.rb +4 -0
- data/plugin/ja/socialbutton.rb +6 -0
- data/plugin/jdate.rb +20 -0
- data/plugin/jholiday.rb +16 -0
- data/plugin/jmonth.rb +20 -0
- data/plugin/jquery_ui_theme.rb +55 -0
- data/plugin/jroku.rb +28 -0
- data/plugin/jyear.rb +37 -0
- data/plugin/latlonglab_route.rb +25 -0
- data/plugin/lazy_referer.rb +38 -0
- data/plugin/livedoor_weather.rb +180 -0
- data/plugin/make_link.rb +44 -0
- data/plugin/makerss_category.rb +43 -0
- data/plugin/makerss_comment.rb +35 -0
- data/plugin/microsummary.rb +62 -0
- data/plugin/mm_footer.rb +215 -0
- data/plugin/monthly_autopagerize.rb +67 -0
- data/plugin/my_hotentry.rb +132 -0
- data/plugin/navi_day.rb +118 -0
- data/plugin/navi_this_month.rb +15 -0
- data/plugin/nicovideo.rb +115 -0
- data/plugin/notify_miniblog.rb +134 -0
- data/plugin/ogp.rb +55 -0
- data/plugin/ohmsha_estore.rb +71 -0
- data/plugin/openid.rb +90 -0
- data/plugin/opensearch_ad.rb +33 -0
- data/plugin/picasa.rb +56 -0
- data/plugin/plugin_checker.rb +41 -0
- data/plugin/popit.rb +22 -0
- data/plugin/prettify.rb +19 -0
- data/plugin/prezi.rb +10 -0
- data/plugin/profile.rb +222 -0
- data/plugin/puboo.rb +93 -0
- data/plugin/pygments_css.rb +76 -0
- data/plugin/rating.rb +419 -0
- data/plugin/recent_estraier.rb +50 -0
- data/plugin/recent_tweet.rb +71 -0
- data/plugin/retweet.rb +86 -0
- data/plugin/rubykaigi.rb +99 -0
- data/plugin/search-bing.rb +87 -0
- data/plugin/search-default.rb +264 -0
- data/plugin/search-google-custom.rb +60 -0
- data/plugin/search-yahoo-websearch.rb +121 -0
- data/plugin/search-yahoo.rb +109 -0
- data/plugin/section_footer.rb +195 -0
- data/plugin/section_footer2.rb +278 -0
- data/plugin/section_permalink.rb +73 -0
- data/plugin/section_permalink_anchor.rb +39 -0
- data/plugin/select_style.rb +42 -0
- data/plugin/select_theme.rb +90 -0
- data/plugin/show_and_hide.rb +77 -0
- data/plugin/slideshare.rb +10 -0
- data/plugin/socialbutton.rb +60 -0
- data/plugin/tatsu_zine.rb +93 -0
- data/plugin/tdiarygraph_flashstyle.rb +296 -0
- data/plugin/tdiarytimes.rb +166 -0
- data/plugin/tdiarytimes2.rb +406 -0
- data/plugin/tdiarytimes_flashstyle.rb +263 -0
- data/plugin/tdiarytimes_textstyle.rb +290 -0
- data/plugin/title_anchor.rb +16 -0
- data/plugin/tweet_quote.rb +106 -0
- data/plugin/twitpic.rb +10 -0
- data/plugin/twitter.rb +46 -0
- data/plugin/twitter_anywhere.rb +209 -0
- data/plugin/twitter_badge.rb +42 -0
- data/plugin/twitter_js.rb +59 -0
- data/plugin/ustream.rb +19 -0
- data/plugin/vimeo.rb +14 -0
- data/plugin/volatile.rb +89 -0
- data/plugin/vote.rb +100 -0
- data/plugin/wikiloc.rb +27 -0
- data/plugin/windex.rb +512 -0
- data/plugin/yahoo_kousei.rb +79 -0
- data/plugin/yahoo_map.rb +97 -0
- data/plugin/youtube.rb +33 -0
- data/plugin/yshop.rb +189 -0
- data/plugin/zenback.rb +46 -0
- data/spec/apple_webclip_spec.rb +46 -0
- data/spec/fixtures/friendfeed.xml +2 -0
- data/spec/fixtures/github.json +1 -0
- data/spec/fixtures/twitter.xml +73 -0
- data/spec/gist_spec.rb +16 -0
- data/spec/github_link_spec.rb +39 -0
- data/spec/google_analytics_spec.rb +60 -0
- data/spec/jdate_spec.rb +23 -0
- data/spec/jmonth_spec.rb +28 -0
- data/spec/jyear_spec.rb +21 -0
- data/spec/my_hotentry_spec.rb +78 -0
- data/spec/openid_spec.rb +246 -0
- data/spec/opensearch_ad_spec.rb +50 -0
- data/spec/profile_spec.rb +88 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec_helper.rb +223 -0
- data/spec/title_anchor_spec.rb +39 -0
- data/spec/twitter_js_spec.rb +116 -0
- data/spec/youtube_spec.rb +20 -0
- data/style/hatena_style.rb +1011 -0
- data/style/markdown_style.rb +239 -0
- data/style/wikiext_style.rb +21 -0
- data/tdiary-contrib.gemspec +25 -0
- data/util/clean-spam/README.ja +1 -0
- data/util/clean-spam/tdiary-comment-clean +46 -0
- data/util/clean-spam/tdiary-comment-clean2 +81 -0
- data/util/clean-spam/tdiary-referer-clean +46 -0
- data/util/convert_pstore.rb +82 -0
- data/util/estraier-search/ChangeLog +36 -0
- data/util/estraier-search/README.ja +114 -0
- data/util/estraier-search/en/estraier-register.rb +3 -0
- data/util/estraier-search/estraier-register.rb +298 -0
- data/util/estraier-search/estraier-search.rb +273 -0
- data/util/estraier-search/estraier.rhtml +73 -0
- data/util/estraier-search/estraier.rxml +23 -0
- data/util/estraier-search/i.estraier.rhtml +31 -0
- data/util/estraier-search/ja/estraier-register.rb +3 -0
- data/util/image-gallery/README.ja +27 -0
- data/util/image-gallery/image-gallery.rb +523 -0
- data/util/image-gallery/image-gallery.rb.euc-jp +523 -0
- data/util/image-gallery/js/SmoothGallery/Changelog +52 -0
- data/util/image-gallery/js/SmoothGallery/css/ReMooz.css +186 -0
- data/util/image-gallery/js/SmoothGallery/css/img/carrow1.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/carrow2.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/closebox.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/closebox.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche1.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche1.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche2.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/fleche2.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/loading-bar-black.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/open.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/open.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_e.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_n.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_ne.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_nw.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_s.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_se.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_sw.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/remo_bg_w.png +0 -0
- data/util/image-gallery/js/SmoothGallery/css/img/spinner.gif +0 -0
- data/util/image-gallery/js/SmoothGallery/css/jd.gallery.css +371 -0
- data/util/image-gallery/js/SmoothGallery/css/layout.css +91 -0
- data/util/image-gallery/js/SmoothGallery/license.txt +621 -0
- data/util/image-gallery/js/SmoothGallery/resizer.php +113 -0
- data/util/image-gallery/js/SmoothGallery/scripts/Changelog +52 -0
- data/util/image-gallery/js/SmoothGallery/scripts/History.Routing.js +126 -0
- data/util/image-gallery/js/SmoothGallery/scripts/History.js +109 -0
- data/util/image-gallery/js/SmoothGallery/scripts/ReMooz.js +364 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.js +843 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.set.js +183 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jd.gallery.transitions.js +90 -0
- data/util/image-gallery/js/SmoothGallery/scripts/jdgalleryresize.js +828 -0
- data/util/image-gallery/js/SmoothGallery/scripts/license.txt +621 -0
- data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2-more.js +103 -0
- data/util/image-gallery/js/SmoothGallery/scripts/mootools-1.2.1-core-yc.js +349 -0
- data/util/image-gallery/js/SmoothGallery/scripts/resizer.php +113 -0
- data/util/image-gallery/misc/plugin/recent_image.rb +406 -0
- data/util/image-gallery/skel/gallery.rhtml +154 -0
- data/util/image-gallery/skel/gallery.rhtml.euc-jp +154 -0
- data/util/image-gallery/tdiary.conf.igsample +8 -0
- data/util/image-gallery/theme/image-gallery.css +85 -0
- data/util/image2flickr.rb +282 -0
- data/util/posttdiary/README.ja +12 -0
- data/util/posttdiary/posttdiary-ex.rb +1155 -0
- data/util/posttdiary/posttdiary.rb +245 -0
- data/util/rast-search/ChangeLog +55 -0
- data/util/rast-search/README.ja +99 -0
- data/util/rast-search/en/rast-register.rb +3 -0
- data/util/rast-search/i.rast.rhtml +33 -0
- data/util/rast-search/ja/rast-register.rb +3 -0
- data/util/rast-search/rast-register.rb +326 -0
- data/util/rast-search/rast-search.rb +249 -0
- data/util/rast-search/rast.rhtml +66 -0
- data/util/rast-search/rast.rxml +21 -0
- data/util/section_link/README +11 -0
- data/util/section_link/misc/plugin/section_link.rb +68 -0
- data/util/section_link/misc/plugin/section_link_anchor.rb +38 -0
- data/util/section_link/tdiary/tdiary_day_ext.rb +21 -0
- data/util/section_link/tdiary/tdiaryext_style.rb +36 -0
- data/util/section_link/tdiary/wikiext_style.rb +36 -0
- data/util/tdiary-for-ruby1.9/compatible.rb +97 -0
- data/util/tdiary-for-ruby1.9/tdiary-2.2.0.patch +98 -0
- data/util/tdiary-for-ruby1.9/tdiary-2.3.1.patch +212 -0
- data/util/tdiary-grep/README +4 -0
- data/util/tdiary-grep/grep.rb +445 -0
- data/util/tdiary-mode/http.el +130 -0
- data/util/tdiary-mode/tdiary-mode.el +613 -0
- data/util/tdiary-vim/ChangeLog +25 -0
- data/util/tdiary-vim/README +60 -0
- data/util/tdiary-vim/tdiary.vim +350 -0
- data/util/tdiarysearch/README.en +53 -0
- data/util/tdiarysearch/README.ja +99 -0
- data/util/tdiarysearch/search.rb +504 -0
- metadata +497 -0
@@ -0,0 +1,239 @@
|
|
1
|
+
#
|
2
|
+
# markdown_style.rb: Markdown style for tDiary 2.x format. $Revision: 1.10 $
|
3
|
+
#
|
4
|
+
# if you want to use this style, add @style into tdiary.conf below:
|
5
|
+
#
|
6
|
+
# @style = 'Markdown'
|
7
|
+
#
|
8
|
+
# Copyright (C) 2003, TADA Tadashi <sho@spc.gr.jp>
|
9
|
+
# Copyright (C) 2004, MoonWolf <moonwolf@moonwolf.com>
|
10
|
+
# You can distribute this under GPL.
|
11
|
+
#
|
12
|
+
require 'bluecloth'
|
13
|
+
|
14
|
+
module TDiary
|
15
|
+
class MarkdownSection
|
16
|
+
attr_reader :subtitle, :author
|
17
|
+
attr_reader :categories, :stripped_subtitle
|
18
|
+
attr_reader :subtitle_to_html, :stripped_subtitle_to_html, :body_to_html
|
19
|
+
|
20
|
+
def initialize( fragment, author = nil )
|
21
|
+
@author = author
|
22
|
+
@subtitle, @body = fragment.split( /\n/, 2 )
|
23
|
+
@subtitle.sub!(/^\#\s*/,'')
|
24
|
+
@body ||= ''
|
25
|
+
|
26
|
+
@categories = get_categories
|
27
|
+
@stripped_subtitle = strip_subtitle
|
28
|
+
|
29
|
+
@subtitle_to_html = @subtitle ? to_html('# ' + @subtitle).gsub(/\A<h\d>|<\/h\d>\z/io, '') : nil
|
30
|
+
@stripped_subtitle_to_html = @stripped_subtitle ? to_html('# ' + @stripped_subtitle).gsub(/\A<h\d>|<\/h\d>\z/io, '') : nil
|
31
|
+
@body_to_html = to_html(@body)
|
32
|
+
end
|
33
|
+
|
34
|
+
def subtitle=(subtitle)
|
35
|
+
@categories = categories
|
36
|
+
cat_str = ""
|
37
|
+
categories.each {|cat|
|
38
|
+
cat_str << "[#{cat}]"
|
39
|
+
}
|
40
|
+
@subtitle = (subtitle || '').sub(/^# /,"\##{cat_str} ")
|
41
|
+
@strip_subtitle = strip_subtitle
|
42
|
+
end
|
43
|
+
|
44
|
+
def body
|
45
|
+
@body.dup
|
46
|
+
end
|
47
|
+
|
48
|
+
def body=(str)
|
49
|
+
@body = str
|
50
|
+
end
|
51
|
+
|
52
|
+
def categories=(categories)
|
53
|
+
@categories = categories
|
54
|
+
cat_str = ""
|
55
|
+
categories.each {|cat|
|
56
|
+
cat_str << "[#{cat}]"
|
57
|
+
}
|
58
|
+
@subtitle = "#{cat_str} " + (strip_subtitle || '')
|
59
|
+
@strip_subtitle = strip_subtitle
|
60
|
+
end
|
61
|
+
|
62
|
+
def to_src
|
63
|
+
r = ''
|
64
|
+
r << "\##{@subtitle}\n" if @subtitle
|
65
|
+
r << @body
|
66
|
+
end
|
67
|
+
|
68
|
+
def html4( date, idx, opt )
|
69
|
+
r = %Q[<div class="section">\n]
|
70
|
+
r << do_html4( date, idx, opt )
|
71
|
+
r << "</div>\n"
|
72
|
+
end
|
73
|
+
|
74
|
+
def do_html4( date, idx, opt )
|
75
|
+
r = ''
|
76
|
+
subtitle = to_html('# ' + @subtitle)
|
77
|
+
subtitle = subtitle.sub(/(\[([^\[]+?)\])+/) {
|
78
|
+
$&.gsub(/\[(.*?)\]/) {
|
79
|
+
$1.split(/,/).collect {|c|
|
80
|
+
%Q|<%= category_anchor("#{c}") %>|
|
81
|
+
}.join
|
82
|
+
}
|
83
|
+
}
|
84
|
+
subtitle.sub!(/<h3>/,%Q[<h3><a href="#{opt['index']}<%=anchor "#{date.strftime( '%Y%m%d' )}#p#{'%02d' % idx}" %>">#{opt['section_anchor']}</a> ])
|
85
|
+
if opt['anchor'] then
|
86
|
+
subtitle.sub!(/<h3><a /,%Q[<h3><a name="p#{'%02d' % idx}" ])
|
87
|
+
end
|
88
|
+
if opt['multi_user'] and @author then
|
89
|
+
subtitle.sub!(/<\/h3>/,%Q|[#{@author}]</h3>|)
|
90
|
+
end
|
91
|
+
r << subtitle
|
92
|
+
r << @body_to_html
|
93
|
+
r
|
94
|
+
end
|
95
|
+
|
96
|
+
def chtml( date, idx, opt )
|
97
|
+
r = ''
|
98
|
+
r << to_html(@subtitle)
|
99
|
+
r << @body_to_html
|
100
|
+
r
|
101
|
+
end
|
102
|
+
|
103
|
+
def to_s
|
104
|
+
to_src
|
105
|
+
end
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
def to_html(string)
|
110
|
+
r = BlueCloth.new( string ).to_html
|
111
|
+
r.gsub!(/<h(\d)/) { "<h#{$1.to_i + 2}" }
|
112
|
+
r.gsub!(/<\/h(\d)/) { "</h#{$1.to_i + 2}" }
|
113
|
+
r.gsub!(/\{\{(.+?)\}\}/) {
|
114
|
+
"<%=#{$1}%>"
|
115
|
+
}
|
116
|
+
r
|
117
|
+
end
|
118
|
+
|
119
|
+
def get_categories
|
120
|
+
return [] unless @subtitle
|
121
|
+
cat = /(\\?\[([^\[]+?)\\?\])+/.match(@subtitle).to_a[0]
|
122
|
+
return [] unless cat
|
123
|
+
cat.scan(/\\?\[(.*?)\\?\]/).collect do |c|
|
124
|
+
c[0].split(/,/)
|
125
|
+
end.flatten
|
126
|
+
end
|
127
|
+
|
128
|
+
def strip_subtitle
|
129
|
+
return nil unless @subtitle
|
130
|
+
r = @subtitle.sub(/^((\\?\[[^\[]+?\]\\?)+\s+)?/, '')
|
131
|
+
if r.empty?
|
132
|
+
nil
|
133
|
+
else
|
134
|
+
r
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
class MarkdownDiary
|
140
|
+
include DiaryBase
|
141
|
+
include CategorizableDiary
|
142
|
+
|
143
|
+
def initialize( date, title, body, modified = Time::now )
|
144
|
+
init_diary
|
145
|
+
replace( date, title, body )
|
146
|
+
@last_modified = modified
|
147
|
+
end
|
148
|
+
|
149
|
+
def style
|
150
|
+
'Markdown'
|
151
|
+
end
|
152
|
+
|
153
|
+
def replace( date, title, body )
|
154
|
+
set_date( date )
|
155
|
+
set_title( title )
|
156
|
+
@sections = []
|
157
|
+
append( body )
|
158
|
+
end
|
159
|
+
|
160
|
+
def append( body, author = nil )
|
161
|
+
section = nil
|
162
|
+
body.each_line do |l|
|
163
|
+
case l
|
164
|
+
when /^\#[^\#]/
|
165
|
+
@sections << MarkdownSection::new( section, author ) if section
|
166
|
+
section = l
|
167
|
+
else
|
168
|
+
section = '' unless section
|
169
|
+
section << l
|
170
|
+
end
|
171
|
+
end
|
172
|
+
if section
|
173
|
+
section << "\n" unless section=~/\n\n\z/
|
174
|
+
@sections << MarkdownSection::new( section, author )
|
175
|
+
end
|
176
|
+
@last_modified = Time::now
|
177
|
+
self
|
178
|
+
end
|
179
|
+
|
180
|
+
def each_section
|
181
|
+
@sections.each do |section|
|
182
|
+
yield section
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def add_section(subtitle, body)
|
187
|
+
sec = MarkdownSection::new("\n")
|
188
|
+
sec.subtitle = subtitle
|
189
|
+
sec.body = body
|
190
|
+
@sections << sec
|
191
|
+
@sections.size
|
192
|
+
end
|
193
|
+
|
194
|
+
def delete_section(index)
|
195
|
+
@sections.delete_at(index - 1)
|
196
|
+
end
|
197
|
+
|
198
|
+
def to_src
|
199
|
+
r = ''
|
200
|
+
each_section do |section|
|
201
|
+
r << section.to_src
|
202
|
+
end
|
203
|
+
r
|
204
|
+
end
|
205
|
+
|
206
|
+
def to_html( opt, mode = :HTML )
|
207
|
+
case mode
|
208
|
+
when :CHTML
|
209
|
+
to_chtml( opt )
|
210
|
+
else
|
211
|
+
to_html4( opt )
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
def to_html4( opt )
|
216
|
+
r = ''
|
217
|
+
idx = 1
|
218
|
+
each_section do |section|
|
219
|
+
r << section.html4( date, idx, opt )
|
220
|
+
idx += 1
|
221
|
+
end
|
222
|
+
r
|
223
|
+
end
|
224
|
+
|
225
|
+
def to_chtml( opt )
|
226
|
+
r = ''
|
227
|
+
idx = 1
|
228
|
+
each_section do |section|
|
229
|
+
r << section.chtml( date, idx, opt )
|
230
|
+
idx += 1
|
231
|
+
end
|
232
|
+
r
|
233
|
+
end
|
234
|
+
|
235
|
+
def to_s
|
236
|
+
"date=#{date.strftime('%Y%m%d')}, title=#{title}, body=[#{@sections.join('][')}]"
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# wikiext_style.rb: when using wiki style, extends behavior.
|
2
|
+
#
|
3
|
+
# Just place this file into tdiary/style directory.
|
4
|
+
#
|
5
|
+
# Copyright (C) 2012, kdmsnr <kdmsnr@gmail.com>
|
6
|
+
# You can distribute this under GPL.
|
7
|
+
#
|
8
|
+
|
9
|
+
module TDiary
|
10
|
+
class WikiextDiary # dummy class
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
require "hikidoc"
|
15
|
+
class HikiDoc
|
16
|
+
class HTMLOutput
|
17
|
+
def paragraph(lines)
|
18
|
+
@f.puts "<p>#{lines.join("")}</p>"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tdiary/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tdiary-contrib"
|
8
|
+
spec.version = TDiary::VERSION
|
9
|
+
spec.authors = ["tDiary contributors"]
|
10
|
+
spec.email = ["support@tdiary.org"]
|
11
|
+
spec.summary = %q{tDiary contributions package}
|
12
|
+
spec.description = %q{tDiary contributions package that includes plugins, styles, utilities, libraries, filters, and extended io.}
|
13
|
+
spec.homepage = "http://www.tdiary.org/"
|
14
|
+
spec.license = "GPL-2 and/or others"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'tdiary', ">= #{TDiary::VERSION}"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
See http://www.namazu.org/~satoru/diary/20040923.html#p01
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (C) 2004 Satoru Takabayashi <satoru@namazu.org>
|
4
|
+
# You can redistribute it and/or modify it under GPL2.
|
5
|
+
#
|
6
|
+
puts "Usage: tdiary-comment-clean PATTERN FILE..." if ARGV.length == 0
|
7
|
+
pattern = Regexp.new(ARGV.shift)
|
8
|
+
file_names = ARGV
|
9
|
+
|
10
|
+
deleted_comments = []
|
11
|
+
file_names.each {|file_name|
|
12
|
+
i = File.open(file_name)
|
13
|
+
first_line = i.gets
|
14
|
+
|
15
|
+
comments = []
|
16
|
+
comment = ""
|
17
|
+
while line = i.gets
|
18
|
+
if line == ".\n"
|
19
|
+
comments.push(comment)
|
20
|
+
comment = ""
|
21
|
+
else
|
22
|
+
comment << line
|
23
|
+
end
|
24
|
+
end
|
25
|
+
i.close
|
26
|
+
|
27
|
+
tmp_name = "tmp.#{Process.pid}"
|
28
|
+
File.open(tmp_name, "w") {|o|
|
29
|
+
o.print first_line
|
30
|
+
comments.each {|comment|
|
31
|
+
if pattern.match(comment)
|
32
|
+
deleted_comments.push(comment)
|
33
|
+
else
|
34
|
+
o.print comment
|
35
|
+
o.puts "."
|
36
|
+
end
|
37
|
+
}
|
38
|
+
}
|
39
|
+
File.rename(file_name, file_name + ".bak")
|
40
|
+
File.rename(tmp_name, file_name)
|
41
|
+
}
|
42
|
+
|
43
|
+
deleted_comments.each {|comment|
|
44
|
+
print comment
|
45
|
+
puts "."
|
46
|
+
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (C) 2004 Satoru Takabayashi <satoru@namazu.org>
|
4
|
+
# You can redistribute it and/or modify it under GPL2.
|
5
|
+
#
|
6
|
+
# Modified by machu ( http://www.machu.jp/diary/ )
|
7
|
+
# 2008-03-07: adding last-modified filter with -a and -b option
|
8
|
+
#
|
9
|
+
require 'optparse'
|
10
|
+
after_date = Time.at(0)
|
11
|
+
before_date = Time.now
|
12
|
+
test = false
|
13
|
+
|
14
|
+
opt = OptionParser.new
|
15
|
+
opt.on('-a AFTER_HOUR') {|v|
|
16
|
+
after_date = Time.at(Time.now - 60 * 60 * v.to_i)
|
17
|
+
}
|
18
|
+
opt.on('-b BEFORE_HOUR') {|v|
|
19
|
+
before_date = Time.at(Time.now - 60 * 60 * v.to_i)
|
20
|
+
}
|
21
|
+
opt.on('-t') {|v|
|
22
|
+
test = true
|
23
|
+
}
|
24
|
+
opt.parse!(ARGV)
|
25
|
+
|
26
|
+
puts "Usage: tdiary-comment-clean [-a AFTER_HOUR] [-b BEFORE_HOUR] PATTERN FILE..." if ARGV.length == 0
|
27
|
+
pattern = Regexp.new(ARGV.shift)
|
28
|
+
file_names = ARGV
|
29
|
+
|
30
|
+
class Comment
|
31
|
+
attr_accessor :body, :date
|
32
|
+
|
33
|
+
def initialize
|
34
|
+
@body = ""
|
35
|
+
end
|
36
|
+
|
37
|
+
def <<(body)
|
38
|
+
if body.match(/^Last-Modified: (\d+)$/)
|
39
|
+
@date = Time.at($1.to_i)
|
40
|
+
end
|
41
|
+
@body << body
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
deleted_comments = []
|
46
|
+
file_names.each {|file_name|
|
47
|
+
i = File.open(file_name)
|
48
|
+
first_line = i.gets
|
49
|
+
|
50
|
+
comments = []
|
51
|
+
comment = Comment.new
|
52
|
+
while line = i.gets
|
53
|
+
if line == ".\n"
|
54
|
+
comments.push(comment)
|
55
|
+
comment = Comment.new
|
56
|
+
else
|
57
|
+
comment << line
|
58
|
+
end
|
59
|
+
end
|
60
|
+
i.close
|
61
|
+
|
62
|
+
tmp_name = "tmp.#{Process.pid}"
|
63
|
+
File.open(tmp_name, "w") {|o|
|
64
|
+
o.print first_line
|
65
|
+
comments.each {|comment|
|
66
|
+
if pattern.match(comment.body) and (before_date > comment.date) and (after_date < comment.date)
|
67
|
+
deleted_comments.push(comment)
|
68
|
+
else
|
69
|
+
o.print comment.body
|
70
|
+
o.puts "."
|
71
|
+
end
|
72
|
+
}
|
73
|
+
}
|
74
|
+
File.rename(file_name, file_name + ".bak") unless test
|
75
|
+
File.rename(tmp_name, file_name) unless test
|
76
|
+
}
|
77
|
+
|
78
|
+
deleted_comments.each {|comment|
|
79
|
+
print comment.body
|
80
|
+
puts "."
|
81
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (C) 2004 Satoru Takabayashi <satoru@namazu.org>
|
4
|
+
# You can redistribute it and/or modify it under GPL2.
|
5
|
+
#
|
6
|
+
puts "Usage: tdiary-referer-clean PATTERN FILE..." if ARGV.length == 0
|
7
|
+
pattern = Regexp.new(ARGV.shift)
|
8
|
+
file_names = ARGV
|
9
|
+
|
10
|
+
deleted_referers = []
|
11
|
+
file_names.each {|file_name|
|
12
|
+
tmp_name = "tmp.#{Process.pid}"
|
13
|
+
i = File.open(file_name)
|
14
|
+
o = File.open(tmp_name, "w")
|
15
|
+
|
16
|
+
first_line = i.gets
|
17
|
+
o.print first_line
|
18
|
+
|
19
|
+
while true
|
20
|
+
date_line = i.gets
|
21
|
+
break if date_line.nil?
|
22
|
+
raise unless /^Date: /.match(date_line)
|
23
|
+
blank_line = i.gets
|
24
|
+
raise unless blank_line == "\n"
|
25
|
+
|
26
|
+
o.print date_line
|
27
|
+
o.print blank_line
|
28
|
+
while line = i.gets
|
29
|
+
if line == ".\n"
|
30
|
+
o.print line
|
31
|
+
next
|
32
|
+
end
|
33
|
+
if pattern.match(line)
|
34
|
+
deleted_referers.push(line)
|
35
|
+
else
|
36
|
+
o.print line
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
i.close
|
41
|
+
o.close
|
42
|
+
|
43
|
+
File.rename(file_name, file_name + ".bak")
|
44
|
+
File.rename(tmp_name, file_name)
|
45
|
+
}
|
46
|
+
deleted_referers.each {|referer| print referer }
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#
|
2
|
+
# convert utf-8 in pstore.
|
3
|
+
#
|
4
|
+
# usage: convert_pstore.rb file1
|
5
|
+
#
|
6
|
+
|
7
|
+
$KCODE = 'u'
|
8
|
+
|
9
|
+
require 'nkf'
|
10
|
+
require "pstore"
|
11
|
+
begin
|
12
|
+
require "iconv"
|
13
|
+
rescue LoadError
|
14
|
+
end
|
15
|
+
|
16
|
+
def convert_pstore( file )
|
17
|
+
db = PStore.new( file )
|
18
|
+
begin
|
19
|
+
roots = db.transaction{ db.roots }
|
20
|
+
rescue ArgumentError
|
21
|
+
if /\Aundefined class\/module (.+?)(::)?\z/ =~ $!.message
|
22
|
+
klass = $1
|
23
|
+
if /EmptdiaryString\z/ =~ klass
|
24
|
+
eval( "class #{klass} < String; end" )
|
25
|
+
else
|
26
|
+
eval( "class #{ klass}; end" )
|
27
|
+
end
|
28
|
+
retry
|
29
|
+
end
|
30
|
+
end
|
31
|
+
db.transaction do
|
32
|
+
roots.each do |root|
|
33
|
+
convert_element( db[root] )
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def convert_element( data )
|
39
|
+
case data
|
40
|
+
when Hash, Array
|
41
|
+
data.each_with_index do |e, i|
|
42
|
+
if String === e
|
43
|
+
data[i] = migrate_to_utf8( e )
|
44
|
+
else
|
45
|
+
convert_element( e )
|
46
|
+
end
|
47
|
+
end
|
48
|
+
else
|
49
|
+
data.instance_variables.each do |e|
|
50
|
+
var = data.instance_variable_get( e )
|
51
|
+
if String === var
|
52
|
+
data.instance_variable_set( e, migrate_to_utf8( var ) )
|
53
|
+
else
|
54
|
+
convert_element( var )
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def migrate_to_utf8( str )
|
61
|
+
to_native( str, 'EUC-JP' )
|
62
|
+
end
|
63
|
+
|
64
|
+
def to_native( str, charset = nil )
|
65
|
+
begin
|
66
|
+
Iconv.conv('utf-8', charset || 'utf-8', str)
|
67
|
+
rescue
|
68
|
+
from = case charset
|
69
|
+
when /^utf-8$/i
|
70
|
+
'W'
|
71
|
+
when /^shift_jis/i
|
72
|
+
'S'
|
73
|
+
when /^EUC-JP/i
|
74
|
+
'E'
|
75
|
+
else
|
76
|
+
''
|
77
|
+
end
|
78
|
+
NKF::nkf("-m0 -#{from}w", str)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
convert_pstore( ARGV[0] )
|
@@ -0,0 +1,36 @@
|
|
1
|
+
2007-02-23 SHIBATA Hiroshi <h-sbt@nifty.com>
|
2
|
+
|
3
|
+
* estraier-search.rb: add override whatsnew plugin.
|
4
|
+
|
5
|
+
2007-02-18 Kazuhiko <kazuhiko@fdiary.net>
|
6
|
+
|
7
|
+
* estraier-search.rb: add 'require "date"'.
|
8
|
+
|
9
|
+
2007-02-16 Kazuhiko <kazuhiko@fdiary.net>
|
10
|
+
|
11
|
+
* estraier-register.rb, estraier-search.rb: rename
|
12
|
+
@last_modified attribute to @mdate.
|
13
|
+
|
14
|
+
* estraier-register.rb: register all visible comments (ie. not
|
15
|
+
limit to 100).
|
16
|
+
|
17
|
+
2007-02-15 Kazuhiko <kazuhiko@fdiary.net>
|
18
|
+
|
19
|
+
* estraier-search.rb, estraier.rhtml: support similarity search.
|
20
|
+
|
21
|
+
* estraier-register.rb, estraier-search.rb: support
|
22
|
+
"estraier.with_user_name" option.
|
23
|
+
* estraier-search.rb, estraier.rhtml: support changing a phrase
|
24
|
+
format.
|
25
|
+
|
26
|
+
2007-02-14 Kazuhiko <kazuhiko@fdiary.net>
|
27
|
+
|
28
|
+
* estraier.rxml: add guid elements and escape contents of
|
29
|
+
description elements.
|
30
|
+
* estraier-register.rb, estraier-search.rb: add the
|
31
|
+
'estraier.path' variable.
|
32
|
+
* estraier.rhtml: revise for more tdiary-like outputs.
|
33
|
+
|
34
|
+
2007-02-13 Kazuhiko <kazuhiko@fdiary.net>
|
35
|
+
|
36
|
+
* initial release: ported from rast-search.
|
@@ -0,0 +1,114 @@
|
|
1
|
+
estraier-search README
|
2
|
+
===================
|
3
|
+
|
4
|
+
Hyper Estraier <http://hyperestraier.sourceforge.net/> を用いた tDiary
|
5
|
+
検索環境です。
|
6
|
+
|
7
|
+
|
8
|
+
特徴
|
9
|
+
----------
|
10
|
+
|
11
|
+
日記の更新と連動して自動的にインデックスを更新するので、いつでも最新の
|
12
|
+
情報で検索することができます。日記を HTML 化した後に必要な部分だけを取
|
13
|
+
り出してインデックスを作成するので、ヘッダやフッタなどによる検索ノイズ
|
14
|
+
がなく、また、プラグインの出力が検索対象になるという特徴があります。
|
15
|
+
|
16
|
+
|
17
|
+
必要なもの
|
18
|
+
----------
|
19
|
+
|
20
|
+
* tDiary 1.5 以降
|
21
|
+
* Ruby 1.8.2 以降
|
22
|
+
* Hyper Estraier 1.4 以降
|
23
|
+
(ピュアRubyインターフェイス estraierpure.rb も必要です)
|
24
|
+
|
25
|
+
|
26
|
+
セットアップ
|
27
|
+
------------
|
28
|
+
|
29
|
+
1. estraier-register.rb を tDiary の プラグインディレクトリにコピーします。
|
30
|
+
|
31
|
+
2. estraier-search.rb を tDiary の index.rb があるディレクトリにコピー
|
32
|
+
します。必要なら index.rb と同じようにシンボリックリンクを張ったり
|
33
|
+
名前を変えたりしてください。
|
34
|
+
|
35
|
+
3. CGI として実行可能にします。
|
36
|
+
|
37
|
+
$ chmod a+x estraier-search.rb
|
38
|
+
|
39
|
+
4. 必要なら #! のパスを変更します。
|
40
|
+
|
41
|
+
5. estraier.rhtml と estraier.rxml と i.estraier.rhtml を tDiary の
|
42
|
+
skel/ ディレクトリにコピーします。
|
43
|
+
|
44
|
+
6. Hyper Estraier のノードマスタをセットアップします。その際、設定ファ
|
45
|
+
イル(ノードマスタのrootdirの下の_conf)に、以下を追加してください。
|
46
|
+
|
47
|
+
attrindex: @uri{{!}}str
|
48
|
+
|
49
|
+
この設定がないと、登録エントリが増えた際に、著しくパフォーマンスが
|
50
|
+
低下します。
|
51
|
+
|
52
|
+
7. ノードマスタから、tDiary用のノードサーバを作成し、その接続情報を
|
53
|
+
tdiary.conf に記述します。デフォルトでは、以下のように記述したのと
|
54
|
+
同じ設定です。
|
55
|
+
|
56
|
+
@options["estraier.host"] = "localhost"
|
57
|
+
@options["estraier.port"] = 1978
|
58
|
+
@options["estraier.path"] = "/node/"
|
59
|
+
@options["estraier.node"] = "tdiary"
|
60
|
+
@options["estraier.name"] = "admin"
|
61
|
+
@options["estraier.password"] = "admin"
|
62
|
+
|
63
|
+
8. estraier-register.rb プラグインを有効にします。(tDiary の plugin/
|
64
|
+
ディレクトリにコピーするか、プラグイン選択のディレクトリにコピーし
|
65
|
+
てブラウザから有効に設定します。言語リソースファイルの
|
66
|
+
en/estraier-register.rb と ja/estraier-register.rb も、プラグインディ
|
67
|
+
レクトリの en/ 以下およびja/ 以下にコピーしてください。)
|
68
|
+
|
69
|
+
9. 既存の日記コンテンツに対して検索インデックスを作成します。tDiary の
|
70
|
+
設定画面から「Estraier検索」を選び、「Estraier検索のインデックスを
|
71
|
+
再構築する場合は、チェックボックスをチェックしてOKを押してください」
|
72
|
+
というメッセージに従ってチェックしてOKを押すと、
|
73
|
+
|
74
|
+
インデックスの作成は、tDiary の CGI の実行権限で以下のように実行する
|
75
|
+
ことでも可能です。
|
76
|
+
|
77
|
+
ruby estraier-register.rb [-p tdiary.rbのあるディレクトリ] [-c tdiary.confのあるディレクトリ]
|
78
|
+
|
79
|
+
10. 自分の tDiary の好きな場所 (例えばヘッダ) に以下のようなフォームを加
|
80
|
+
えてください。
|
81
|
+
|
82
|
+
<form method="get" action="estraier-search.rb" class="search">
|
83
|
+
<input type="text" name="query" size="20" value="">
|
84
|
+
<input type="submit" value="Search">
|
85
|
+
</form>
|
86
|
+
|
87
|
+
search-form.rb プラグインを有効にしている場合は、以下のように書くこ
|
88
|
+
ともできます。
|
89
|
+
|
90
|
+
<%= search_form("estraier-search.rb", "query") %>
|
91
|
+
|
92
|
+
以上です。
|
93
|
+
|
94
|
+
|
95
|
+
検索のしかた
|
96
|
+
------------
|
97
|
+
|
98
|
+
estraier-search の検索対象は、日記本文、ツッコミ、TrackBack です。
|
99
|
+
|
100
|
+
検索方法については、
|
101
|
+
http://hyperestraier.sourceforge.net/uguide-ja.html#searchcond をご覧
|
102
|
+
ください。検索条件の書式を指定していない場合は、「簡便書式」で検索を行
|
103
|
+
います。
|
104
|
+
|
105
|
+
|
106
|
+
連絡先
|
107
|
+
------
|
108
|
+
|
109
|
+
かずひこ <kazuhiko@fdiary.net>
|
110
|
+
http://www.fdiary.net/
|
111
|
+
|
112
|
+
バグ報告は以下のどこかにお願いします。
|
113
|
+
* tdiary-devel ML
|
114
|
+
* 直接メール
|