OSDN Git Service

20ef65351c922dcfe26291ab7c5e9bf49ec40452
[fswiki/sandbox.git] / takezoe / plugin / book / Install.pm
1 ############################################################
2 #
3 # ½ñÀÒ¼¹É®ÍѤΥץ饰¥¤¥ó¤òÄ󶡤·¤Þ¤¹¡£
4 #
5 ############################################################
6 package plugin::book::Install;
7 use strict;
8 use plugin::book::TocParser;
9
10 sub install {
11         my $wiki  = shift;
12         $wiki->add_paragraph_plugin("chapter", "plugin::book::Chapter", "HTML");
13         $wiki->add_inline_plugin("title1", "plugin::book::Title1", "HTML");
14         $wiki->add_inline_plugin("title2", "plugin::book::Title2", "HTML");
15         $wiki->add_inline_plugin("title3", "plugin::book::Title3", "HTML");
16         $wiki->add_paragraph_plugin("caption" ,"plugin::book::Caption" ,"HTML");
17         $wiki->add_paragraph_plugin("toc" ,"plugin::book::Toc" ,"HTML");
18         $wiki->add_inline_plugin("link" ,"plugin::book::Link" ,"HTML");
19         
20         $wiki->add_block_plugin("list" ,"plugin::book::List" ,"HTML");
21         $wiki->add_inline_plugin("code" ,"plugin::book::Code" ,"HTML");
22         
23         $wiki->add_block_plugin("column" ,"plugin::book::Column" ,"HTML");
24         
25         $wiki->add_inline_plugin("memo", "plugin::book::Memo", "HTML");
26         $wiki->add_paragraph_plugin("memolist", "plugin::book::Memolist", "HTML");
27         
28         $wiki->add_inline_plugin("wordcount", "plugin::book::Wordcount", "HTML");
29         $wiki->add_inline_plugin("pagecount", "plugin::book::Pagecount", "HTML");
30         
31         $wiki->add_hook("chapter", "plugin::book::Title1");
32         $wiki->add_hook("chapter", "plugin::book::Title2");
33         $wiki->add_hook("chapter", "plugin::book::Title3");
34         $wiki->add_hook("chapter", "plugin::book::Caption");
35         
36         $wiki->add_hook("title1", "plugin::book::Title2");
37         $wiki->add_hook("title1", "plugin::book::Title3");
38         $wiki->add_hook("title3", "plugin::book::Title3");
39         
40         $wiki->add_inline_plugin("br", "plugin::book::Br");
41         
42         my @paths = split(/\//, $wiki->get_CGI()->path_info());
43         my $path_prefix = '';
44         for(my $i = 0; $i < $#paths; $i++){
45                 $path_prefix .= '../';
46         }
47         
48         my $head_info = <<"END_OF_HEAD";
49 <link href="${path_prefix}plugin/book/google-code-prettify/sunburst.css" type="text/css" rel="stylesheet" />
50 <script type="text/javascript" src="${path_prefix}plugin/book/google-code-prettify/prettify.js"></script>
51 <script type="text/javascript">window.onload = function(){ prettyPrint(); }</script>
52 <style type="text/css">
53 div.chapter {
54   text-align: right;
55   padding: 20px;
56   font-size: 200%;
57   font-style: italic;
58 }
59
60 a.xref {
61   background-color: silver;
62 }
63
64 a.xref:link {
65   color: black;
66 }
67
68 a.xref:hover {
69   color: black;
70 }
71
72 a.xref:visited {
73   color: black;
74 }
75
76 span.xref-error {
77   background-color: silver;
78   font-weight: bold;
79 }
80
81 span.memo {
82   background-color: yellow;
83   border: 1px solid #888800;
84   margin-left: 2px;
85   margin-right: 2x;
86 }
87
88 div.caption {
89   font-size: 80%;
90   font-weight: bold;
91 }
92
93 code {
94  font-weight: bold;
95 /* font-style: italic; */
96  font-family: monospace;
97 }
98
99 img {
100   border: 1px solid silver;
101 }
102
103 div.column-title {
104   border-top: 1px solid gray;
105   border-left: 1px solid gray;
106   border-right: 1px solid gray;
107   padding: 4px;
108   background-color: silver;
109   font-weight: bold;
110   margin-left: 20px;
111   margin-right: 20px;
112 }
113
114 div.column-body {
115   border-bottom: 1px solid gray;
116   border-left: 1px solid gray;
117   border-right: 1px solid gray;
118   padding: 4px;
119   margin-left: 20px;
120   margin-right: 20px;
121 }
122 </style>
123 END_OF_HEAD
124         
125         $wiki->add_head_info($head_info);
126 }
127
128 1;