OSDN Git Service

書籍執筆用のプラグインをsandboxにコミットしておきます。
authortakezoe <takezoe@871d6764-1e22-0410-b313-a55050885396>
Sun, 31 Jul 2011 03:00:03 +0000 (03:00 +0000)
committertakezoe <takezoe@871d6764-1e22-0410-b313-a55050885396>
Sun, 31 Jul 2011 03:00:03 +0000 (03:00 +0000)
39 files changed:
takezoe/plugin/book/Caption.pm [new file with mode: 0644]
takezoe/plugin/book/Chapter.pm [new file with mode: 0644]
takezoe/plugin/book/Code.pm [new file with mode: 0644]
takezoe/plugin/book/Column.pm [new file with mode: 0644]
takezoe/plugin/book/Install.pm [new file with mode: 0644]
takezoe/plugin/book/Link.pm [new file with mode: 0644]
takezoe/plugin/book/List.pm [new file with mode: 0644]
takezoe/plugin/book/Memo.pm [new file with mode: 0644]
takezoe/plugin/book/Memolist.pm [new file with mode: 0644]
takezoe/plugin/book/Pagecount.pm [new file with mode: 0644]
takezoe/plugin/book/README.txt [new file with mode: 0644]
takezoe/plugin/book/Title1.pm [new file with mode: 0644]
takezoe/plugin/book/Title2.pm [new file with mode: 0644]
takezoe/plugin/book/Title3.pm [new file with mode: 0644]
takezoe/plugin/book/Toc.pm [new file with mode: 0644]
takezoe/plugin/book/TocParser.pm [new file with mode: 0644]
takezoe/plugin/book/Wordcount.pm [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-apollo.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-clj.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-css.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-go.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-hs.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-lisp.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-lua.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-ml.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-n.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-proto.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-scala.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-sql.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-tex.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-vb.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-vhdl.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-wiki.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-xq.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/lang-yaml.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/prettify.css [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/prettify.js [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/sons-of-obsidian.css [new file with mode: 0644]
takezoe/plugin/book/google-code-prettify/sunburst.css [new file with mode: 0644]

diff --git a/takezoe/plugin/book/Caption.pm b/takezoe/plugin/book/Caption.pm
new file mode 100644 (file)
index 0000000..dddecf8
--- /dev/null
@@ -0,0 +1,67 @@
+################################################################################
+#
+# <p>¿ÞɽÈÖ¹æ¤Ê¤É¤ò½ÐÎϤ¹¤ë¤¿¤á¤Î¥Ñ¥é¥°¥é¥Õ¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <pre>
+# {{caption É½,¥á¥½¥Ã¥É°ìÍ÷}}
+# </pre>
+# <p>°Ê²¼¤Î¤è¤¦¤ÊHTML¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£</p>
+# <pre>
+# &gt;div class="caption"&lt;ɽ1: ¥á¥½¥Ã¥É°ìÍ÷&gt;/div&lt;
+# </pre>
+# <p>
+#   link¥×¥é¥°¥¤¥ó¤ò»ÈÍѤ·¤ÆÁê¸ß»²¾È¤ò¤Ï¤ë¾ì¹ç¤ÏÂè3°ú¿ô¤Ë¥ê¥ó¥¯ÍѤΥé¥Ù¥ë¤òµ­½Ò¤·¤Þ¤¹¡£
+#   link¥×¥é¥°¥¤¥ó¤Ç¤Ï¤³¤Î¥é¥Ù¥ë¤ò»ØÄꤷ¤Æ¥ê¥ó¥¯¤òºîÀ®¤·¤Þ¤¹¡£
+# </p>
+# <pre>
+# {{caption É½,¥á¥½¥Ã¥É°ìÍ÷,method_list}}
+# ...
+# ¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï{{link method_list}}¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+# </pre>
+#
+################################################################################
+package plugin::book::Caption;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥Ñ¥é¥°¥é¥Õ¥á¥½¥Ã¥É
+#==============================================================================
+sub paragraph {
+       my $self    = shift;
+       my $wiki    = shift;
+       my $type    = shift;
+       my $caption = shift;
+       my $anchor  = shift;
+       
+       $self->{$type}++;
+       
+       my $plugin = $wiki->get_plugin_instance('plugin::book::Chapter');
+       
+       if($anchor eq ''){
+               return '<div class="caption">'.
+                       Util::escapeHTML($type).$plugin->{'chapter'}.'-'.$self->{$type}.': '.
+                       Util::escapeHTML($caption).'</div>';
+       } else {
+               return '<div class="caption"><a name="'.Util::escapeHTML($anchor).'">'.
+                       Util::escapeHTML($type).$plugin->{'chapter'}.'-'.$self->{$type}.': '.
+                       Util::escapeHTML($caption).'</a></div>';
+       }
+}
+
+#==============================================================================
+# ¥Õ¥Ã¥¯¥á¥½¥Ã¥É
+#==============================================================================
+sub hook {
+       my $self = shift;
+       foreach my $key (keys(%$self)){
+               $self->{$key} = 0;
+       }
+}
+
+1;
diff --git a/takezoe/plugin/book/Chapter.pm b/takezoe/plugin/book/Chapter.pm
new file mode 100644 (file)
index 0000000..bf6609b
--- /dev/null
@@ -0,0 +1,38 @@
+################################################################################
+#
+# <p>¾Ï¤Î¸«½Ð¤·¤ò½ÐÎϤ¹¤ë¥Ñ¥é¥°¥é¥Õ¥×¥é¥°¥¤¥ó¡£</p>
+# <pre>
+# {{chapter 1,¤Ï¤¸¤á¤Ë}}
+# </pre>
+# <p>
+#   Â¾¤Î¥×¥é¥°¥¤¥ó¤Ç¤Ï¤³¤Î¥×¥é¥°¥¤¥ó¤ÇÄêµÁ¤·¤¿¾ÏÈÖ¹æ¤ò»È¤Ã¤Æ¿ÞɽÈÖ¹æ¤Ê¤É¤ò¿¶¤Ã¤Æ
+#   ¤¤¤ë¤¿¤á¡¢1¥Ú¡¼¥¸¤ËºÇÄã1¤Ä¤Ï¤³¤Î¥×¥é¥°¥¤¥ó¤òµ­½Ò¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
+# </p>
+#
+################################################################################
+package plugin::book::Chapter;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥Ñ¥é¥°¥é¥Õ¥á¥½¥Ã¥É
+#==============================================================================
+sub paragraph {
+       my $self    = shift;
+       my $wiki    = shift;
+       my $chapter = shift;
+       my $title   = shift;
+       
+       $self->{'chapter'} = $chapter;
+       $wiki->do_hook('chapter');
+       
+       return '<div class="chapter"><a name="chapter"'.$chapter.'>Chapter '.$chapter.'. '.Util::escapeHTML($title).'</a></div>';
+}
+
+1;
diff --git a/takezoe/plugin/book/Code.pm b/takezoe/plugin/book/Code.pm
new file mode 100644 (file)
index 0000000..d235fe4
--- /dev/null
@@ -0,0 +1,22 @@
+package plugin::book::Code;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥¤¥ó¥é¥¤¥ó¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self = shift;
+       my $wiki = shift;
+       my $text = shift;
+       
+       return '<code>'.Util::escapeHTML($text).'</code>';
+}
+
+1;
diff --git a/takezoe/plugin/book/Column.pm b/takezoe/plugin/book/Column.pm
new file mode 100644 (file)
index 0000000..ba179c9
--- /dev/null
@@ -0,0 +1,35 @@
+###############################################################################
+#
+# <p>¥³¥é¥à¤òµ­½Ò¤¹¤ë¤¿¤á¤Î¥Ö¥í¥Ã¥¯¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <pre>
+# {{column ¥³¥é¥à¤Î¥¿¥¤¥È¥ë
+# ¥³¥é¥àËÜʸ
+# }}
+# </pre>
+# <p>¥³¥é¥àËÜʸ¤ÏWiki·Á¼°¤Çµ­½Ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£</p>
+#
+###############################################################################
+package plugin::book::Column;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥Ö¥í¥Ã¥¯¥á¥½¥Ã¥É
+#==============================================================================
+sub block {
+       my $self    = shift;
+       my $wiki    = shift;
+       my $content = shift;
+       my $title   = shift;
+       
+       return '<div class="column-title">¥³¥é¥à: '.Util::escapeHTML($title).'</div>'.
+               '<div class="column-body">'.$wiki->process_wiki($content).'</div>';
+}
+
+1;
diff --git a/takezoe/plugin/book/Install.pm b/takezoe/plugin/book/Install.pm
new file mode 100644 (file)
index 0000000..03f32f0
--- /dev/null
@@ -0,0 +1,127 @@
+############################################################
+#
+# ½ñÀÒ¼¹É®ÍѤΥץ饰¥¤¥ó¤òÄ󶡤·¤Þ¤¹¡£
+#
+############################################################
+package plugin::book::Install;
+use strict;
+use plugin::book::TocParser;
+
+sub install {
+       my $wiki  = shift;
+       $wiki->add_paragraph_plugin("chapter", "plugin::book::Chapter", "HTML");
+       $wiki->add_inline_plugin("title1", "plugin::book::Title1", "HTML");
+       $wiki->add_inline_plugin("title2", "plugin::book::Title2", "HTML");
+       $wiki->add_inline_plugin("title3", "plugin::book::Title3", "HTML");
+       $wiki->add_paragraph_plugin("caption" ,"plugin::book::Caption" ,"HTML");
+       $wiki->add_paragraph_plugin("toc" ,"plugin::book::Toc" ,"HTML");
+       $wiki->add_inline_plugin("link" ,"plugin::book::Link" ,"HTML");
+       
+       $wiki->add_block_plugin("list" ,"plugin::book::List" ,"HTML");
+       $wiki->add_inline_plugin("code" ,"plugin::book::Code" ,"HTML");
+       
+       $wiki->add_block_plugin("column" ,"plugin::book::Column" ,"HTML");
+       
+       $wiki->add_inline_plugin("memo", "plugin::book::Memo", "HTML");
+       $wiki->add_paragraph_plugin("memolist", "plugin::book::Memolist", "HTML");
+       
+       $wiki->add_inline_plugin("wordcount", "plugin::book::Wordcount", "HTML");
+       $wiki->add_inline_plugin("pagecount", "plugin::book::Pagecount", "HTML");
+       
+       $wiki->add_hook("chapter", "plugin::book::Title1");
+       $wiki->add_hook("chapter", "plugin::book::Title2");
+       $wiki->add_hook("chapter", "plugin::book::Title3");
+       $wiki->add_hook("chapter", "plugin::book::Caption");
+       
+       $wiki->add_hook("title1", "plugin::book::Title2");
+       $wiki->add_hook("title1", "plugin::book::Title3");
+       
+       $wiki->add_hook("title3", "plugin::book::Title3");
+       
+       my @paths = split(/\//, $wiki->get_CGI()->path_info());
+       my $path_prefix = '';
+       for(my $i = 0; $i < $#paths; $i++){
+               $path_prefix .= '../';
+       }
+       
+       my $head_info = <<"END_OF_HEAD";
+<link href="${path_prefix}plugin/book/google-code-prettify/sunburst.css" type="text/css" rel="stylesheet" />
+<script type="text/javascript" src="${path_prefix}plugin/book/google-code-prettify/prettify.js"></script>
+<script type="text/javascript">window.onload = function(){ prettyPrint(); }</script>
+<style type="text/css">
+div.chapter {
+  text-align: right;
+  padding: 20px;
+  font-size: 200%;
+  font-style: italic;
+}
+
+a.xref {
+  background-color: silver;
+}
+
+a.xref:link {
+  color: black;
+}
+
+a.xref:hover {
+  color: black;
+}
+
+a.xref:visited {
+  color: black;
+}
+
+span.xref-error {
+  background-color: silver;
+  font-weight: bold;
+}
+
+span.memo {
+  background-color: yellow;
+  border: 1px solid #888800;
+  margin-left: 2px;
+  margin-right: 2x;
+}
+
+div.caption {
+  font-size: 80%;
+  font-weight: bold;
+}
+
+code {
+ font-weight: bold;
+/* font-style: italic; */
+ font-family: monospace;
+}
+
+img {
+  border: 1px solid silver;
+}
+
+div.column-title {
+  border-top: 1px solid gray;
+  border-left: 1px solid gray;
+  border-right: 1px solid gray;
+  padding: 4px;
+  background-color: silver;
+  font-weight: bold;
+  margin-left: 20px;
+  margin-right: 20px;
+}
+
+div.column-body {
+  border-bottom: 1px solid gray;
+  border-left: 1px solid gray;
+  border-right: 1px solid gray;
+  padding: 4px;
+  margin-left: 20px;
+  margin-right: 20px;
+}
+</style>
+END_OF_HEAD
+       
+       $wiki->add_head_info($head_info);
+}
+
+1;
diff --git a/takezoe/plugin/book/Link.pm b/takezoe/plugin/book/Link.pm
new file mode 100644 (file)
index 0000000..7621bf1
--- /dev/null
@@ -0,0 +1,99 @@
+################################################################################
+#
+# <p>¸«½Ð¤·¤ä¿Þɽ¤Ø¤Î¥ê¥ó¥¯¤ò½ÐÎϤ¹¤ë¤¿¤á¤Î¥¤¥ó¥é¥¤¥ó¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <p>°ú¿ô¤Ë¤Ïtitle1¡Átitle3¥×¥é¥°¥¤¥ó¤äcaption¥×¥é¥°¥¤¥ó¤Çµ­½Ò¤·¤¿»²¾ÈÍѤΥé¥Ù¥ë¤ò»ØÄꤷ¤Þ¤¹¡£</p>
+# <pre>
+# !!!{{title1 installation}}¥¤¥ó¥¹¥È¡¼¥ëÊýË¡
+# ...
+# ¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï{{link installation}}¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+# </pre>
+# <p>Âè2°ú¿ô¤Ç¥Ú¡¼¥¸¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢ÊÌ¥Ú¡¼¥¸¤Î¸«½Ð¤·¤ä¿Þɽ¤ò»²¾È¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£</p>
+# <pre>
+# ¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï{{link installation,Chapter1}}¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
+# </pre>
+#
+################################################################################
+package plugin::book::Link;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥¤¥ó¥é¥¤¥ó¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self   = shift;
+       my $wiki   = shift;
+       my $anchor = shift;
+       my $page   = shift;
+       
+       $page = $wiki->get_CGI->param('page') unless $page;
+       my $source = $wiki->get_page($page);
+       
+       my $text = '';
+       
+       my @lines = split(/\n/,$wiki->get_page($page));
+       my $chapter = '';
+       my $count = {};
+       my $title1Count = 0;
+       my $title2Count = 0;
+       my $title3Count = 0;
+       
+       # TODO {{pre}}¥×¥é¥°¥¤¥óÆâ¤Îµ­½Ò¤ÏÈô¤Ð¤µ¤Ê¤¤¤È¥À¥á¡ª¡ª¥Ñ¡¼¥µ¤òºî¤é¤Ê¤¤¤È¥À¥á¤Ã¤Ý¤¤¡©
+       foreach my $line (@lines){
+               if($line =~ /^{{(chapter.+}})$/){
+                       my $plugin = $wiki->parse_inline_plugin($1);
+                       $chapter = $plugin->{'args'}->[0];
+                       $title1Count = 0;
+                       $title2Count = 0;
+                       $title3Count = 0;
+                       foreach my $key (keys(%$count)){
+                               $count->{$key} = 0;
+                       }
+               } elsif($line =~ /^!!!{{(title1.+}})(.+)$/){
+                       my $plugin = $wiki->parse_inline_plugin($1);
+                       $title1Count++;
+                       $title2Count = 0;
+                       $title3Count = 0;
+                       if($plugin->{'args'}->[0] eq $anchor){
+                               $text= $chapter.'-'.$title1Count.'. '.Util::trim($2);
+                               last;
+                       }
+               } elsif($line =~ /^!!{{(title2.+}})$/){
+                       my $plugin = $wiki->parse_inline_plugin($1);
+                       $title2Count++;
+                       $title3Count = 0;
+                       if($plugin->{'args'}->[0] eq $anchor){
+                               $text= $chapter.'-'.$title1Count.'-'.$title2Count.'. '.Util::trim($2);
+                               last;
+                       }
+               } elsif($line =~ /^!{{(title3.+}})$/){
+                       my $plugin = $wiki->parse_inline_plugin($1);
+                       $title3Count++;
+                       if($plugin->{'args'}->[0] eq $anchor){
+                               $text= $chapter.'-'.$title1Count.'-'.$title2Count.'-'.$title3Count.'. '.Util::trim($2);
+                               last;
+                       }
+               } elsif($line =~ /^{{(caption.+}})$/){
+                       my $plugin = $wiki->parse_inline_plugin($1);
+                       my $type = $plugin->{'args'}->[0];
+                       $count->{$type}++;
+                       if($plugin->{'args'}->[2] eq $anchor){
+                               $text = $type.$chapter.'-'.$count->{$type}.': '.Util::trim($plugin->{'args'}->[1]);
+                               last;
+                       }
+               }
+       }
+       if($text ne ''){
+               return '<a href="?page='.Util::url_encode($page).'#'.Util::escapeHTML($anchor).'" class="xref">'.Util::escapeHTML($text).'</a>';
+       } else {
+               return '<span class="xref-error">»²¾ÈÀ褬¸«¤Ä¤«¤ê¤Þ¤»¤ó¡ª</span>';
+       }
+}
+
+1;
diff --git a/takezoe/plugin/book/List.pm b/takezoe/plugin/book/List.pm
new file mode 100644 (file)
index 0000000..cb4a4f7
--- /dev/null
@@ -0,0 +1,52 @@
+################################################################################
+#
+# <p>¥×¥í¥°¥é¥à¥ê¥¹¥È¤ò¥·¥ó¥¿¥Ã¥¯¥¹¥Ï¥¤¥é¥¤¥È¤·¤Æ½ÐÎϤ¹¤ë¤¿¤á¤ÎÊ£¿ô¹Ô¥×¥é¥°¥¤¥ó¡£</p>
+# <pre>
+# {{list
+# public class HelloWorld {
+# &nbsp;&nbsp;public static void main(String[] args){
+# &nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Hello World!");
+# &nbsp;&nbsp;}
+# }
+# }}
+# </pre>
+# <p>
+#   ¥·¥ó¥¿¥Ã¥¯¥¹¥Ï¥¤¥é¥¤¥È¤Ë¤Ï<a href="http://code.google.com/p/google-code-prettify/">google-code-prettify</a>¤ò»ÈÍѤ·¤Þ¤¹¡£
+#   É½¼¨¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
+# </p>
+# <link href="plugin/book/google-code-prettify/sunburst.css" type="text/css" rel="stylesheet" />
+# <script type="text/javascript" src="plugin/book/google-code-prettify/prettify.js"></script>
+# <script type="text/javascript">window.onload = function(){ prettyPrint(); }</script>
+# <pre class="prettyprint">
+# public class HelloWorld {
+# &nbsp;&nbsp;public static void main(String[] args){
+# &nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Hello World!");
+# &nbsp;&nbsp;}
+# }
+# </pre>
+#
+################################################################################
+package plugin::book::List;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       $self->{'count'} = 0;
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥Ö¥í¥Ã¥¯¥á¥½¥Ã¥É
+#==============================================================================
+sub block {
+       my $self = shift;
+       my $wiki = shift;
+       my $code = shift;
+       my $buf  = '';
+       
+       return $buf.'<pre class="prettyprint">'.Util::escapeHTML($code).'</pre>';
+}
+
+1;
diff --git a/takezoe/plugin/book/Memo.pm b/takezoe/plugin/book/Memo.pm
new file mode 100644 (file)
index 0000000..4475206
--- /dev/null
@@ -0,0 +1,38 @@
+################################################################################
+#
+# <p>¥Ú¡¼¥¸¤Ë¥á¥â¤òµ­½Ò¤¹¤ë¤¿¤á¤Î¥¤¥ó¥é¥¤¥ó¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <pre>
+# {{memo ¤³¤³¤Ë¥á¥â¤òµ­½Ò¤·¤Þ¤¹¡£}}
+# </pre>
+# <p>
+#   µ­½Ò¤·¤¿¥á¥â¤Ï¶¯Ä´¤µ¤ì¤Æɽ¼¨¤µ¤ì¤Þ¤¹¡£
+#   ¤Þ¤¿¡¢memolist¥×¥é¥°¥¤¥ó¤ò»ÈÍѤ·¤Æ°ìÍ÷ɽ¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+# </p>
+#
+################################################################################
+package plugin::book::Memo;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       $self->{'todo'} = [];
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥Ñ¥é¥°¥é¥Õ¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self = shift;
+       my $wiki = shift;
+       my $text = shift;
+       
+       push(@{$self->{'memolist'}}, $text);
+       my @list = @{$self->{'memolist'}};
+       
+       return '<span class="memo"><a name="todo-'.($#list + 1).'">'.Util::escapeHTML($text).'</a></span>';
+}
+
+1;
diff --git a/takezoe/plugin/book/Memolist.pm b/takezoe/plugin/book/Memolist.pm
new file mode 100644 (file)
index 0000000..cb10c2b
--- /dev/null
@@ -0,0 +1,42 @@
+################################################################################
+#
+# <p>memo¥×¥é¥°¥¤¥ó¤Çµ­½Ò¤·¤¿¥á¥â¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡£</p>
+# <pre>
+# {{memolist}}
+# </pre>
+#
+################################################################################
+package plugin::book::Memolist;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥Ñ¥é¥°¥é¥Õ¥á¥½¥Ã¥É
+#==============================================================================
+sub paragraph {
+       my $self   = shift;
+       my $wiki   = shift;
+       my $plugin = $wiki->get_plugin_instance('plugin::book::Memo');
+       
+       my $buf = '';
+       my $count = 1;
+       
+       foreach my $memo (@{$plugin->{'memolist'}}){
+               $buf .= '<li><a href="#todo-'.$count.'">'.Util::escapeHTML($memo).'</a></li>';
+               $count++;
+       }
+       
+       if($buf eq ''){
+               return '<p>¥³¥á¥ó¥È¤Ï¤¢¤ê¤Þ¤»¤ó</p>';
+       } else {
+               return '<ol>'.$buf.'</ol>';
+       }
+}
+
+1;
diff --git a/takezoe/plugin/book/Pagecount.pm b/takezoe/plugin/book/Pagecount.pm
new file mode 100644 (file)
index 0000000..6e195af
--- /dev/null
@@ -0,0 +1,39 @@
+################################################################################
+#
+# <p>¸½ºßɽ¼¨¤·¤Æ¤¤¤ë¥Ú¡¼¥¸¤Î³µ»»¥Ú¡¼¥¸¿ô¤òɽ¼¨¤¹¤ë¥¤¥ó¥é¥¤¥ó¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <p>1¥Ú¡¼¥¸=1600ʸ»ú¤Ç·×»»¤·¤Æ¤¤¤Þ¤¹¡£</p>
+# <pre>
+# Ê¸»ú¿ô¡§{{pagecount}}
+# </pre>
+# <p>°ú¿ô¤Ç¥«¥¦¥ó¥ÈÂоݤΥڡ¼¥¸¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£</p>
+# <pre>
+# Ê¸»ú¿ô¡§{{pagecount ¥Ú¡¼¥¸Ì¾}}
+# </pre>
+#
+################################################################################
+package plugin::book::Pagecount;
+use Encode qw(decode);
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥¤¥ó¥é¥¤¥ó¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self = shift;
+       my $wiki = shift;
+       my $page = shift;
+       
+       $page = $wiki->get_CGI->param('page') unless $page;
+       my $source = Jcode::convert($wiki->get_page($page), 'utf8', 'euc');
+       
+       return int(length(decode('utf-8', $source)) / 1600 + 1);
+}
+
+1;
diff --git a/takezoe/plugin/book/README.txt b/takezoe/plugin/book/README.txt
new file mode 100644 (file)
index 0000000..e2576ed
--- /dev/null
@@ -0,0 +1,108 @@
+!!!\8f\91\90Ð\8e·\95M\97p\83v\83\89\83O\83C\83\93\82Ì\8eg\82¢\95û\r
+\r
+!!\8fÍ\81A\8c©\8fo\82µ\82Ì\8dì\90¬\r
+\r
+1\83y\81[\83W\82Å1\8fÍ\95ª\82Ì\8c´\8de\82ð\8e·\95M\82·\82é\82±\82Æ\82ð\91z\92è\82µ\82Ä\82¢\82Ü\82·\81B\8ae\83y\81[\83W\82É\82Íchapter\83v\83\89\83O\83C\83\93\82Å\8fÍ\82Ì\8fî\95ñ\82ð\8bL\8fq\82µ\82Ü\82·\81B\82Ü\82½\81A\8c©\8fo\82µ\82Í\95\81\92Ê\82ÌWiki\82Ì\8c©\8fo\82µ\82Ì\8bL\96@\82Å\8bL\8fq\82·\82é\82Ì\82Å\82·\82ª\81Atitle1\81Atitle2\81Atitle3\83v\83\89\83O\83C\83\93\82Å\8c©\8fo\82µ\94Ô\8d\86\82ð\95\\8e¦\82Å\82«\82é\82æ\82¤\82É\82µ\82Ü\82µ\82½\81Btitle1\81Atitle2\81Atitle3\83v\83\89\83O\83C\83\93\82Í\8c©\8fo\82µ\82Ö\82Ì\91\8a\8cÝ\8eQ\8fÆ\82É\82à\8eg\97p\82µ\82Ü\82·\82ª\81A\91\8a\8cÝ\8eQ\8fÆ\82Ì\95û\96@\82É\82Â\82¢\82Ä\82Í\8cã\8fq\82µ\82Ü\82·\81B\r
+\r
+ {{chapter 1,\8fÍ\82Ì\83^\83C\83g\83\8b}}\r
+ !!!{{title1}}\8c©\8fo\82µ1\r
+ ...\r
+ !!{{title2}}\8c©\8fo\82µ2\r
+ ...\r
+ !{{title3}}\8c©\8fo\82µ3\r
+ ...\r
+\r
+!!\83\\81[\83X\83R\81[\83h\r
+\r
+FSWiki\82É\82Ípre\83^\83O\82Å\88Í\82ñ\82Å\8fo\97Í\82·\82é\82½\82ß\82Ì\8bL\96@\82â\83v\83\89\83O\83C\83\93\82ª\82 \82é\82Ì\82Å\82»\82ê\82ð\8eg\82Á\82Ä\82à\82¢\82¢\82Ì\82Å\82·\82ª\81AWeb\8fã\82Å\8eQ\8fÆ\82·\82é\82Æ\82«\82Í\83V\83\93\83^\83b\83N\83X\83n\83C\83\89\83C\83g\82³\82ê\82Ä\82¢\82½\82Ù\82¤\82ª\8c©\82â\82·\82¢\82æ\82Ë\81A\82Æ\82¢\82¤\82±\82Æ\82Å[google-code-prettify|http://code.google.com/p/google-code-prettify/]\82ð\8eg\97p\82µ\82Ä\8b­\92²\95\\8e¦\82ð\8ds\82¤\82½\82ß\82Ì\83v\83\89\83O\83C\83\93\82ð\97p\88Ó\82µ\82Ä\82¢\82Ü\82·\81B\r
+\r
+ {{list\r
+ public class HelloWorld {\r
+   public static void main(String[] args){\r
+     System.out.println("Hello World!");\r
+   }\r
+ }\r
+ }}\r
+\r
+!!\90}\95\\94Ô\8d\86\r
+\r
+caption\83v\83\89\83O\83C\83\93\82ð\8eg\97p\82·\82é\82Æ\90}\95\\94Ô\8d\86\82ð\95t\97^\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\91æ\88ê\88ø\90\94\82É\8eí\95Ê\81i\95\\81A\90}\81A\83\8a\83X\83g\82È\82Ç\81j\81A\91æ\93ñ\88ø\90\94\82É\83L\83\83\83v\83V\83\87\83\93\82É\95\\8e¦\82·\82é\95\8e\9a\97ñ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+\r
+ {{caption \95\,StringUtils\82Ì\83\81\83\\83b\83h\88ê\97\97}}\r
+ ,\83\81\83\\83b\83h\96¼,\90à\96¾\r
+ ,boolean isEmpty(String str),\95\8e\9a\97ñ\82ªnull\82Ü\82½\82Í\8bó\95\8e\9a\97ñ\82©\82Ç\82¤\82©\82ð\94»\92è\r
+ ,boolean isNotEmpty(String str),\95\8e\9a\97ñ\82ªnull\82Ü\82½\82Í\8bó\95\8e\9a\97ñ\82Å\82È\82¢\82©\82ð\94»\92è\r
+ ...\r
+\r
+\8c©\8fo\82µ\93¯\97l\81A\90}\95\\82É\82à\91\8a\8cÝ\8eQ\8fÆ\82ð\82Í\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\82ª\81A\91\8a\8cÝ\8eQ\8fÆ\82Ì\95û\96@\82É\82Â\82¢\82Ä\82Í\8cã\8fq\82µ\82Ü\82·\81B\r
+\r
+!!\83A\83E\83g\83\89\83C\83\93\82Ì\95\\8e¦\r
+\r
+FSWiki\82Å\82Íoutline\83v\83\89\83O\83C\83\93\82Å\83y\81[\83W\82Ì\8c©\8fo\82µ\82Ì\83A\83E\83g\83\89\83C\83\93\82ð\95\\8e¦\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\82ª\81A\90V\82½\82Étoc\83v\83\89\83O\83C\83\93\82Æ\82¢\82¤\83v\83\89\83O\83C\83\93\82ð\92Ç\89Á\82µ\82Ä\82¢\82Ü\82·\81Btoc\83v\83\89\83O\83C\83\93\82ð\8eg\97p\82·\82é\82Æ\8c©\8fo\82µ\94Ô\8d\86\95t\82«\82Ì\83A\83E\83g\83\89\83C\83\93\82ð\95\\8e¦\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+\r
+ {{toc}}\r
+\r
+\82Ü\82½\81Atoc\83v\83\89\83O\83C\83\93\82Í\83f\83t\83H\83\8b\83g\82Å\82Í\8c»\8dÝ\95\\8e¦\82µ\82Ä\82¢\82é\83y\81[\83W\82Ì\83A\83E\83g\83\89\83C\83\93\82ð\95\\8e¦\82µ\82Ü\82·\82ª\81A\88ø\90\94\82É\83y\81[\83W\96¼\82ð\8ew\92è\82·\82é\82±\82Æ\82Å\8ew\92è\82µ\82½\83y\81[\83W\82Ì\83A\83E\83g\83\89\83C\83\93\82ð\95\\8e¦\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\82±\82Ì\82½\82ß\88È\89º\82Ì\82æ\82¤\82È\83y\81[\83W\82ð\8dì\90¬\82µ\82Ä\82¨\82­\82±\82Æ\82Å\8f\91\90Ð\91S\91Ì\82Ì\96Ú\8e\9f\82ð\8dì\90¬\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+\r
+ !!!\96Ú\8e\9f\r
+ !!\91æ\88ê\8fÍ\r
+ {{toc Chapter1}}\r
+ !!\91æ\93ñ\8fÍ\r
+ {{toc Chapter2}}\r
+ ...\r
+\r
+outline\83v\83\89\83O\83C\83\93\82Í\83y\81[\83W\82Ì\90æ\93ª\82É\93ü\82ê\82Ä\8eg\82¤\82±\82Æ\82ª\91½\82¢\82Å\82·\82ª\81Atoc\83v\83\89\83O\83C\83\93\82ð\83T\83C\83h\83\81\83j\83\85\81[\82É\93ü\82ê\82Ä\82¨\82­\82±\82Æ\82ÅWord\82Ì\8c©\8fo\82µ\83}\83b\83v\82Ì\82æ\82¤\82È\8a´\82\82Å\8eg\82¤\82±\82Æ\82ª\82Å\82«\82é\82Í\82¸\82Å\82·\81B\r
+\r
+!!\91\8a\8cÝ\8eQ\8fÆ\r
+\r
+link\83v\83\89\83O\83C\83\93\82ð\8eg\97p\82·\82é\82Ætitle1\81`title3\83v\83\89\83O\83C\83\93\82Å\92è\8b`\82µ\82½\8c©\8fo\82µ\81A\82¨\82æ\82Ñcaption\83v\83\89\83O\83C\83\93\82Å\92è\8b`\82µ\82½\90}\95\\94Ô\8d\86\82Ö\82Ì\83\8a\83\93\83N\82ð\8fo\97Í\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+\8c©\8fo\82µ\82Ö\82Ì\83\8a\83\93\83N\82ð\8dì\90¬\82·\82é\8fê\8d\87\81Atitle1\81`title3\83v\83\89\83O\83C\83\93\82Ì\88ø\90\94\82Å\83\8a\83\93\83N\97p\82Ì\83\89\83x\83\8b\82ð\92è\8b`\82µ\82Ä\82¨\82«\81Alink\83v\83\89\83O\83C\83\93\82Å\82Í\82»\82Ì\83\89\83x\83\8b\82ð\8eQ\8fÆ\82·\82é\82æ\82¤\82É\82µ\82Ü\82·\81Blink\83v\83\89\83O\83C\83\93\82ð\8bL\8fq\82µ\82½\88Ê\92u\82É\8c©\8fo\82µ\82Ì\95\8e\9a\97ñ\82ª\8c©\8fo\82µ\94Ô\8d\86\95t\82«\82Å\83\8a\83\93\83N\82ª\8fo\97Í\82³\82ê\82Ü\82·\81B\r
+\r
+ !!!{{title1 installation}}\83C\83\93\83X\83g\81[\83\8b\r
+ ...\r
\8fÚ\8d×\82É\82Â\82¢\82Ä\82Í{{link installation}}\82ð\8eQ\8fÆ\82Ì\82±\82Æ\81B\r
+\r
+\90}\95\\82Ì\8fê\8d\87\82Ícaption\83v\83\89\83O\83C\83\93\82Ì\91æ\8eO\88ø\90\94\82É\93¯\82\82­\83\8a\83\93\83N\97p\82Ì\83\89\83x\83\8b\82ð\92è\8b`\82µ\81Alink\83v\83\89\83O\83C\83\93\82Å\82Í\82»\82Ì\83\89\83x\83\8b\82ð\8eQ\8fÆ\82µ\82Ü\82·\81Blink\83v\83\89\83O\83C\83\93\82ð\8bL\8fq\82µ\82½\88Ê\92u\82É\90}\95\\94Ô\8d\86\95t\82«\82Å\83\8a\83\93\83N\82ª\8fo\97Í\82³\82ê\82Ü\82·\81B\r
+\r
+ {{caption \95\,StringUtils\82Ì\83\81\83\\83b\83h\88ê\97\97,StringUtils_method_list}}\r
+ ...\r
+ {{link StringUtils_method_list}}\r
+\r
+\82È\82¨\81Alink\83v\83\89\83O\83C\83\93\82Í\91æ\93ñ\88ø\90\94\82É\83y\81[\83W\96¼\82ð\8ew\92è\82·\82é\82±\82Æ\82Å\81A\91¼\82Ì\83y\81[\83W\82Ì\8c©\8fo\82µ\82â\83\8a\83X\83g\82É\83W\83\83\83\93\83v\82·\82é\83\8a\83\93\83N\82ð\8fo\97Í\82·\82é\82±\82Æ\82à\89Â\94\\82Å\82·\81B\r
+\r
\83C\83\93\83X\83g\81[\83\8b\95û\96@\82É\82Â\82¢\82Ä\82Í{{link installation,Chatper1}}\82ð\8eQ\8fÆ\82Ì\82±\82Æ\81B\r
+\r
+!!\83R\83\81\83\93\83g\82Ì\8bL\8fq\r
+\r
+memo\83v\83\89\83O\83C\83\93\82ð\8eg\97p\82·\82é\82Æ\8e·\95M\92\86\82ÉTODO\83R\83\81\83\93\83g\82ð\93ü\82ê\82½\82è\81A\83\8c\83r\83\85\81[\8e\9e\82Ì\83R\83\81\83\93\83g\82ð\8bL\8fq\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\83y\81[\83W\93à\82Ì\94C\88Ó\82Ì\89Ó\8f\8a\82É\88È\89º\82Ì\82æ\82¤\82É\8bL\8fq\82µ\82Ä\82¨\82­\82Æ\81A\95\\8e¦\8e\9e\82É\82Í\83R\83\81\83\93\83g\95\94\95ª\81i\88È\89º\82Ì\97á\82Ì\8fê\8d\87\82Í\81uTODO\81F\82 \82Æ\82Å\8f\91\82­\81v\82Ì\95\94\95ª\81j\82ª\8b­\92²\82µ\82Ä\95\\8e¦\82³\82ê\82Ü\82·\81B\r
+\r
+ {{memo TODO\81F\82 \82Æ\82Å\8f\91\82­}}\r
+\r
+memolist\83v\83\89\83O\83C\83\93\82ð\8eg\97p\82·\82é\82Æ\8c»\8dÝ\82Ì\83y\81[\83W\93à\82Ìmemo\83R\83\81\83\93\83g\82ª\88ê\97\97\95\\8e¦\82³\82ê\81A\83\8a\83\93\83N\82ð\83N\83\8a\83b\83N\82·\82é\82Æ\82»\82Ì\83R\83\81\83\93\83g\82É\83W\83\83\83\93\83v\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+ !!!\83R\83\81\83\93\83g\88ê\97\97\r
+ {{memolist}}\r
+\r
+\8e·\95M\92\86\82Ímemolist\83v\83\89\83O\83C\83\93\82ð\83T\83C\83h\83\81\83j\83\85\81[\82É\93ü\82ê\82Ä\82¨\82­\82Æ\95Ö\97\98\82Á\82Û\82¢\82Å\82·\81B\r
+\r
+!!\83\8f\81[\83h\83J\83E\83\93\83g\r
+\r
+\8c´\8de\82Ì\8e·\95M\8e\9e\82Í\95\8e\9a\90\94\81A\83y\81[\83W\90\94\82ð\88Ó\8e¯\82·\82é\95K\97v\82ª\82 \82é\8fê\8d\87\82ª\82 \82è\82Ü\82·\81Bwordcount\83v\83\89\83O\83C\83\93\82Å\8c»\8dÝ\95\\8e¦\82µ\82Ä\82¢\82é\83y\81[\83W\82Ì\95\8e\9a\90\94\81Apagecount\83v\83\89\83O\83C\83\93\82Å\83y\81[\83W\90\94\81i1\83y\81[\83W2000\95\8e\9a\82Å\8cv\8eZ\81j\82ð\95\\8e¦\82·\82é\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+ *\95\8e\9a\90\94\81F{{wordcount}}\r
+ *\83y\81[\83W\90\94\81F{{pagecount}}\r
+\r
+\82±\82ê\82à\8e·\95M\92\86\82Í\83T\83C\83h\83\81\83j\83\85\81[\82É\93ü\82ê\82Ä\82¨\82­\82Æ\82æ\82¢\82Å\82µ\82å\82¤\81B\r
+\r
+!!\83R\83\89\83\80\82Ì\8bL\8fq\r
+\r
+\96{\95\82Ì\93à\97e\82Æ\82Í\8f­\82µ\8aO\82ê\82é\93à\97e\82¾\82Á\82½\82è\81A\93Á\82É\92\8d\88Ó\82ª\95K\97v\82È\93_\82È\82Ç\82ð\83R\83\89\83\80\82Æ\82µ\82Ä\8bL\8fq\82µ\82½\82¢\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B\82±\82Ì\82æ\82¤\82È\8fê\8d\87\81Acolumn\83v\83\89\83O\83C\83\93\82ð\8eg\97p\82µ\82Ü\82·\81B\r
+\r
+ {{column \83R\83\89\83\80\82Ì\83^\83C\83g\83\8b\r
\82±\82±\82É\83R\83\89\83\80\93\99\82Ì\93à\97e\82ðWiki\8c`\8e®\82Å\8bL\8fq\82·\82µ\82Ü\82·\81B\r
\83u\83\8d\83b\83N\83v\83\89\83O\83C\83\93\82È\82Ì\82Å\95¡\90\94\8ds\82Ì\8bL\8fq\82ª\89Â\94\\82Å\82·\81B\r
+ }}\r
+\r
diff --git a/takezoe/plugin/book/Title1.pm b/takezoe/plugin/book/Title1.pm
new file mode 100644 (file)
index 0000000..cef7fbd
--- /dev/null
@@ -0,0 +1,45 @@
+################################################################################
+#
+# <p>¸«½Ð¤·1¤ËÉÕÍ¿¤¹¤ë¤³¤È¤Ç¸«½Ð¤·ÈÖ¹æ¤òÉÕÍ¿¤¹¤ë¥¤¥ó¥é¥¤¥ó¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <pre>
+# !!!{{title1}}¸«½Ð¤·1
+# </pre>
+#
+################################################################################
+package plugin::book::Title1;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥¤¥ó¥é¥¤¥ó¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self   = shift;
+       my $wiki   = shift;
+       my $anchor = shift;
+       
+       my $chapter = $wiki->get_plugin_instance('plugin::book::Chapter');
+       $self->{'count'}++;
+       
+       if($anchor eq ''){
+               return $chapter->{'chapter'}.'-'.$self->{'count'}.'. ';
+       } else {
+               return '<a name="'.Util::escapeHTML($anchor).'">'.$chapter->{'chapter'}.'-'.$self->{'count'}.'. </a>';
+       }
+}
+
+#==============================================================================
+# ¥Õ¥Ã¥¯¥á¥½¥Ã¥É
+#==============================================================================
+sub hook {
+       my $self = shift;
+       $self->{'count'} = 0;
+}
+
+1;
diff --git a/takezoe/plugin/book/Title2.pm b/takezoe/plugin/book/Title2.pm
new file mode 100644 (file)
index 0000000..3d36bfa
--- /dev/null
@@ -0,0 +1,47 @@
+################################################################################
+#
+# <p>¸«½Ð¤·2¤ËÉÕÍ¿¤¹¤ë¤³¤È¤Ç¸«½Ð¤·ÈÖ¹æ¤òÉÕÍ¿¤¹¤ë¥¤¥ó¥é¥¤¥ó¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <pre>
+# !!{{title2}}¸«½Ð¤·2
+# </pre>
+#
+################################################################################
+package plugin::book::Title2;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥¤¥ó¥é¥¤¥ó¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self   = shift;
+       my $wiki   = shift;
+       my $anchor = shift;
+       
+       my $chapter = $wiki->get_plugin_instance('plugin::book::Chapter');
+       my $title1 = $wiki->get_plugin_instance('plugin::book::Title1');
+       
+       $self->{'count'}++;
+       
+       if($anchor eq ''){
+               return $chapter->{'chapter'}.'-'.$title1->{'count'}.'-'.$self->{'count'}.'. ';
+       } else {
+               return '<a name="'.Util::escapeHTML($anchor).'">'.$chapter->{'chapter'}.'-'.$title1->{'count'}.'-'.$self->{'count'}.'. </a>';
+       }
+}
+
+#==============================================================================
+# ¥Õ¥Ã¥¯¥á¥½¥Ã¥É
+#==============================================================================
+sub hook {
+       my $self = shift;
+       $self->{'count'} = 0;
+}
+
+1;
diff --git a/takezoe/plugin/book/Title3.pm b/takezoe/plugin/book/Title3.pm
new file mode 100644 (file)
index 0000000..94f1617
--- /dev/null
@@ -0,0 +1,48 @@
+################################################################################
+#
+# <p>¸«½Ð¤·3¤ËÉÕÍ¿¤¹¤ë¤³¤È¤Ç¸«½Ð¤·ÈÖ¹æ¤òÉÕÍ¿¤¹¤ë¥¤¥ó¥é¥¤¥ó¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <pre>
+# !{{title3}}¸«½Ð¤·3
+# </pre>
+#
+################################################################################
+package plugin::book::Title3;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥¤¥ó¥é¥¤¥ó¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self   = shift;
+       my $wiki   = shift;
+       my $anchor = shift;
+       
+       my $chapter = $wiki->get_plugin_instance('plugin::book::Chapter');
+       my $title1 = $wiki->get_plugin_instance('plugin::book::Title1');
+       my $title2 = $wiki->get_plugin_instance('plugin::book::Title2');
+       
+       $self->{'count'}++;
+       
+       if($anchor eq ''){
+               return $chapter->{'chapter'}.'-'.$title1->{'count'}.'-'.$title2->{'count'}.'-'.$self->{'count'}.'. ';
+       } else {
+               return '<a name="'.Util::escapeHTML($anchor).'">'.$chapter->{'chapter'}.'-'.$title1->{'count'}.'-'.$title2->{'count'}.'-'.$self->{'count'}.'. </a>';
+       }
+}
+
+#==============================================================================
+# ¥Õ¥Ã¥¯¥á¥½¥Ã¥É
+#==============================================================================
+sub hook {
+       my $self = shift;
+       $self->{'count'} = 0;
+}
+
+1;
diff --git a/takezoe/plugin/book/Toc.pm b/takezoe/plugin/book/Toc.pm
new file mode 100644 (file)
index 0000000..147b2d9
--- /dev/null
@@ -0,0 +1,43 @@
+################################################################################
+#
+# <p>book¥×¥é¥°¥¤¥ó¤Î¸«½Ð¤·ÈÖ¹æ¤ËÂбþ¤·¤¿¥Ú¡¼¥¸¤Î¥¢¥¦¥È¥é¥¤¥ó¤òɽ¼¨¤·¤Þ¤¹¡£</p>
+# <pre>
+# {{toc}}
+# </pre>
+# <p>¥Ú¡¼¥¸Ì¾¤ò»ØÄꤹ¤ë¤³¤È¤Ç¾¤Î¥Ú¡¼¥¸¤Î¥¢¥¦¥È¥é¥¤¥ó¤òɽ¼¨¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£</p>
+# <pre>
+# {{toc ¥Ú¡¼¥¸Ì¾}}
+# </pre>
+#
+################################################################################
+package plugin::book::Toc;
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥Ö¥í¥Ã¥¯¥á¥½¥Ã¥É
+#==============================================================================
+sub paragraph {
+       my $self = shift;
+       my $wiki = shift;
+       my $page = shift;
+       my $cgi  = $wiki->get_CGI;
+       my $p_cnt = 0;
+
+       $page = $cgi->param("page") unless $page;
+       
+       # ¥Ú¡¼¥¸¤Î»²¾È¸¢¸Â¤¬¤¢¤ë¤«¤É¤¦¤«Ä´¤Ù¤ë
+       unless($wiki->can_show($page)){
+               return undef;
+       }
+       my $parser = plugin::book::TocParser->new($wiki, $page);
+       return $parser->outline($wiki->get_page($page));
+}
+
+1;
diff --git a/takezoe/plugin/book/TocParser.pm b/takezoe/plugin/book/TocParser.pm
new file mode 100644 (file)
index 0000000..ee6f3d6
--- /dev/null
@@ -0,0 +1,134 @@
+###############################################################################
+#
+# book¥×¥é¥°¥¤¥ó¤ËÂбþ¤·¤¿¥¢¥¦¥È¥é¥¤¥ó¥Ñ¡¼¥µ
+#
+###############################################################################
+package plugin::book::TocParser;
+use strict;
+use vars qw(@ISA);
+use Wiki::HTMLParser;
+
+@ISA = qw(Wiki::HTMLParser);
+
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self  = Wiki::HTMLParser->new(shift);
+       my $page  = shift;
+       $self->{'outline_html'}  = "";
+       $self->{'outline_level'} =  0;
+       $self->{'outline_cnt'}   =  0;
+       $self->{'pagename'}      = $page;
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥Ø¥Ã¥É¥é¥¤¥ó¤Î¤ßÃê½Ð
+#==============================================================================
+sub l_headline {
+       my $self  = shift;
+       my $level = shift;
+       my $obj   = shift;
+       my $text  = &Util::delete_tag(join("",@$obj));
+       
+       if($level > $self->{outline_level}){
+               while($level!=$self->{outline_level}){
+                       if($self->{'outline_close_'.($self->{outline_level})} == 1){\r
+                               $self->{outline_html} .= "</li>\n";\r
+                               $self->{'outline_close_'.($self->{outline_level})} = 0;\r
+                       }
+                       $self->{outline_html} .= "<ul class=\"outline\">\n";
+                       $self->{outline_level}++;
+               }
+       } elsif($level <= $self->{outline_level}){
+               while($level-1  != $self->{outline_level}){
+                       if($self->{'outline_close_'.($self->{outline_level})} == 1){
+                               $self->{outline_html} .= "</li>\n";
+                               $self->{'outline_close_'.($self->{outline_level})} = 0;
+                       }
+                       if($level == $self->{outline_level}){
+                               last;
+                       }
+                       $self->{outline_html} .= "</ul>\n";
+                       $self->{outline_level}--;
+               }
+       } else {
+               $self->{outline_html} .= "</li>\n";
+       }
+       
+       $self->{'outline_close_'.$level} = 1;
+       $self->{outline_html} .= "<li><a href=\"?page=".Util::url_encode($self->{pagename})."#p".$self->{outline_cnt}."\">$text</a>";
+       $self->{outline_cnt}++;
+}
+
+#==============================================================================
+# ¥¢¥¦¥È¥é¥¤¥óɽ¼¨ÍÑHTML¤Î¼èÆÀ
+#==============================================================================
+sub outline {
+       my $self   = shift;
+       my $source = shift;
+       $self->parse($source);
+       
+       while($self->{outline_level} != 0){
+               if($self->{'outline_close_'.($self->{outline_level})} == 1){
+                       $self->{outline_html} .= "</li>\n";
+               }
+               $self->{outline_html} .= "</ul>\n";
+               $self->{outline_level}--;
+       }
+       
+       return $self->{outline_html};
+}
+
+#==============================================================================
+# ¥×¥é¥°¥¤¥ó¤Î²òÀϤò¹Ô¤¦¤È̵¸Â¥ë¡¼¥×¤·¤Æ¤·¤Þ¤¦¤¿¤á
+#==============================================================================
+sub plugin{
+       my $self   = shift;
+       my $plugin = shift;
+       
+       if($plugin->{'command'} eq 'title1'){
+               $self->{'title1'}++;
+               $self->{'title2'} = 0;
+               $self->{'title3'} = 0;
+               return $self->{'chapter'}.'-'.$self->{'title1'}.'. ';
+               
+       } elsif($plugin->{'command'} eq 'title2'){
+               $self->{'title2'}++;
+               $self->{'title3'} = 0;
+               return $self->{'chapter'}.'-'.$self->{'title1'}.'-'.$self->{'title2'}.'. ';
+               
+       } elsif($plugin->{'command'} eq 'title3'){
+               $self->{'title3'}++;
+               return $self->{'chapter'}.'-'.$self->{'title1'}.'-'.$self->{'title2'}.'-'.$self->{'title3'}.'. ';
+               
+       }
+       return undef;
+}
+
+#==============================================================================
+# ¥×¥é¥°¥¤¥ó¤Î²òÀϤò¹Ô¤¦¤È̵¸Â¥ë¡¼¥×¤·¤Æ¤·¤Þ¤¦¤¿¤á
+#==============================================================================
+sub l_plugin{
+       my $self   = shift;
+       my $plugin = shift;
+       
+       if($plugin->{'command'} eq 'chapter'){
+               $self->{'chapter'} = $plugin->{'args'}->[0];
+               return undef;
+       }
+       
+       # outline°Ê³°¤Î¾ì¹ç¤Î¤ß½èÍý¤ò¹Ô¤¦
+       if($plugin->{command} ne "outline"){
+               my $info = $self->{wiki}->get_plugin_info($plugin->{command});
+               if($info->{FORMAT} eq "WIKI"){
+                       return $self->SUPER::l_plugin($plugin);
+               }
+       } else {
+               return undef;
+       }
+}
+
+1;
diff --git a/takezoe/plugin/book/Wordcount.pm b/takezoe/plugin/book/Wordcount.pm
new file mode 100644 (file)
index 0000000..c74e32a
--- /dev/null
@@ -0,0 +1,38 @@
+################################################################################
+#
+# <p>¸½ºßɽ¼¨¤·¤Æ¤¤¤ë¥Ú¡¼¥¸¤Îʸ»ú¿ô¤òɽ¼¨¤¹¤ë¥¤¥ó¥é¥¤¥ó¥×¥é¥°¥¤¥ó¤Ç¤¹¡£</p>
+# <pre>
+# Ê¸»ú¿ô¡§{{wordcount}}
+# </pre>
+# <p>°ú¿ô¤Ç¥«¥¦¥ó¥ÈÂоݤΥڡ¼¥¸¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£</p>
+# <pre>
+# Ê¸»ú¿ô¡§{{wordcount ¥Ú¡¼¥¸Ì¾}}
+# </pre>
+#
+################################################################################
+package plugin::book::Wordcount;
+use Encode qw(decode);
+#==============================================================================
+# ¥³¥ó¥¹¥È¥é¥¯¥¿
+#==============================================================================
+sub new {
+       my $class = shift;
+       my $self = {};
+       return bless $self,$class;
+}
+
+#==============================================================================
+# ¥¤¥ó¥é¥¤¥ó¥á¥½¥Ã¥É
+#==============================================================================
+sub inline {
+       my $self = shift;
+       my $wiki = shift;
+       my $page = shift;
+       
+       $page = $wiki->get_CGI->param('page') unless $page;
+       my $source = Jcode::convert($wiki->get_page($page), 'utf8', 'euc');
+       
+       return length(decode('utf-8', $source));
+}
+
+1;
diff --git a/takezoe/plugin/book/google-code-prettify/lang-apollo.js b/takezoe/plugin/book/google-code-prettify/lang-apollo.js
new file mode 100644 (file)
index 0000000..7098baf
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
+null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-clj.js b/takezoe/plugin/book/google-code-prettify/lang-clj.js
new file mode 100644 (file)
index 0000000..542a220
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ Copyright (C) 2011 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+var a=null;
+PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a],
+["typ",/^:[\dA-Za-z-]+/]]),["clj"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-css.js b/takezoe/plugin/book/google-code-prettify/lang-css.js
new file mode 100644 (file)
index 0000000..041e1f5
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\f"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
+/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-go.js b/takezoe/plugin/book/google-code-prettify/lang-go.js
new file mode 100644 (file)
index 0000000..fc18dc0
--- /dev/null
@@ -0,0 +1 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-hs.js b/takezoe/plugin/book/google-code-prettify/lang-hs.js
new file mode 100644 (file)
index 0000000..9d77b08
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\v\f\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/,
+null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-lisp.js b/takezoe/plugin/book/google-code-prettify/lang-lisp.js
new file mode 100644 (file)
index 0000000..02a30e8
--- /dev/null
@@ -0,0 +1,3 @@
+var a=null;
+PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \xa0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a],
+["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","scm"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-lua.js b/takezoe/plugin/book/google-code-prettify/lang-lua.js
new file mode 100644 (file)
index 0000000..e83a3c4
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],
+["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-ml.js b/takezoe/plugin/book/google-code-prettify/lang-ml.js
new file mode 100644 (file)
index 0000000..6df02d7
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
+["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-n.js b/takezoe/plugin/book/google-code-prettify/lang-n.js
new file mode 100644 (file)
index 0000000..6c2e85b
--- /dev/null
@@ -0,0 +1,4 @@
+var a=null;
+PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\xa0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/,
+a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/,
+a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-proto.js b/takezoe/plugin/book/google-code-prettify/lang-proto.js
new file mode 100644 (file)
index 0000000..f006ad8
--- /dev/null
@@ -0,0 +1 @@
+PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-scala.js b/takezoe/plugin/book/google-code-prettify/lang-scala.js
new file mode 100644 (file)
index 0000000..60d034d
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/],
+["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-sql.js b/takezoe/plugin/book/google-code-prettify/lang-sql.js
new file mode 100644 (file)
index 0000000..da705b0
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|merge|national|nocheck|nonclustered|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|percent|plan|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rule|save|schema|select|session_user|set|setuser|shutdown|some|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|union|unique|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|writetext)(?=[^\w-]|$)/i,
+null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-tex.js b/takezoe/plugin/book/google-code-prettify/lang-tex.js
new file mode 100644 (file)
index 0000000..ce96fbb
--- /dev/null
@@ -0,0 +1 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-vb.js b/takezoe/plugin/book/google-code-prettify/lang-vb.js
new file mode 100644 (file)
index 0000000..07506b0
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r Â\xa0â\80¨â\80©"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"â\80\9câ\80\9d'],["com",/^['\u2018\u2019].*/,null,"'â\80\98â\80\99"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i,
+null],["com",/^rem.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-vhdl.js b/takezoe/plugin/book/google-code-prettify/lang-vhdl.js
new file mode 100644 (file)
index 0000000..128b5b6
--- /dev/null
@@ -0,0 +1,3 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i,
+null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i],
+["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-wiki.js b/takezoe/plugin/book/google-code-prettify/lang-wiki.js
new file mode 100644 (file)
index 0000000..9b0b448
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t Â\xa0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]);
+PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-xq.js b/takezoe/plugin/book/google-code-prettify/lang-xq.js
new file mode 100644 (file)
index 0000000..e323ae3
--- /dev/null
@@ -0,0 +1,3 @@
+PR.registerLangHandler(PR.createSimpleLexer([["var pln",/^\$[\w-]+/,null,"$"]],[["pln",/^[\s=][<>][\s=]/],["lit",/^@[\w-]+/],["tag",/^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["com",/^\(:[\S\s]*?:\)/],["pln",/^[(),/;[\]{}]$/],["str",/^(?:"(?:[^"\\{]|\\[\S\s])*(?:"|$)|'(?:[^'\\{]|\\[\S\s])*(?:'|$))/,null,"\"'"],["kwd",/^(?:xquery|where|version|variable|union|typeswitch|treat|to|then|text|stable|sortby|some|self|schema|satisfies|returns|return|ref|processing-instruction|preceding-sibling|preceding|precedes|parent|only|of|node|namespace|module|let|item|intersect|instance|in|import|if|function|for|follows|following-sibling|following|external|except|every|else|element|descending|descendant-or-self|descendant|define|default|declare|comment|child|cast|case|before|attribute|assert|ascending|as|ancestor-or-self|ancestor|after|eq|order|by|or|and|schema-element|document-node|node|at)\b/],
+["typ",/^(?:xs:yearMonthDuration|xs:unsignedLong|xs:time|xs:string|xs:short|xs:QName|xs:Name|xs:long|xs:integer|xs:int|xs:gYearMonth|xs:gYear|xs:gMonthDay|xs:gDay|xs:float|xs:duration|xs:double|xs:decimal|xs:dayTimeDuration|xs:dateTime|xs:date|xs:byte|xs:boolean|xs:anyURI|xf:yearMonthDuration)\b/,null],["fun pln",/^(?:xp:dereference|xinc:node-expand|xinc:link-references|xinc:link-expand|xhtml:restructure|xhtml:clean|xhtml:add-lists|xdmp:zip-manifest|xdmp:zip-get|xdmp:zip-create|xdmp:xquery-version|xdmp:word-convert|xdmp:with-namespaces|xdmp:version|xdmp:value|xdmp:user-roles|xdmp:user-last-login|xdmp:user|xdmp:url-encode|xdmp:url-decode|xdmp:uri-is-file|xdmp:uri-format|xdmp:uri-content-type|xdmp:unquote|xdmp:unpath|xdmp:triggers-database|xdmp:trace|xdmp:to-json|xdmp:tidy|xdmp:subbinary|xdmp:strftime|xdmp:spawn-in|xdmp:spawn|xdmp:sleep|xdmp:shutdown|xdmp:set-session-field|xdmp:set-response-encoding|xdmp:set-response-content-type|xdmp:set-response-code|xdmp:set-request-time-limit|xdmp:set|xdmp:servers|xdmp:server-status|xdmp:server-name|xdmp:server|xdmp:security-database|xdmp:security-assert|xdmp:schema-database|xdmp:save|xdmp:role-roles|xdmp:role|xdmp:rethrow|xdmp:restart|xdmp:request-timestamp|xdmp:request-status|xdmp:request-cancel|xdmp:request|xdmp:redirect-response|xdmp:random|xdmp:quote|xdmp:query-trace|xdmp:query-meters|xdmp:product-edition|xdmp:privilege-roles|xdmp:privilege|xdmp:pretty-print|xdmp:powerpoint-convert|xdmp:platform|xdmp:permission|xdmp:pdf-convert|xdmp:path|xdmp:octal-to-integer|xdmp:node-uri|xdmp:node-replace|xdmp:node-kind|xdmp:node-insert-child|xdmp:node-insert-before|xdmp:node-insert-after|xdmp:node-delete|xdmp:node-database|xdmp:mul64|xdmp:modules-root|xdmp:modules-database|xdmp:merging|xdmp:merge-cancel|xdmp:merge|xdmp:md5|xdmp:logout|xdmp:login|xdmp:log-level|xdmp:log|xdmp:lock-release|xdmp:lock-acquire|xdmp:load|xdmp:invoke-in|xdmp:invoke|xdmp:integer-to-octal|xdmp:integer-to-hex|xdmp:http-put|xdmp:http-post|xdmp:http-options|xdmp:http-head|xdmp:http-get|xdmp:http-delete|xdmp:hosts|xdmp:host-status|xdmp:host-name|xdmp:host|xdmp:hex-to-integer|xdmp:hash64|xdmp:hash32|xdmp:has-privilege|xdmp:groups|xdmp:group-serves|xdmp:group-servers|xdmp:group-name|xdmp:group-hosts|xdmp:group|xdmp:get-session-field-names|xdmp:get-session-field|xdmp:get-response-encoding|xdmp:get-response-code|xdmp:get-request-username|xdmp:get-request-user|xdmp:get-request-url|xdmp:get-request-protocol|xdmp:get-request-path|xdmp:get-request-method|xdmp:get-request-header-names|xdmp:get-request-header|xdmp:get-request-field-names|xdmp:get-request-field-filename|xdmp:get-request-field-content-type|xdmp:get-request-field|xdmp:get-request-client-certificate|xdmp:get-request-client-address|xdmp:get-request-body|xdmp:get-current-user|xdmp:get-current-roles|xdmp:get|xdmp:function-name|xdmp:function-module|xdmp:function|xdmp:from-json|xdmp:forests|xdmp:forest-status|xdmp:forest-restore|xdmp:forest-restart|xdmp:forest-name|xdmp:forest-delete|xdmp:forest-databases|xdmp:forest-counts|xdmp:forest-clear|xdmp:forest-backup|xdmp:forest|xdmp:filesystem-file|xdmp:filesystem-directory|xdmp:exists|xdmp:excel-convert|xdmp:eval-in|xdmp:eval|xdmp:estimate|xdmp:email|xdmp:element-content-type|xdmp:elapsed-time|xdmp:document-set-quality|xdmp:document-set-property|xdmp:document-set-properties|xdmp:document-set-permissions|xdmp:document-set-collections|xdmp:document-remove-properties|xdmp:document-remove-permissions|xdmp:document-remove-collections|xdmp:document-properties|xdmp:document-locks|xdmp:document-load|xdmp:document-insert|xdmp:document-get-quality|xdmp:document-get-properties|xdmp:document-get-permissions|xdmp:document-get-collections|xdmp:document-get|xdmp:document-forest|xdmp:document-delete|xdmp:document-add-properties|xdmp:document-add-permissions|xdmp:document-add-collections|xdmp:directory-properties|xdmp:directory-locks|xdmp:directory-delete|xdmp:directory-create|xdmp:directory|xdmp:diacritic-less|xdmp:describe|xdmp:default-permissions|xdmp:default-collections|xdmp:databases|xdmp:database-restore-validate|xdmp:database-restore-status|xdmp:database-restore-cancel|xdmp:database-restore|xdmp:database-name|xdmp:database-forests|xdmp:database-backup-validate|xdmp:database-backup-status|xdmp:database-backup-purge|xdmp:database-backup-cancel|xdmp:database-backup|xdmp:database|xdmp:collection-properties|xdmp:collection-locks|xdmp:collection-delete|xdmp:collation-canonical-uri|xdmp:castable-as|xdmp:can-grant-roles|xdmp:base64-encode|xdmp:base64-decode|xdmp:architecture|xdmp:apply|xdmp:amp-roles|xdmp:amp|xdmp:add64|xdmp:add-response-header|xdmp:access|trgr:trigger-set-recursive|trgr:trigger-set-permissions|trgr:trigger-set-name|trgr:trigger-set-module|trgr:trigger-set-event|trgr:trigger-set-description|trgr:trigger-remove-permissions|trgr:trigger-module|trgr:trigger-get-permissions|trgr:trigger-enable|trgr:trigger-disable|trgr:trigger-database-online-event|trgr:trigger-data-event|trgr:trigger-add-permissions|trgr:remove-trigger|trgr:property-content|trgr:pre-commit|trgr:post-commit|trgr:get-trigger-by-id|trgr:get-trigger|trgr:document-scope|trgr:document-content|trgr:directory-scope|trgr:create-trigger|trgr:collection-scope|trgr:any-property-content|thsr:set-entry|thsr:remove-term|thsr:remove-synonym|thsr:remove-entry|thsr:query-lookup|thsr:lookup|thsr:load|thsr:insert|thsr:expand|thsr:add-synonym|spell:suggest-detailed|spell:suggest|spell:remove-word|spell:make-dictionary|spell:load|spell:levenshtein-distance|spell:is-correct|spell:insert|spell:double-metaphone|spell:add-word|sec:users-collection|sec:user-set-roles|sec:user-set-password|sec:user-set-name|sec:user-set-description|sec:user-set-default-permissions|sec:user-set-default-collections|sec:user-remove-roles|sec:user-privileges|sec:user-get-roles|sec:user-get-description|sec:user-get-default-permissions|sec:user-get-default-collections|sec:user-doc-permissions|sec:user-doc-collections|sec:user-add-roles|sec:unprotect-collection|sec:uid-for-name|sec:set-realm|sec:security-version|sec:security-namespace|sec:security-installed|sec:security-collection|sec:roles-collection|sec:role-set-roles|sec:role-set-name|sec:role-set-description|sec:role-set-default-permissions|sec:role-set-default-collections|sec:role-remove-roles|sec:role-privileges|sec:role-get-roles|sec:role-get-description|sec:role-get-default-permissions|sec:role-get-default-collections|sec:role-doc-permissions|sec:role-doc-collections|sec:role-add-roles|sec:remove-user|sec:remove-role-from-users|sec:remove-role-from-role|sec:remove-role-from-privileges|sec:remove-role-from-amps|sec:remove-role|sec:remove-privilege|sec:remove-amp|sec:protect-collection|sec:privileges-collection|sec:privilege-set-roles|sec:privilege-set-name|sec:privilege-remove-roles|sec:privilege-get-roles|sec:privilege-add-roles|sec:priv-doc-permissions|sec:priv-doc-collections|sec:get-user-names|sec:get-unique-elem-id|sec:get-role-names|sec:get-role-ids|sec:get-privilege|sec:get-distinct-permissions|sec:get-collection|sec:get-amp|sec:create-user-with-role|sec:create-user|sec:create-role|sec:create-privilege|sec:create-amp|sec:collections-collection|sec:collection-set-permissions|sec:collection-remove-permissions|sec:collection-get-permissions|sec:collection-add-permissions|sec:check-admin|sec:amps-collection|sec:amp-set-roles|sec:amp-remove-roles|sec:amp-get-roles|sec:amp-doc-permissions|sec:amp-doc-collections|sec:amp-add-roles|search:unparse|search:suggest|search:snippet|search:search|search:resolve-nodes|search:resolve|search:remove-constraint|search:parse|search:get-default-options|search:estimate|search:check-options|prof:value|prof:reset|prof:report|prof:invoke|prof:eval|prof:enable|prof:disable|prof:allowed|ppt:clean|pki:template-set-request|pki:template-set-name|pki:template-set-key-type|pki:template-set-key-options|pki:template-set-description|pki:template-in-use|pki:template-get-version|pki:template-get-request|pki:template-get-name|pki:template-get-key-type|pki:template-get-key-options|pki:template-get-id|pki:template-get-description|pki:need-certificate|pki:is-temporary|pki:insert-trusted-certificates|pki:insert-template|pki:insert-signed-certificates|pki:insert-certificate-revocation-list|pki:get-trusted-certificate-ids|pki:get-template-ids|pki:get-template-certificate-authority|pki:get-template-by-name|pki:get-template|pki:get-pending-certificate-requests-xml|pki:get-pending-certificate-requests-pem|pki:get-pending-certificate-request|pki:get-certificates-for-template-xml|pki:get-certificates-for-template|pki:get-certificates|pki:get-certificate-xml|pki:get-certificate-pem|pki:get-certificate|pki:generate-temporary-certificate-if-necessary|pki:generate-temporary-certificate|pki:generate-template-certificate-authority|pki:generate-certificate-request|pki:delete-template|pki:delete-certificate|pki:create-template|pdf:make-toc|pdf:insert-toc-headers|pdf:get-toc|pdf:clean|p:status-transition|p:state-transition|p:remove|p:pipelines|p:insert|p:get-by-id|p:get|p:execute|p:create|p:condition|p:collection|p:action|ooxml:runs-merge|ooxml:package-uris|ooxml:package-parts-insert|ooxml:package-parts|msword:clean|mcgm:polygon|mcgm:point|mcgm:geospatial-query-from-elements|mcgm:geospatial-query|mcgm:circle|math:tanh|math:tan|math:sqrt|math:sinh|math:sin|math:pow|math:modf|math:log10|math:log|math:ldexp|math:frexp|math:fmod|math:floor|math:fabs|math:exp|math:cosh|math:cos|math:ceil|math:atan2|math:atan|math:asin|math:acos|map:put|map:map|map:keys|map:get|map:delete|map:count|map:clear|lnk:to|lnk:remove|lnk:insert|lnk:get|lnk:from|lnk:create|kml:polygon|kml:point|kml:interior-polygon|kml:geospatial-query-from-elements|kml:geospatial-query|kml:circle|kml:box|gml:polygon|gml:point|gml:interior-polygon|gml:geospatial-query-from-elements|gml:geospatial-query|gml:circle|gml:box|georss:point|georss:geospatial-query|georss:circle|geo:polygon|geo:point|geo:interior-polygon|geo:geospatial-query-from-elements|geo:geospatial-query|geo:circle|geo:box|fn:zero-or-one|fn:years-from-duration|fn:year-from-dateTime|fn:year-from-date|fn:upper-case|fn:unordered|fn:true|fn:translate|fn:trace|fn:tokenize|fn:timezone-from-time|fn:timezone-from-dateTime|fn:timezone-from-date|fn:sum|fn:subtract-dateTimes-yielding-yearMonthDuration|fn:subtract-dateTimes-yielding-dayTimeDuration|fn:substring-before|fn:substring-after|fn:substring|fn:subsequence|fn:string-to-codepoints|fn:string-pad|fn:string-length|fn:string-join|fn:string|fn:static-base-uri|fn:starts-with|fn:seconds-from-time|fn:seconds-from-duration|fn:seconds-from-dateTime|fn:round-half-to-even|fn:round|fn:root|fn:reverse|fn:resolve-uri|fn:resolve-QName|fn:replace|fn:remove|fn:QName|fn:prefix-from-QName|fn:position|fn:one-or-more|fn:number|fn:not|fn:normalize-unicode|fn:normalize-space|fn:node-name|fn:node-kind|fn:nilled|fn:namespace-uri-from-QName|fn:namespace-uri-for-prefix|fn:namespace-uri|fn:name|fn:months-from-duration|fn:month-from-dateTime|fn:month-from-date|fn:minutes-from-time|fn:minutes-from-duration|fn:minutes-from-dateTime|fn:min|fn:max|fn:matches|fn:lower-case|fn:local-name-from-QName|fn:local-name|fn:last|fn:lang|fn:iri-to-uri|fn:insert-before|fn:index-of|fn:in-scope-prefixes|fn:implicit-timezone|fn:idref|fn:id|fn:hours-from-time|fn:hours-from-duration|fn:hours-from-dateTime|fn:floor|fn:false|fn:expanded-QName|fn:exists|fn:exactly-one|fn:escape-uri|fn:escape-html-uri|fn:error|fn:ends-with|fn:encode-for-uri|fn:empty|fn:document-uri|fn:doc-available|fn:doc|fn:distinct-values|fn:distinct-nodes|fn:default-collation|fn:deep-equal|fn:days-from-duration|fn:day-from-dateTime|fn:day-from-date|fn:data|fn:current-time|fn:current-dateTime|fn:current-date|fn:count|fn:contains|fn:concat|fn:compare|fn:collection|fn:codepoints-to-string|fn:codepoint-equal|fn:ceiling|fn:boolean|fn:base-uri|fn:avg|fn:adjust-time-to-timezone|fn:adjust-dateTime-to-timezone|fn:adjust-date-to-timezone|fn:abs|feed:unsubscribe|feed:subscription|feed:subscribe|feed:request|feed:item|feed:description|excel:clean|entity:enrich|dom:set-pipelines|dom:set-permissions|dom:set-name|dom:set-evaluation-context|dom:set-domain-scope|dom:set-description|dom:remove-pipeline|dom:remove-permissions|dom:remove|dom:get|dom:evaluation-context|dom:domains|dom:domain-scope|dom:create|dom:configuration-set-restart-user|dom:configuration-set-permissions|dom:configuration-set-evaluation-context|dom:configuration-set-default-domain|dom:configuration-get|dom:configuration-create|dom:collection|dom:add-pipeline|dom:add-permissions|dls:retention-rules|dls:retention-rule-remove|dls:retention-rule-insert|dls:retention-rule|dls:purge|dls:node-expand|dls:link-references|dls:link-expand|dls:documents-query|dls:document-versions-query|dls:document-version-uri|dls:document-version-query|dls:document-version-delete|dls:document-version-as-of|dls:document-version|dls:document-update|dls:document-unmanage|dls:document-set-quality|dls:document-set-property|dls:document-set-properties|dls:document-set-permissions|dls:document-set-collections|dls:document-retention-rules|dls:document-remove-properties|dls:document-remove-permissions|dls:document-remove-collections|dls:document-purge|dls:document-manage|dls:document-is-managed|dls:document-insert-and-manage|dls:document-include-query|dls:document-history|dls:document-get-permissions|dls:document-extract-part|dls:document-delete|dls:document-checkout-status|dls:document-checkout|dls:document-checkin|dls:document-add-properties|dls:document-add-permissions|dls:document-add-collections|dls:break-checkout|dls:author-query|dls:as-of-query|dbk:convert|dbg:wait|dbg:value|dbg:stopped|dbg:stop|dbg:step|dbg:status|dbg:stack|dbg:out|dbg:next|dbg:line|dbg:invoke|dbg:function|dbg:finish|dbg:expr|dbg:eval|dbg:disconnect|dbg:detach|dbg:continue|dbg:connect|dbg:clear|dbg:breakpoints|dbg:break|dbg:attached|dbg:attach|cvt:save-converted-documents|cvt:part-uri|cvt:destination-uri|cvt:basepath|cvt:basename|cts:words|cts:word-query-weight|cts:word-query-text|cts:word-query-options|cts:word-query|cts:word-match|cts:walk|cts:uris|cts:uri-match|cts:train|cts:tokenize|cts:thresholds|cts:stem|cts:similar-query-weight|cts:similar-query-nodes|cts:similar-query|cts:shortest-distance|cts:search|cts:score|cts:reverse-query-weight|cts:reverse-query-nodes|cts:reverse-query|cts:remainder|cts:registered-query-weight|cts:registered-query-options|cts:registered-query-ids|cts:registered-query|cts:register|cts:query|cts:quality|cts:properties-query-query|cts:properties-query|cts:polygon-vertices|cts:polygon|cts:point-longitude|cts:point-latitude|cts:point|cts:or-query-queries|cts:or-query|cts:not-query-weight|cts:not-query-query|cts:not-query|cts:near-query-weight|cts:near-query-queries|cts:near-query-options|cts:near-query-distance|cts:near-query|cts:highlight|cts:geospatial-co-occurrences|cts:frequency|cts:fitness|cts:field-words|cts:field-word-query-weight|cts:field-word-query-text|cts:field-word-query-options|cts:field-word-query-field-name|cts:field-word-query|cts:field-word-match|cts:entity-highlight|cts:element-words|cts:element-word-query-weight|cts:element-word-query-text|cts:element-word-query-options|cts:element-word-query-element-name|cts:element-word-query|cts:element-word-match|cts:element-values|cts:element-value-ranges|cts:element-value-query-weight|cts:element-value-query-text|cts:element-value-query-options|cts:element-value-query-element-name|cts:element-value-query|cts:element-value-match|cts:element-value-geospatial-co-occurrences|cts:element-value-co-occurrences|cts:element-range-query-weight|cts:element-range-query-value|cts:element-range-query-options|cts:element-range-query-operator|cts:element-range-query-element-name|cts:element-range-query|cts:element-query-query|cts:element-query-element-name|cts:element-query|cts:element-pair-geospatial-values|cts:element-pair-geospatial-value-match|cts:element-pair-geospatial-query-weight|cts:element-pair-geospatial-query-region|cts:element-pair-geospatial-query-options|cts:element-pair-geospatial-query-longitude-name|cts:element-pair-geospatial-query-latitude-name|cts:element-pair-geospatial-query-element-name|cts:element-pair-geospatial-query|cts:element-pair-geospatial-boxes|cts:element-geospatial-values|cts:element-geospatial-value-match|cts:element-geospatial-query-weight|cts:element-geospatial-query-region|cts:element-geospatial-query-options|cts:element-geospatial-query-element-name|cts:element-geospatial-query|cts:element-geospatial-boxes|cts:element-child-geospatial-values|cts:element-child-geospatial-value-match|cts:element-child-geospatial-query-weight|cts:element-child-geospatial-query-region|cts:element-child-geospatial-query-options|cts:element-child-geospatial-query-element-name|cts:element-child-geospatial-query-child-name|cts:element-child-geospatial-query|cts:element-child-geospatial-boxes|cts:element-attribute-words|cts:element-attribute-word-query-weight|cts:element-attribute-word-query-text|cts:element-attribute-word-query-options|cts:element-attribute-word-query-element-name|cts:element-attribute-word-query-attribute-name|cts:element-attribute-word-query|cts:element-attribute-word-match|cts:element-attribute-values|cts:element-attribute-value-ranges|cts:element-attribute-value-query-weight|cts:element-attribute-value-query-text|cts:element-attribute-value-query-options|cts:element-attribute-value-query-element-name|cts:element-attribute-value-query-attribute-name|cts:element-attribute-value-query|cts:element-attribute-value-match|cts:element-attribute-value-geospatial-co-occurrences|cts:element-attribute-value-co-occurrences|cts:element-attribute-range-query-weight|cts:element-attribute-range-query-value|cts:element-attribute-range-query-options|cts:element-attribute-range-query-operator|cts:element-attribute-range-query-element-name|cts:element-attribute-range-query-attribute-name|cts:element-attribute-range-query|cts:element-attribute-pair-geospatial-values|cts:element-attribute-pair-geospatial-value-match|cts:element-attribute-pair-geospatial-query-weight|cts:element-attribute-pair-geospatial-query-region|cts:element-attribute-pair-geospatial-query-options|cts:element-attribute-pair-geospatial-query-longitude-name|cts:element-attribute-pair-geospatial-query-latitude-name|cts:element-attribute-pair-geospatial-query-element-name|cts:element-attribute-pair-geospatial-query|cts:element-attribute-pair-geospatial-boxes|cts:document-query-uris|cts:document-query|cts:distance|cts:directory-query-uris|cts:directory-query-depth|cts:directory-query|cts:destination|cts:deregister|cts:contains|cts:confidence|cts:collections|cts:collection-query-uris|cts:collection-query|cts:collection-match|cts:classify|cts:circle-radius|cts:circle-center|cts:circle|cts:box-west|cts:box-south|cts:box-north|cts:box-east|cts:box|cts:bearing|cts:arc-intersection|cts:and-query-queries|cts:and-query-options|cts:and-query|cts:and-not-query-positive-query|cts:and-not-query-negative-query|cts:and-not-query|css:get|css:convert|cpf:success|cpf:failure|cpf:document-set-state|cpf:document-set-processing-status|cpf:document-set-last-updated|cpf:document-set-error|cpf:document-get-state|cpf:document-get-processing-status|cpf:document-get-last-updated|cpf:document-get-error|cpf:check-transition|alert:spawn-matching-actions|alert:rule-user-id-query|alert:rule-set-user-id|alert:rule-set-query|alert:rule-set-options|alert:rule-set-name|alert:rule-set-description|alert:rule-set-action|alert:rule-remove|alert:rule-name-query|alert:rule-insert|alert:rule-id-query|alert:rule-get-user-id|alert:rule-get-query|alert:rule-get-options|alert:rule-get-name|alert:rule-get-id|alert:rule-get-description|alert:rule-get-action|alert:rule-action-query|alert:remove-triggers|alert:make-rule|alert:make-log-action|alert:make-config|alert:make-action|alert:invoke-matching-actions|alert:get-my-rules|alert:get-all-rules|alert:get-actions|alert:find-matching-rules|alert:create-triggers|alert:config-set-uri|alert:config-set-trigger-ids|alert:config-set-options|alert:config-set-name|alert:config-set-description|alert:config-set-cpf-domain-names|alert:config-set-cpf-domain-ids|alert:config-insert|alert:config-get-uri|alert:config-get-trigger-ids|alert:config-get-options|alert:config-get-name|alert:config-get-id|alert:config-get-description|alert:config-get-cpf-domain-names|alert:config-get-cpf-domain-ids|alert:config-get|alert:config-delete|alert:action-set-options|alert:action-set-name|alert:action-set-module-root|alert:action-set-module-db|alert:action-set-module|alert:action-set-description|alert:action-remove|alert:action-insert|alert:action-get-options|alert:action-get-name|alert:action-get-module-root|alert:action-get-module-db|alert:action-get-module|alert:action-get-description|zero-or-one|years-from-duration|year-from-dateTime|year-from-date|upper-case|unordered|true|translate|trace|tokenize|timezone-from-time|timezone-from-dateTime|timezone-from-date|sum|subtract-dateTimes-yielding-yearMonthDuration|subtract-dateTimes-yielding-dayTimeDuration|substring-before|substring-after|substring|subsequence|string-to-codepoints|string-pad|string-length|string-join|string|static-base-uri|starts-with|seconds-from-time|seconds-from-duration|seconds-from-dateTime|round-half-to-even|round|root|reverse|resolve-uri|resolve-QName|replace|remove|QName|prefix-from-QName|position|one-or-more|number|not|normalize-unicode|normalize-space|node-name|node-kind|nilled|namespace-uri-from-QName|namespace-uri-for-prefix|namespace-uri|name|months-from-duration|month-from-dateTime|month-from-date|minutes-from-time|minutes-from-duration|minutes-from-dateTime|min|max|matches|lower-case|local-name-from-QName|local-name|last|lang|iri-to-uri|insert-before|index-of|in-scope-prefixes|implicit-timezone|idref|id|hours-from-time|hours-from-duration|hours-from-dateTime|floor|false|expanded-QName|exists|exactly-one|escape-uri|escape-html-uri|error|ends-with|encode-for-uri|empty|document-uri|doc-available|doc|distinct-values|distinct-nodes|default-collation|deep-equal|days-from-duration|day-from-dateTime|day-from-date|data|current-time|current-dateTime|current-date|count|contains|concat|compare|collection|codepoints-to-string|codepoint-equal|ceiling|boolean|base-uri|avg|adjust-time-to-timezone|adjust-dateTime-to-timezone|adjust-date-to-timezone|abs)\b/],
+["pln",/^[\w:-]+/],["pln",/^[\t\n\r \xa0]+/]]),["xq","xquery"]);
diff --git a/takezoe/plugin/book/google-code-prettify/lang-yaml.js b/takezoe/plugin/book/google-code-prettify/lang-yaml.js
new file mode 100644 (file)
index 0000000..c38729b
--- /dev/null
@@ -0,0 +1,2 @@
+var a=null;
+PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]);
diff --git a/takezoe/plugin/book/google-code-prettify/prettify.css b/takezoe/plugin/book/google-code-prettify/prettify.css
new file mode 100644 (file)
index 0000000..d44b3a2
--- /dev/null
@@ -0,0 +1 @@
+.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
\ No newline at end of file
diff --git a/takezoe/plugin/book/google-code-prettify/prettify.js b/takezoe/plugin/book/google-code-prettify/prettify.js
new file mode 100644 (file)
index 0000000..eef5ad7
--- /dev/null
@@ -0,0 +1,28 @@
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
+f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
+(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
+{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
+t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
+"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
+l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
+m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
+a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
+j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
+250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
+PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
diff --git a/takezoe/plugin/book/google-code-prettify/sons-of-obsidian.css b/takezoe/plugin/book/google-code-prettify/sons-of-obsidian.css
new file mode 100644 (file)
index 0000000..6eb4135
--- /dev/null
@@ -0,0 +1,117 @@
+/*\r
+ * Derived from einaros's Sons of Obsidian theme at\r
+ * http://studiostyl.es/schemes/son-of-obsidian by\r
+ * Alex Ford of CodeTunnel:\r
+ * http://CodeTunnel.com/blog/post/71/google-code-prettify-obsidian-theme\r
+ */\r
+\r
+.str\r
+{\r
+    color: #EC7600;\r
+}\r
+.kwd\r
+{\r
+    color: #93C763;\r
+}\r
+.com\r
+{\r
+    color: #66747B;\r
+}\r
+.typ\r
+{\r
+    color: #678CB1;\r
+}\r
+.lit\r
+{\r
+    color: #FACD22;\r
+}\r
+.pun\r
+{\r
+    color: #F1F2F3;\r
+}\r
+.pln\r
+{\r
+    color: #F1F2F3;\r
+}\r
+.tag\r
+{\r
+    color: #8AC763;\r
+}\r
+.atn\r
+{\r
+    color: #E0E2E4;\r
+}\r
+.atv\r
+{\r
+    color: #EC7600;\r
+}\r
+.dec\r
+{\r
+    color: purple;\r
+}\r
+pre.prettyprint\r
+{\r
+    border: 0px solid #888;\r
+}\r
+ol.linenums\r
+{\r
+    margin-top: 0;\r
+    margin-bottom: 0;\r
+}\r
+.prettyprint {\r
+    background: #000;\r
+}\r
+li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9\r
+{\r
+    color: #555;\r
+}\r
+li.L1, li.L3, li.L5, li.L7, li.L9 {\r
+    background: #111;\r
+}\r
+@media print\r
+{\r
+    .str\r
+    {\r
+        color: #060;\r
+    }\r
+    .kwd\r
+    {\r
+        color: #006;\r
+        font-weight: bold;\r
+    }\r
+    .com\r
+    {\r
+        color: #600;\r
+        font-style: italic;\r
+    }\r
+    .typ\r
+    {\r
+        color: #404;\r
+        font-weight: bold;\r
+    }\r
+    .lit\r
+    {\r
+        color: #044;\r
+    }\r
+    .pun\r
+    {\r
+        color: #440;\r
+    }\r
+    .pln\r
+    {\r
+        color: #000;\r
+    }\r
+    .tag\r
+    {\r
+        color: #006;\r
+        font-weight: bold;\r
+    }\r
+    .atn\r
+    {\r
+        color: #404;\r
+    }\r
+    .atv\r
+    {\r
+        color: #060;\r
+    }\r
+}\r
diff --git a/takezoe/plugin/book/google-code-prettify/sunburst.css b/takezoe/plugin/book/google-code-prettify/sunburst.css
new file mode 100644 (file)
index 0000000..011d33e
--- /dev/null
@@ -0,0 +1,51 @@
+/* Pretty printing styles. Used with prettify.js. */
+/* Vim sunburst theme by David Leibovic */
+
+pre .str, code .str { color: #65B042; } /* string  - green */
+pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */
+pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */
+pre .typ, code .typ { color: #89bdff; } /* type - light blue */
+pre .lit, code .lit { color: #3387CC; } /* literal - blue */
+pre .pun, code .pun { color: #fff; } /* punctuation - white */
+pre .pln, code .pln { color: #fff; } /* plaintext - white */
+pre .tag, code .tag { color: #89bdff; } /* html/xml tag    - light blue */
+pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name  - khaki */
+pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */
+pre .dec, code .dec { color: #3387CC; } /* decimal - blue */
+
+pre.prettyprint, code.prettyprint {
+       background-color: #000;
+       -moz-border-radius: 8px;
+       -webkit-border-radius: 8px;
+       -o-border-radius: 8px;
+       -ms-border-radius: 8px;
+       -khtml-border-radius: 8px;
+       border-radius: 8px;
+}
+
+pre.prettyprint {
+       width: 95%;
+       margin: 1em auto;
+       padding: 1em;
+       white-space: pre-wrap;
+}
+
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
+li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
+/* Alternate shading for lines */
+li.L1,li.L3,li.L5,li.L7,li.L9 { }
+
+@media print {
+  pre .str, code .str { color: #060; }
+  pre .kwd, code .kwd { color: #006; font-weight: bold; }
+  pre .com, code .com { color: #600; font-style: italic; }
+  pre .typ, code .typ { color: #404; font-weight: bold; }
+  pre .lit, code .lit { color: #044; }
+  pre .pun, code .pun { color: #440; }
+  pre .pln, code .pln { color: #000; }
+  pre .tag, code .tag { color: #006; font-weight: bold; }
+  pre .atn, code .atn { color: #404; }
+  pre .atv, code .atv { color: #060; }
+}