<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SEVENTH HEAVEN &#187; SyntaxHighlighter</title>
	<atom:link href="http://kanoe.seventh-heaven.org.uk/tag/syntaxhighlighter/feed" rel="self" type="application/rss+xml" />
	<link>http://kanoe.seventh-heaven.org.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 09 Feb 2010 04:38:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Syntax Highlighterのフォントサイズの件。</title>
		<link>http://kanoe.seventh-heaven.org.uk/20100209/syntax-highlighter_font-siz.html</link>
		<comments>http://kanoe.seventh-heaven.org.uk/20100209/syntax-highlighter_font-siz.html#comments</comments>
		<pubDate>Tue, 09 Feb 2010 04:32:46 +0000</pubDate>
		<dc:creator>庚</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[SyntaxHighlighter]]></category>

		<guid isPermaLink="false">http://kanoe.seventh-heaven.org.uk/?p=17</guid>
		<description><![CDATA[Syntax Highlighterを導入したはイイが、文字ソース部分だけなぜかフォントサイズがでかくなってしまい、むーん。。。
いやまぁ、完全にテーマ本体のcss設計のせいなのですが。とりあえずは対処法。

生成される [...]


Related posts:<ol><li><a href='http://kanoe.seventh-heaven.org.uk/20100206/syntax-highlighter-for-wordpress.html' rel='bookmark' title='Permanent Link: Syntax Highlighter for WordPress'>Syntax Highlighter for WordPress</a> <small> ...</small></li>
<li><a href='http://kanoe.seventh-heaven.org.uk/20100118/all-in-one-seo-pack.html' rel='bookmark' title='Permanent Link: All in One SEO Pack'>All in One SEO Pack</a> <small>折角ブログを立ち上げるんなら、皆さんに見て頂きたい訳で。 それには当然、検索エンジンの上位に載っかるコトが先決。 そこで必須になってくるのが「All in One SEO Pack」。タイトルやMETAタグの内容をページ [...]...</small></li>
</ol>

関連記事は<a href='http://mitcho.com/code/yarpp/'>YARPP関連記事プラグイン</a>によって表示されています。]]></description>
			<content:encoded><![CDATA[<p>Syntax Highlighterを導入したはイイが、文字ソース部分だけなぜかフォントサイズがでかくなってしまい、むーん。。。<br />
いやまぁ、完全にテーマ本体のcss設計のせいなのですが。とりあえずは対処法。</p>
<p><span id="more-17"></span></p>
<p>生成されるソースを見ると、</p>
<pre class="brush: html; auto-links: false;">
&lt;div id=&quot;highlighter_xxxxxx&quot; class=&quot;syntaxhighlighter&quot;&gt;
　なんちゃらかんちゃら
&lt;div&gt;
</pre>
<p>という訳で、「syntaxhighlighter」というクラス名でフォントサイズを制御している模様。<br />
そのありかをチェックすると、「syntax-highlighter/css/shCore.css」の22行目。</p>
<pre class="brush: css; auto-links: false;">
.syntaxhighlighter,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter span,
.syntaxhighlighter .bold,
.syntaxhighlighter .italic,
.syntaxhighlighter .line,
.syntaxhighlighter .line .number,
.syntaxhighlighter .line .content,
.syntaxhighlighter .line .content .block,
.syntaxhighlighter .line .content .spaces,
.syntaxhighlighter .bar,
.syntaxhighlighter .ruler,
.syntaxhighlighter .toolbar,
.syntaxhighlighter .toolbar a,
.syntaxhighlighter .toolbar a:hover
{
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: none;
	text-align: left;
	float: none;
	vertical-align: baseline;
	position: static;
	left: auto;
	top: auto;
	right: auto;
	bottom: auto;
	height: auto;
	width: auto;
	line-height: normal;
	font-family: &quot;Consolas&quot;, &quot;Monaco&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace;
	font-weight: normal;
	font-style: normal;
	font-size: 100%;
}
</pre>
<p>なーんてなっておりまして……。<br />
下手にパーセンテージを小さくしようものなら、入れ子構造でエラいこっちゃ。</p>
<p>で。その次にあったのが。</p>
<pre class="brush: css; auto-links: false;">
.syntaxhighlighter
{
	width: 100%;
	margin: 1em 0 1em 0;
	padding: 1px; /* adds a little border on top and bottom */
	position: relative;
	overflow: auto;
}
</pre>
<p>ここだったら、クラス単体での設定が可能。<br />
という訳で、以下のように書き加えてみました。</p>
<pre class="brush: css; highlight: [8,9]; auto-links: false;">
.syntaxhighlighter
{
	width: 100%;
	margin: 1em 0 1em 0;
	padding: 1px; /* adds a little border on top and bottom */
	position: relative;
	overflow: auto;
	font-size: 85%;
	max-height:200px;
}
</pre>
<p>「font-size:85%」というのは、&lt;p&gt;タグのサイズに準拠。<br />
ついでに「max-height」指定をカマして、ずらずら長いソースを収納したという手筈でございます。</p>
<p>しっかし……今後、アップグレードする度に書き換えなきゃいけないかと思うとorz。<br />
極力プラグイン本体の内容はいぢりたくないんだよね……(..;)。</p>


<p>Related posts:<ol><li><a href='http://kanoe.seventh-heaven.org.uk/20100206/syntax-highlighter-for-wordpress.html' rel='bookmark' title='Permanent Link: Syntax Highlighter for WordPress'>Syntax Highlighter for WordPress</a> <small> ...</small></li>
<li><a href='http://kanoe.seventh-heaven.org.uk/20100118/all-in-one-seo-pack.html' rel='bookmark' title='Permanent Link: All in One SEO Pack'>All in One SEO Pack</a> <small>折角ブログを立ち上げるんなら、皆さんに見て頂きたい訳で。 それには当然、検索エンジンの上位に載っかるコトが先決。 そこで必須になってくるのが「All in One SEO Pack」。タイトルやMETAタグの内容をページ [...]...</small></li>
</ol></p>
<p>関連記事は<a href='http://mitcho.com/code/yarpp/'>YARPP関連記事プラグイン</a>によって表示されています。</p>]]></content:encoded>
			<wfw:commentRss>http://kanoe.seventh-heaven.org.uk/20100209/syntax-highlighter_font-siz.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syntax Highlighter for WordPress</title>
		<link>http://kanoe.seventh-heaven.org.uk/20100206/syntax-highlighter-for-wordpress.html</link>
		<comments>http://kanoe.seventh-heaven.org.uk/20100206/syntax-highlighter-for-wordpress.html#comments</comments>
		<pubDate>Sat, 06 Feb 2010 07:07:32 +0000</pubDate>
		<dc:creator>庚</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[SyntaxHighlighter]]></category>

		<guid isPermaLink="false">http://kanoe.seventh-heaven.org.uk/?p=16</guid>
		<description><![CDATA[ 


Related posts:<ol><li><a href='http://kanoe.seventh-heaven.org.uk/20100209/syntax-highlighter_font-siz.html' rel='bookmark' title='Permanent Link: Syntax Highlighterのフォントサイズの件。'>Syntax Highlighterのフォントサイズの件。</a> <small>Syntax Highlighterを導入したはイイが、文字ソース部分だけなぜかフォントサイズがでかくなってしまい、むーん。。。 いやまぁ、完全にテーマ本体のcss設計のせいなのですが。とりあえずは対処法。 生成される [...]...</small></li>
</ol>

関連記事は<a href='http://mitcho.com/code/yarpp/'>YARPP関連記事プラグイン</a>によって表示されています。]]></description>
			<content:encoded><![CDATA[<p>技術系ブログをやる場合、結構頭をひねるのがソースの表示方法。<br />
別に、フツーに&lt;pre&gt;タグでくくっちまえばイイという話もありますが。<br />
殆どデフォルトと化しているのが、Javascriptライブラリの「<a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter" target="_blank">Syntax Highlighter</a>」。<br />
そのWordpressのplug-inの１つが、「Syntax Highlighter for WordPress」でございます。<br />
<span id="more-16"></span><br />
同じような意図を持ったplug-in、実は色々あるのですが、これを選んだ理由は主に２つ。</p>
<ol>
<li>開発者が日本語であること。</li>
<li>生成されるソースがdiv/spanベースであること</li>
</ol>
<p>まず、日本発plug-inというコトで、ありかは「<a href="http://wppluginsj.sourceforge.jp/" target="_blank">WordPress Plugins/JSeries</a>」。<br />
「<a href="http://wppluginsj.sourceforge.jp/syntax-highlighter/" target="_blank">Syntax Highlighter for WordPress (ソース整形表示)</a>」にございます。<br />
大まかな話はそちらに記載してあるので、インストール方法や使い方を知るために、わざわざ英語の長文読解にチャレンジしなくても良いし、改めてGoogle先生に尋ねる必要もなし。<br />
Wordpress.orgの「<a href="http://wordpress.org/extend/plugins/" target="_blank">Plugin Directory</a>」に登録されていない分、アップデートしても自動更新されないという制約はつきますが、まぁその辺はイイでしょう。<br />
アップデート情報を知るのには、専用plug-inの「<a href="http://wppluginsj.sourceforge.jp/jseries-notifier/">JSeries Notifer</a>」を入れるという手があります。</p>
<p>で。生成されるソースとは何ぞや。<br />
とりあえず、実験してみましょう。</p>
<pre class="brush: php; auto-links: false;">
&lt;?php
	$year = date(&#039;Y&#039;);
	$month = date(&#039;m&#039;);
	$day = date(&#039;d&#039;);
	print &quot;ようこそ！\n&quot;;
	print &quot;今日は&quot;.$year. &quot;年&quot;.$month.&quot;月&quot;.$day.&quot;日です。\n&quot;;
?&gt;
</pre>
<p>この部分のソースを見てみると……。</p>
<pre class="brush: html; auto-links: false;">
&lt;pre class=&quot;brush: php; auto-links: false;&quot;&gt;
&amp;lt;?php
	$year = date(&amp;#039;Y&amp;#039;);
	$month = date(&amp;#039;m&amp;#039;);
	$day = date(&amp;#039;d&amp;#039;);
	print &amp;quot;ようこそ！\n&amp;quot;;
	print &amp;quot;今日は&amp;quot;.$year. &amp;quot;年&amp;quot;.$month.&amp;quot;月&amp;quot;.$day.&amp;quot;日です。\n&amp;quot;;
?&amp;gt;
&lt;/pre&gt;
</pre>
<p>となっているのですが、FirebugでJavascriptによって見栄えを考えて生成し直したソースを見てみると……。</p>
<pre class="brush: html; auto-links: false;">
&lt;div id=&quot;highlighter_819959&quot; class=&quot;syntaxhighlighter&quot;&gt;
	&lt;div class=&quot;bar&quot;&gt;
		&lt;div class=&quot;toolbar&quot;&gt;&lt;a class=&quot;item viewSource&quot; href=&quot;#viewSource&quot; title=&quot;プレインテキスト&quot; style=&quot;width: 16px; height: 16px;&quot;&gt;プレインテキスト&lt;/a&gt;&lt;a class=&quot;item printSource&quot; href=&quot;#printSource&quot; title=&quot;印刷&quot; style=&quot;width: 16px; height: 16px;&quot;&gt;印刷&lt;/a&gt;&lt;a class=&quot;item about&quot; href=&quot;#about&quot; title=&quot;?&quot; style=&quot;width: 16px; height: 16px;&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class=&quot;lines&quot;&gt;
		&lt;div class=&quot;line alt1&quot;&gt;&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;div class=&quot;line alt2&quot;&gt;&lt;code class=&quot;number&quot;&gt;2.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;/&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 40px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$year&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;date&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#039;Y&#039;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;div class=&quot;line alt1&quot;&gt;&lt;code class=&quot;number&quot;&gt;3.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;/&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 40px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$month&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;date&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#039;m&#039;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;div class=&quot;line alt2&quot;&gt;&lt;code class=&quot;number&quot;&gt;4.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;/&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 40px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$day&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;date&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#039;d&#039;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;div class=&quot;line alt1&quot;&gt;&lt;code class=&quot;number&quot;&gt;5.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;/&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 40px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;print&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;ようこそ！&yen;n&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;div class=&quot;line alt2&quot;&gt;&lt;code class=&quot;number&quot;&gt;6.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;/&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 40px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;print&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;今日は&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$year&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;年&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$month&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;月&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$day&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;日です。&yen;n&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;div class=&quot;line alt1&quot;&gt;&lt;code class=&quot;number&quot;&gt;7.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>うぎゃあっ(>_<)ヽ 以外の何ものでもありません。<br />
但し、各パーツはspan/codeと、W3C上では一応問題のない構造になっています。<br />
Wordpress.orgの「<a href="http://wordpress.org/extend/plugins/" target="_blank">Plugin Directory</a>」で「SyntaxHighlighter」を検索してみると、「<a href="http://wordpress.org/extend/plugins/syntaxhighlighter/" target="_blank">SyntaxHighlighter Evolved</a>」っつーのが真っ先に上がって、過去ログ見たらかなり老舗ぽかったのでありますが、なぜか自動生成、&lt;table&gt;タグでやってしまってるのですね。さすがに今時、コレはないんじゃなかろーか……。</p>
<p>という訳で。とりあえずはコレで、カッコがついた訳でございます。</p>


<p>Related posts:<ol><li><a href='http://kanoe.seventh-heaven.org.uk/20100209/syntax-highlighter_font-siz.html' rel='bookmark' title='Permanent Link: Syntax Highlighterのフォントサイズの件。'>Syntax Highlighterのフォントサイズの件。</a> <small>Syntax Highlighterを導入したはイイが、文字ソース部分だけなぜかフォントサイズがでかくなってしまい、むーん。。。 いやまぁ、完全にテーマ本体のcss設計のせいなのですが。とりあえずは対処法。 生成される [...]...</small></li>
</ol></p>
<p>関連記事は<a href='http://mitcho.com/code/yarpp/'>YARPP関連記事プラグイン</a>によって表示されています。</p>]]></content:encoded>
			<wfw:commentRss>http://kanoe.seventh-heaven.org.uk/20100206/syntax-highlighter-for-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
