livedoor Wikiµ­Ë¡¥â¥¸¥å¡¼¥ë¤ò¸ø³«¤·¤Þ¤·¤¿

¥«¥Æ¥´¥ê
¥Ö¥Ã¥¯¥Þ¡¼¥¯¿ô
¤³¤Î¥¨¥ó¥È¥ê¡¼¤ò´Þ¤à¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯ ¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯ - livedoor Wikiµ­Ë¡¥â¥¸¥å¡¼¥ë¤ò¸ø³«¤·¤Þ¤·¤¿
¤³¤Î¥¨¥ó¥È¥ê¡¼¤ò¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ËÄɲÃ

¤³¤ó¤Ë¤Á¤Ï¡£ livedoor WikiôÅö¤Î¤Ý¤í¤­¤£¤Ç¤¹¡£Àè½µ¡¢livedoor Wikiµ­Ë¡¥â¥¸¥å¡¼¥ë¤ò¸ø³«¤·¤Þ¤·¤¿¤Î¤Ç¤½¤ÎÊó¹ð¤Ç¤¹¡£

livedoor Wikiµ­Ë¡¥â¥¸¥å¡¼¥ë¤È¤Ï

Perl¤Ç½ñ¤«¤ì¤¿livedoor Wikiµ­Ë¡¤òHTML¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬½ÐÍè¤ë¥â¥¸¥å¡¼¥ë¤Ç¤¹¡£Text::Livedoor::Wiki ¤È¤¤¤¦Ì¾Á°¤Ç¥â¥¸¥å¡¼¥ë²½¤µ¤ì¤Æ¤ª¤ê¡¢CPAN¤«¤é¥À¥¦¥ó¥í¡¼¥É & ¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤¹¡£

sudo cpan install Text::Livedoor::Wiki

¥µ¥ó¥×¥ë

»È¤¤Êý¤Ï¤È¤Æ¤â´Êñ¤Ç¤¹¡£__DATA__¥»¥¯¥·¥ç¥ó¤ËWikiʸ¤òµ­½Ò¤¹¤ë¤È¡¢HTML¤È¤·¤Æ½ÐÎϤ¹¤ëCGI¤â´Êñ¤Ëºî¤ì¤Þ¤¹¡£

#!/usr/bin/perl

use warnings;
use strict;
use Text::Livedoor::Wiki;
use CGI; print CGI->header;

print qq|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link href="http://static.wiki.livedoor.jp/formatter-storage/css/cpan-like.css" type="text/css" rel="stylesheet" />
</head>
<body>
|;

my $wiki_text = do { local $/;  <DATA>; };

my $wiki 
    = Text::Livedoor::Wiki->new({
        opts => { storage => 'http://static.wiki.livedoor.jp/formatter-storage' } 
    });
my $html = $wiki->parse( $wiki_text );
print $html;

print "</body></html>";
__DATA__
* livedoor¥¦¥£¥­
&fukidashi(polocky){livedoor Wikiµ­Ë¡¤Ø¤è¤¦¤³¤½¡ª}

** ºÇ¿·¾ðÊó

=||
livedoor wiki¤Ç¤ÏºÇ¶á¡¢Åê¹Æ¥Õ¥©¡¼¥à¤ò
ºî¤êľ¤·¤¿¤ß¤¿¤¤¤Ç¤¹¤Í
||=

** ¤ª¤¹¤¹¤á¥ê¥ó¥¯

- [[livedoor Wiki>http://wiki.livedoor.com]]
- [[livedoor Wikiµ­Ë¡¥â¥¸¥å¡¼¥ë¥¦¥£¥­>http://wiki.livedoor.jp/wiki_text/]]

¼Â¹ÔÆâÍÆ

¾åµ­¥µ¥ó¥×¥ë¤ò¼Â¹Ô¤¹¤ë¤È¡¢¤³¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£

¥Ô¥¯¥Á¥ã 8


¹©Éפ·¤¿¥Ý¥¤¥ó¥È ¡Á ¥·¥ó¥°¥ë¥È¥ó²½Âбþ

Text::Livedoor::Wiki¤Ç¤Ï¡¢µ­Ë¡¤ò¥×¥é¥¬¥Ö¥ë¤ËÁªÂò¤Ç¤­¡¢ÊØÍø¤Ë³ÈÄ¥¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤³¤Î¥×¥é¥¬¥Ö¥ë¼êË¡¤ò¼ÂÁõ¤¹¤ë¾ì¹ç¡¢¥×¥é¥°¥¤¥ó¥í¡¼¥É»þ´Ö¤Î¥³¥¹¥È¤ò²ò·è¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

¥·¥ó¥°¥ë¥È¥ó²½¤·¡¢¥¤¥ó¥¹¥¿¥ó¥¹¤ò»È¤¤²ó¤¹¼êË¡¤Ë¤è¤ê²ò·è¤¹¤ëÆ»¤òÁª¤Ó¤Þ¤·¤¿¡£¤¿¤À¤·¡¢¤³¤Î¼êË¡¤Ï$self¤ò»È¤¤²ó¤¹¤Î¤Ç¡¢¥á¥â¥ê¤ÎÈîÂç²½¤Ê¤É¤òËɤ°¤¿¤á¤Ë¡¢$self¤ò±øÀ÷¤·¤Ê¤¤¼ÂÁõ¤¬É¬Íפˤʤê¤Þ¤¹¡£¤½¤ÎÅú¤¨¤È¤·¤Æ¡¢ local ÊÑ¿ô¤ò³èÍѤ¹¤ë¤³¤È¤Ë¤·¤Þ¤·¤¿¡£

    local $Text::Livedoor::Wiki::scratchpad = {};
    local $Text::Livedoor::Wiki::opts 
      = { id_keeper => $id_keeper , 
          catalog_keeper => $catalog_keeper , 
         %$opts 
      };

¤³¤Î¼ÂÁõ¤Ë¤è¤ê¡¢¥×¥é¥°¥¤¥óÀß·×»þ¤Ë¥á¥â¥ê¤ÎÈîÂç²½¤ò°Õ¼±¤¹¤ëɬÍפ¬¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿¡£¾¯¤·Îϵ»¤Ç¤¹¤¬¡¢ÌäÂê¤Ê¤¯Æ°ºî¤·¤Æ¤¤¤Þ¤¹¡£

¤Þ¤È¤á

Text::Livedoor::Wiki¤Ï¤³¤Î¤è¤¦¤Ë´Êñ¤ËÍøÍѤǤ­¤Þ¤¹¡£ÍøÍÑÊýË¡¤Î¾Ü¤·¤¯¤Ï¡¢Text::Livedoor::Wiki ¥¦¥£¥­¤Ë¤Þ¤È¤á¤Æ¤Þ¤¹¡£À§Èó¤´³èÍѤ¯¤À¤µ¤¤¡£

¥ì¥¹¥Ý¥ó¥¹

¤³¤Î¥¨¥ó¥È¥ê¡¼¤ò¤Ï¤Æ¤Ê¥Ö¥Ã¥¯¥Þ¡¼¥¯¤ËÄɲÃ