<?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>ものぐさ備忘録 &#187; documentation</title>
	<atom:link href="http://www.ginriki.net/wd/category/documentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ginriki.net/wd</link>
	<description>ソフトウェア関係の話を中心とした備忘録的日記</description>
	<lastBuildDate>Sun, 16 Jan 2011 20:07:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PhpDocumentorによるドキュメント自動生成</title>
		<link>http://www.ginriki.net/wd/2008/10/29/45/</link>
		<comments>http://www.ginriki.net/wd/2008/10/29/45/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 09:01:45 +0000</pubDate>
		<dc:creator>ginriki</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[PhpDocumentor]]></category>

		<guid isPermaLink="false">http://www.gikogeek.net/wd/?p=45</guid>
		<description><![CDATA[バイト先のWebアプリケーション用ソースコードの量が増えてきたので、
そろそろドキュメント生成ツールでも使おうということで、そのメモ。
バイト先では、PHP &#038; symfonyフレームワークで書いてるんで、
ド [...]]]></description>
			<content:encoded><![CDATA[<p>バイト先のWebアプリケーション用ソースコードの量が増えてきたので、<br />
そろそろドキュメント生成ツールでも使おうということで、そのメモ。</p>
<p>バイト先では、PHP &#038; symfonyフレームワークで書いてるんで、<br />
ドキュメント生成ツールにはPhpDocumentor<sup>1</sup>を使います。</p>
<p>インストールはPEARを使えば楽勝。</p>
<pre>
 $ pear install PhpDocumentor
</pre>
<p>で、ドキュンメントの生成にはphpdocコマンドを使います。</p>
<pre>
 $ phpdoc -d apps,lib -t doc/phpdoc
</pre>
<p>これで、appsとlibディレクトリ以下すべてのphpファイルをHTMLドキュメント化して、<br />
doc/phpdoc以下に吐き出してくれます。</p>
<p>ただ、デフォルトで生成するHTMLには、charset=iso-8859-1が指定されているため、<br />
日本語コメントは文字化けしてしまいます。</p>
<p>対処法としては、HTML内にcharset指定のないHTMLドキュメントを生成するのが楽です<sup>2</sup>。</p>
<pre>
 $ phpdoc -d apps,lib -t doc/phpdoc -o HTML:Smarty:PHP
</pre>
<p>この場合、デフォルトで生成したHTMLとはレイアウトが変わってしまいます。<br />
デフォルトレイアウトが好きな方は、下記サイトを参考にテンプレートを書き換えてください。<br />
<a href='http://je-pu-pu.jp/blog/archives/2006/04/phpdocumentor.html'>http://je-pu-pu.jp/blog/archives/2006/04/phpdocumentor.html</a></p>
<h4>参考文献</h4>
<ul>
<li><a href='http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.pkg.html'>ソースコードに記述できるタグの説明</a></li>
<li><a href='http://fullmetal.dip.jp/pukiwiki/index.php?memo%2FPhpDocumentor%2Fhelp'>phpdocコマンドオプション説明の日本語訳</a></li>
</ul>
<ol class="footnotes"><li id="footnote_0_45" class="footnote">現バージョンは1.4.2です</li><li id="footnote_1_45" class="footnote">とはいえ、webサーバのDefaultCharsetが間違っていたり、ブラウザの文字コード自動判定が失敗した場合は、文字化けが起きるので注意</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.ginriki.net/wd/2008/10/29/45/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

