• R/O
  • HTTP
  • SSH
  • HTTPS

sandbox: 提交

個人用


Commit MetaInfo

修訂9543e9ef2e886f74e88de37df05c052422e356c9 (tree)
時間2011-11-23 10:39:46
作者takezoe <takezoe@871d...>
Commitertakezoe

Log Message

listプラグインのプログラムを<<<...>>>で囲むと囲んだ部分を強調して表示するようにした。

Change Summary

差異

--- a/takezoe/plugin/book/Install.pm
+++ b/takezoe/plugin/book/Install.pm
@@ -199,6 +199,13 @@ table.box p {
199199 margin-left: 0px;
200200 padding-left: 0px;
201201 }
202+
203+pre.prettyprint strong {
204+ background-color: #444444;
205+ text-decoration: underline;
206+# border: 1px solid gray;
207+ font-weight: normal;
208+}
202209 </style>
203210 END_OF_HEAD
204211
--- a/takezoe/plugin/book/List.pm
+++ b/takezoe/plugin/book/List.pm
@@ -23,6 +23,9 @@
2323 # &nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Hello World!");
2424 # &nbsp;&nbsp;}
2525 # }
26+# <p>
27+# また、プログラムを&lt;&lt;&lt;...&gt;&gt;&gt;で囲むと囲んだ部分が強調して表示されます。
28+# </p>
2629 # </pre>
2730 #
2831 ################################################################################
@@ -33,7 +36,6 @@ package plugin::book::List;
3336 sub new {
3437 my $class = shift;
3538 my $self = {};
36- $self->{'count'} = 0;
3739 return bless $self,$class;
3840 }
3941
@@ -46,7 +48,10 @@ sub block {
4648 my $code = shift;
4749 my $buf = '';
4850
49- return $buf.'<pre class="prettyprint">'.Util::escapeHTML($code).'</pre>';
51+ $code = Util::escapeHTML($code);
52+ $code =~ s/&lt;&lt;&lt;((.|\s)+?)&gt;&gt;&gt;/<strong>$1<\/strong>/g;
53+
54+ return $buf.'<pre class="prettyprint">'.$code.'</pre>';
5055 }
5156
5257 1;
--- a/takezoe/plugin/book/README.txt
+++ b/takezoe/plugin/book/README.txt
@@ -38,6 +38,8 @@ FSWiki
3838 }
3939 }}
4040
41+また、ソース内を<<< ... >>>で囲むと、囲んだ部分が強調されて表示されます。
42+
4143 !!図表番号
4244
4345 captionプラグインを使用すると図表番号を付与することができます。第一引数に種別(表、図、リストなど)、第二引数にキャプションに表示する文字列を指定します。
Show on old repository browser