OSDN Git Service

レビュー用に追加、削除を示すためのプラグインを追加。
[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_paragraph_plugin("section", "plugin::book::Section", "HTML");
14         $wiki->add_inline_plugin("title1", "plugin::book::Title1", "HTML");
15         $wiki->add_inline_plugin("title2", "plugin::book::Title2", "HTML");
16         $wiki->add_inline_plugin("title3", "plugin::book::Title3", "HTML");
17         $wiki->add_paragraph_plugin("caption" ,"plugin::book::Caption" ,"HTML");
18         $wiki->add_paragraph_plugin("toc" ,"plugin::book::Toc" ,"HTML");
19         $wiki->add_inline_plugin("link" ,"plugin::book::Link" ,"HTML");
20         
21         $wiki->add_block_plugin("list" ,"plugin::book::List" ,"HTML");
22         $wiki->add_inline_plugin("code" ,"plugin::book::Code" ,"HTML");
23         
24         $wiki->add_block_plugin("column" ,"plugin::book::Column" ,"HTML");
25         $wiki->add_block_plugin("note" ,"plugin::book::Note" ,"HTML");
26         $wiki->add_block_plugin("box" ,"plugin::book::Box" ,"HTML");
27         
28         $wiki->add_inline_plugin("memo", "plugin::book::Memo", "HTML");
29         $wiki->add_inline_plugin("add", "plugin::book::Add", "HTML");
30         $wiki->add_inline_plugin("del", "plugin::book::Del", "HTML");
31         $wiki->add_paragraph_plugin("memolist", "plugin::book::Memolist", "HTML");
32         
33         $wiki->add_inline_plugin("wordcount", "plugin::book::Wordcount", "HTML");
34         $wiki->add_inline_plugin("pagecount", "plugin::book::Pagecount", "HTML");
35         
36         $wiki->add_hook("chapter", "plugin::book::Title1");
37         $wiki->add_hook("chapter", "plugin::book::Title2");
38         $wiki->add_hook("chapter", "plugin::book::Title3");
39         $wiki->add_hook("chapter", "plugin::book::Caption");
40         
41         $wiki->add_hook("title1", "plugin::book::Title2");
42         $wiki->add_hook("title1", "plugin::book::Title3");
43         $wiki->add_hook("title3", "plugin::book::Title3");
44         
45         $wiki->add_inline_plugin("br", "plugin::book::Br");
46         $wiki->add_paragraph_plugin("keyword" ,"plugin::book::Keyword" ,"HTML");
47         
48         my @paths = split(/\//, $wiki->get_CGI()->path_info());
49         my $path_prefix = '';
50         for(my $i = 0; $i < $#paths; $i++){
51                 $path_prefix .= '../';
52         }
53         
54         my $head_info = <<"END_OF_HEAD";
55 <link href="${path_prefix}plugin/book/google-code-prettify/sunburst.css" type="text/css" rel="stylesheet" />
56 <script type="text/javascript" src="${path_prefix}plugin/book/google-code-prettify/prettify.js"></script>
57 <script type="text/javascript">window.onload = function(){ prettyPrint(); }</script>
58 <style type="text/css">
59 div.chapter {
60   text-align: right;
61   padding: 20px;
62   font-size: 200%;
63   font-style: italic;
64 }
65
66 a.xref {
67   background-color: silver;
68 }
69
70 a.xref:link {
71   color: black;
72 }
73
74 a.xref:hover {
75   color: black;
76 }
77
78 a.xref:visited {
79   color: black;
80 }
81
82 span.xref-error {
83   background-color: silver;
84   font-weight: bold;
85 }
86
87 span.memo {
88   background-color: yellow;
89   border: 1px solid #888800;
90   margin-left: 2px;
91   margin-right: 2x;
92 }
93
94 span.delete {
95   color: blue;
96   text-decoration: line-through;
97 }
98
99 span.add {
100   color: red;
101   text-decoration: underline;
102 }
103
104 div.caption {
105   font-size: 80%;
106   font-weight: bold;
107 }
108
109 code {
110  font-weight: bold;
111 /* font-style: italic; */
112  font-family: monospace;
113 }
114
115 img {
116   border: 1px solid silver;
117 }
118
119 div.column {
120   border: 1px solid gray;
121   margin-left: 20px;
122   margin-right: 20px;
123   margin-top: 10px;
124   margin-bottom: 20px;
125 }
126
127 div.column-title {
128   background-color: silver;
129   font-weight: bold;
130   padding: 4px;
131 }
132
133 div.column-body {
134   padding: 4px;
135 }
136
137 div.note {
138   border: 2px dotted #FF8888;
139   background-color: #FFEEEE;
140   margin-bottom: 20px;
141   margin-left: 20px;
142   margin-top: 10px;
143   margin-right: 20px;
144 }
145
146 div.note-title {
147   font-weight: bold;
148   padding: 4px;
149 }
150
151 div.note-body {
152   padding: 4px;
153 }
154
155 span.keyword {
156   background-color: #666688;
157   color: white;
158   padding: 4px;
159 }
160
161 span.keyword a {
162   color: white;
163 }
164
165 div.keyword {
166   padding-top: 4px;
167   padding-left: 4px;
168   padding-right: 4px;
169   padding-bottom: 8px;
170 }
171
172 table.box {
173   width: 100%;
174   border-top: none;\r
175   border-left: none;
176   border-right: none;\r
177   border-bottom: none;\r
178   border-collapse:collapse;\r
179   border-spacing:0;\r
180   empty-cells:show;
181   margin: 2px;
182 }
183
184 table.box th {
185   width: 100px;
186   border-top: 1px solid #88AAFF;
187   border-left: 1px solid #88AAFF;
188   border-right:1px solid #88AAFF;\r
189   border-bottom:1px solid #88AAFF;\r
190   background-position:left top;\r
191   padding:0.3em 1em;\r
192   text-align:center;
193 }
194
195 table.box td {
196   border-top: 1px solid #88AAFF;
197   border-left: none;
198   border-right:1px solid #88AAFF;\r
199   border-bottom:1px solid #88AAFF;\r
200   padding:0.3em 1em;
201 }
202
203 table.box ul {
204   margin-bottom: 0px;
205   margin-left: 0px;
206   padding-left: 10px;
207 }
208
209 table.box p {
210   margin-bottom: 0px;
211   margin-left: 0px;
212   padding-left: 0px;
213 }
214
215 pre.prettyprint strong {
216   background-color: #444444;
217   text-decoration: underline;
218 #  border: 1px solid gray;
219   font-weight: normal;
220 }
221 </style>
222 END_OF_HEAD
223         
224         $wiki->add_head_info($head_info);
225 }
226
227 1;