documentation-standard.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <!-- EN-Revision: 24249 -->
  4. <appendix id="doc-standard">
  5. <title>Zend Framework ドキュメント標準(一部日本語)</title>
  6. <sect1 id="doc-standard.overview">
  7. <title>概要</title>
  8. <sect2 id="doc-standard.overview.scope">
  9. <title>スコープ</title>
  10. <para>
  11. <!-- TODO : to be translated -->
  12. This document provides guidelines for creation of the end-user
  13. documentation found within Zend Framework. It is intended as a
  14. guide to Zend Framework contributors, who must write
  15. documentation as part of component contributions, as well as to
  16. documentation translators. The standards contained herein are
  17. intended to ease translation of documentation, minimize
  18. visual and stylistic differences between different documentation
  19. files, and make finding changes in documentation easier with
  20. <command>diff</command> tools.
  21. </para>
  22. <para>
  23. You may adopt and/or modify these standards in accordance with the terms of our
  24. <ulink url="http://framework.zend.com/license">license</ulink>.
  25. </para>
  26. <para>
  27. Topics covered in Zend Framework's documentation standards include documentation
  28. file formatting and recommendations for documentation quality.
  29. </para>
  30. </sect2>
  31. </sect1>
  32. <sect1 id="doc-standard.file-formatting">
  33. <title>ドキュメントファイル形式</title>
  34. <sect2 id="doc-standard.file-formatting.xml-tags">
  35. <title>XML タグ</title>
  36. <para>
  37. 各マニュアルのファイル先頭に、下記の <acronym>XML</acronym> 宣言がなければなりません。
  38. </para>
  39. <programlisting language="xml"><![CDATA[
  40. <?xml version="1.0" encoding="UTF-8"?>
  41. <!-- Reviewed: no -->
  42. ]]></programlisting>
  43. <para>
  44. 翻訳した言語の <acronym>XML</acronym> ファイルには、
  45. 対応する翻訳元の英語ファイルのリビジョンに等しいリビジョン・タグもなければなりません。
  46. </para>
  47. <programlisting language="xml"><![CDATA[
  48. <?xml version="1.0" encoding="UTF-8"?>
  49. <!-- EN-Revision: 14978 -->
  50. <!-- Reviewed: no -->
  51. ]]></programlisting>
  52. </sect2>
  53. <sect2 id="doc-standard.file-formatting.max-line-length">
  54. <title>行の最大長</title>
  55. <!-- TODO : to be translated -->
  56. <para>
  57. The maximum line length, including tags, attributes, and indentation, is not to
  58. exceed 100 characters. There is only one exception to this rule: attribute and value
  59. pairs are allowed to exceed the 100 chars as they are not allowed to be separated.
  60. </para>
  61. </sect2>
  62. <sect2 id="doc-standard.file-formatting.indentation">
  63. <title>インデント</title>
  64. <para>インデントは、空白文字4つで構成されなければなりません。タブは許されません。</para>
  65. <para>同じレベルにあるタグは、同じインデントを持たなければなりません。</para>
  66. <programlisting language="xml"><![CDATA[
  67. <sect1>
  68. </sect1>
  69. <sect1>
  70. </sect1>
  71. ]]></programlisting>
  72. <para>
  73. 前のタグの1つ下のレベルのタグは、さらに4つの空白文字でインデントされなければなりません。
  74. </para>
  75. <programlisting language="xml"><![CDATA[
  76. <sect1>
  77. <sect2>
  78. </sect2>
  79. </sect1>
  80. ]]></programlisting>
  81. <para>
  82. 複数のブロック・タグは、同一行の中では許されません。
  83. しかしながら、インライン・タグは複数許されます。
  84. </para>
  85. <programlisting language="xml"><![CDATA[
  86. <!-- NOT ALLOWED: -->
  87. <sect1><sect2>
  88. </sect2></sect1>
  89. <!-- ALLOWED -->
  90. <para>
  91. <classname>Zend_Magic</classname> does not exist. <classname>Zend_Acl</classname> does.
  92. </para>
  93. ]]></programlisting>
  94. </sect2>
  95. <sect2 id="doc-standard.file-formatting.line-termination">
  96. <title>行の終端</title>
  97. <para>
  98. 行の終端は、Unixテキスト・ファイル規約に従います。
  99. 行は、単一のラインフィード(LF)文字で終わらなければなりません。
  100. ラインフィード文字は、序数10または16進の0x0Aとして表現されます。
  101. </para>
  102. <para>
  103. 注意:
  104. Apple OS で規約となっているキャリッジ・リターン (<acronym>CR</acronym>;0x0D)
  105. または、Windows OS で標準となっているキャリッジ・リターンと
  106. ラインフィード (<acronym>CRLF</acronym>) の組合せ (0x0D, 0x0A)
  107. を使用してはいけません。
  108. </para>
  109. </sect2>
  110. <sect2 id="doc-standard.file-formatting.empty-tags">
  111. <title>空のタグ</title>
  112. <para>
  113. 空のタグは認められません。タグは全てテキストまたは子供タグを含まなければいけません。
  114. </para>
  115. <programlisting language="xml"><![CDATA[
  116. <!-- NOT ALLOWED -->
  117. <para>
  118. Some text. <link></link>
  119. </para>
  120. <para>
  121. </para>
  122. ]]></programlisting>
  123. </sect2>
  124. <sect2 id="doc-standard.file-formatting.whitespace">
  125. <title>ドキュメント内での空白の利用</title>
  126. <sect3 id="doc-standard.file-formatting.whitespace.trailing">
  127. <title>タグ内での空白</title>
  128. <!-- TODO : to be translated -->
  129. <para>
  130. Opening block tags should have no whitespace immediately following them other
  131. than line breaks (and indentation on the following line).
  132. </para>
  133. <programlisting language="xml"><![CDATA[
  134. <!-- NOT ALLOWED -->
  135. <sect1>WHITESPACE
  136. </sect1>
  137. ]]></programlisting>
  138. <para>
  139. 開始のインライン・タグの直後に空白文字を置いてはいけません。
  140. </para>
  141. <programlisting language="xml"><![CDATA[
  142. <!-- NOT ALLOWED -->
  143. This is the class <classname> Zend_Class</classname>.
  144. <!-- OK -->
  145. This is the class <classname>Zend_Class</classname>.
  146. ]]></programlisting>
  147. <!-- TODO : to be translated -->
  148. <para>
  149. Closing block tags may be preceded by whitespace equivalent to the current
  150. indentation level, but no more than that amount.
  151. </para>
  152. <programlisting language="xml"><![CDATA[
  153. <!-- NOT ALLOWED -->
  154. <sect1>
  155. </sect1>
  156. <!-- OK -->
  157. <sect1>
  158. </sect1>
  159. ]]></programlisting>
  160. <para>
  161. 終わりのインライン・タグの前に空白文字を置いてはいけません。
  162. </para>
  163. <programlisting language="xml"><![CDATA[
  164. <!-- NOT ALLOWED -->
  165. This is the class <classname>Zend_Class </classname>
  166. <!-- OK -->
  167. This is the class <classname>Zend_Class</classname>
  168. ]]></programlisting>
  169. </sect3>
  170. <sect3 id="doc-standard.file-formatting.whitespace.multiple-line-breaks">
  171. <title>複数行の切断</title>
  172. <para>
  173. 複数行内での、またはタグの間での切断は認められません。
  174. </para>
  175. <programlisting language="xml"><![CDATA[
  176. <!-- NOT ALLOWED -->
  177. <para>
  178. Some text...
  179. ... and more text
  180. </para>
  181. <para>
  182. Another paragraph.
  183. </para>
  184. <!-- OK -->
  185. <para>
  186. Some text...
  187. ... and more text
  188. </para>
  189. <para>
  190. Another paragraph.
  191. </para>
  192. ]]></programlisting>
  193. </sect3>
  194. <sect3 id="doc-standard.file-formatting.whitespace.tag-separation">
  195. <title>タグの間の分離</title>
  196. <para>
  197. 読みやすくするために、同じレベルのタグは空行で分離しなければいけません。
  198. </para>
  199. <programlisting language="xml"><![CDATA[
  200. <!-- NOT ALLOWED -->
  201. <para>
  202. Some text...
  203. </para>
  204. <para>
  205. More text...
  206. </para>
  207. <!-- OK -->
  208. <para>
  209. Some text...
  210. </para>
  211. <para>
  212. More text...
  213. </para>
  214. ]]></programlisting>
  215. <para>
  216. 最初の子タグは、空行を置かずに親タグの直下に開かなければいけません。
  217. 最後の子タグは、親タグが閉じる直前で閉じなければいけません。
  218. </para>
  219. <programlisting language="xml"><![CDATA[
  220. <!-- NOT ALLOWED -->
  221. <sect1>
  222. <sect2>
  223. </sect2>
  224. <sect2>
  225. </sect2>
  226. <sect2>
  227. </sect2>
  228. </sect1>
  229. <!-- OK -->
  230. <sect1>
  231. <sect2>
  232. </sect2>
  233. <sect2>
  234. </sect2>
  235. <sect2>
  236. </sect2>
  237. </sect1>
  238. ]]></programlisting>
  239. </sect3>
  240. </sect2>
  241. <sect2 id="doc-standard.file-formatting.program-listing">
  242. <title>プログラム・リスティング</title>
  243. <!-- TODO : to be translated -->
  244. <para>
  245. The opening <emphasis>&lt;programlisting&gt;</emphasis> tag must indicate the
  246. appropriate "language" attribute and be indented at the same level as its sibling
  247. blocks.
  248. </para>
  249. <programlisting language="xml"><![CDATA[
  250. <para>Sibling paragraph.</para>
  251. <programlisting language="php">]]>&lt;<![CDATA[![CDATA[
  252. ]]></programlisting>
  253. <para>
  254. <acronym>CDATA</acronym> should be used around all program listings.
  255. </para>
  256. <para>
  257. <emphasis>&lt;programlisting&gt;</emphasis> sections must not add linebreaks or
  258. whitespace at the beginning or end of the section, as these are then represented in
  259. the final output.
  260. </para>
  261. <programlisting language="xml"><![CDATA[
  262. <!-- NOT ALLOWED -->
  263. <programlisting language="php">]]>&lt;<![CDATA[![CDATA[
  264. $render = "xxx";
  265. ]]]]>&gt;<![CDATA[</programlisting>
  266. <!-- OK -->
  267. <programlisting language="php">]]>&lt;<![CDATA[![CDATA[
  268. $render = "xxx";
  269. ]]]]>&gt;<![CDATA[</programlisting>
  270. ]]></programlisting>
  271. <para>
  272. Ending <acronym>CDATA</acronym> and <emphasis>&lt;programlisting&gt;</emphasis>
  273. tags should be on the same line, without any indentation.
  274. </para>
  275. <programlisting language="xml"><![CDATA[
  276. <!-- NOT ALLOWED -->
  277. <programlisting language="php">]]>&lt;<![CDATA[![CDATA[
  278. $render = "xxx";
  279. ]]]]>&gt;<![CDATA[
  280. </programlisting>
  281. <!-- NOT ALLOWED -->
  282. <programlisting language="php">]]>&lt;<![CDATA[![CDATA[
  283. $render = "xxx";
  284. ]]]]>&gt;<![CDATA[</programlisting>
  285. <!-- OK -->
  286. <programlisting language="php">]]>&lt;<![CDATA[![CDATA[
  287. $render = "xxx";
  288. ]]]]>&gt;<![CDATA[</programlisting>
  289. ]]></programlisting>
  290. <para>
  291. The <emphasis>&lt;programlisting&gt;</emphasis> tag should contain the "language"
  292. attribute with a value appropriate to the contents of the program listing. Typical
  293. values include "css", "html", "ini", "javascript", "php", "text", and "xml".
  294. </para>
  295. <programlisting language="xml"><![CDATA[
  296. <!-- PHP -->
  297. <programlisting language="php">]]>&lt;<![CDATA[![CDATA[
  298. <!-- Javascript -->
  299. <programlisting language="javascript">]]>&lt;<![CDATA[![CDATA[
  300. <!-- XML -->
  301. <programlisting language="xml">]]>&lt;<![CDATA[![CDATA[
  302. ]]></programlisting>
  303. <para>
  304. For program listings containing only <acronym>PHP</acronym> code,
  305. <acronym>PHP</acronym> tags (e.g., "&lt;?php", "?&gt;") are not required, and
  306. should not be used. They simply clutter the narrative, and are implied by the use
  307. of the <emphasis>&lt;programlisting&gt;</emphasis> tag.
  308. </para>
  309. <programlisting language="xml"><![CDATA[
  310. <!-- NOT ALLOWED -->
  311. <programlisting language="php"]]>&lt;<![CDATA[![CDATA[<?php
  312. // ...
  313. ?>]]]]>&gt;<![CDATA[</programlisting>
  314. <programlisting language="php"]]>&lt;<![CDATA[![CDATA[
  315. <?php
  316. // ...
  317. ?>
  318. ]]]]>&gt;<![CDATA[</programlisting>
  319. ]]></programlisting>
  320. <para>
  321. Line lengths within program listings should follow the <link
  322. linkend="coding-standard.php-file-formatting.max-line-length">coding standards
  323. recommendations</link>.
  324. </para>
  325. <para>
  326. Refrain from using <methodname>require_once()</methodname>,
  327. <methodname>require()</methodname>, <methodname>include_once()</methodname>, and
  328. <methodname>include()</methodname> calls within <acronym>PHP</acronym> listings.
  329. They simply clutter the narrative, and are largely obviated when using an
  330. autoloader. Use them only when they are essential to the example.
  331. </para>
  332. <note>
  333. <title>ショートタグを決して使わないで下さい</title>
  334. <para>
  335. Short tags (e.g., "&lt;?", "&lt;?=") should never be used within
  336. <emphasis>programlisting</emphasis> or the narrative of a document.
  337. </para>
  338. </note>
  339. </sect2>
  340. <sect2 id="doc-standard.file-formatting.inline-tags">
  341. <title>特殊なインラインタグの注意</title>
  342. <sect3 id="doc-standard.file-formatting.inline-tags.classname">
  343. <title>classname</title>
  344. <para>
  345. The tag <emphasis>&lt;classname&gt;</emphasis> must be used each time a class
  346. name is represented by itself; it should not be used when combined with a
  347. method name, variable name, or constant, and no other content is allowed within
  348. the tag.
  349. </para>
  350. <programlisting language="xml"><![CDATA[
  351. <para>
  352. The class <classname>Zend_Class</classname>.
  353. </para>
  354. ]]></programlisting>
  355. </sect3>
  356. <sect3 id="doc-standard.file-formatting.inline-tags.varname">
  357. <title>varname</title>
  358. <para>
  359. Variables must be wrapped in the <emphasis>&lt;varname&gt;</emphasis> tag.
  360. Variables must be written using the "$" sigil. No other content is allowed
  361. within this tag, unless a class name is used, which indicates a class variable.
  362. </para>
  363. <programlisting language="xml"><![CDATA[
  364. <para>
  365. The variable <varname>$var</varname> and the class variable
  366. <varname>Zend_Class::$var</varname>.
  367. </para>
  368. ]]></programlisting>
  369. </sect3>
  370. <sect3 id="doc-standard.file-formatting.inline-tags.methodname">
  371. <title>methodname</title>
  372. <para>
  373. Methods must be wrapped in the <emphasis>&lt;methodname&gt;</emphasis> tag.
  374. Methods must either include the full method signature or at the least a pair of
  375. closing parentheses (e.g., "()"). No other content is allowed within this tag,
  376. unless a class name is used, which indicates a class method.
  377. </para>
  378. <programlisting language="xml"><![CDATA[
  379. <para>
  380. The method <methodname>foo()</methodname> and the class method
  381. <methodname>Zend_Class::foo()</methodname>. A method with a full signature:
  382. <methodname>foo($bar, $baz)</methodname>
  383. </para>
  384. ]]></programlisting>
  385. </sect3>
  386. <sect3 id="doc-standard.file-formatting.inline-tags.constant">
  387. <title>constant</title>
  388. <para>
  389. Use the <emphasis>&lt;constant&gt;</emphasis> tag when denoting constants.
  390. Constants must be written in <acronym>UPPERCASE</acronym>. No other content is
  391. allowed within this tag, unless a class name is used, which indicates a class
  392. constant.
  393. </para>
  394. <programlisting language="xml"><![CDATA[
  395. <para>
  396. The constant <constant>FOO</constant> and the class constant
  397. <constant>Zend_Class::FOO</constant>.
  398. </para>
  399. ]]></programlisting>
  400. </sect3>
  401. <sect3 id="doc-standard.file-formatting.inline-tags.filename">
  402. <title>filename</title>
  403. <para>
  404. Filenames and paths must be wrapped in the
  405. <emphasis>&lt;filename&gt;</emphasis> tag. No other content is allowed in this
  406. tag.
  407. </para>
  408. <programlisting language="xml"><![CDATA[
  409. <para>
  410. The filename <filename>application/Bootstrap.php</filename>.
  411. </para>
  412. ]]></programlisting>
  413. </sect3>
  414. <sect3 id="doc-standard.file-formatting.inline-tags.command">
  415. <title>command</title>
  416. <para>
  417. Commands, shell scripts, and program calls must be wrapped in the
  418. <emphasis>&lt;command&gt;</emphasis> tag. If the command includes arguments,
  419. these should also be included within the tag.
  420. </para>
  421. <programlisting language="xml"><![CDATA[
  422. <para>
  423. Execute <command>zf.sh create project</command>.
  424. </para>
  425. ]]></programlisting>
  426. </sect3>
  427. <sect3 id="doc-standard.file-formatting.inline-tags.code">
  428. <title>code</title>
  429. <para>
  430. Usage of the <emphasis>&lt;code&gt;</emphasis> tag is discouraged, in favor of
  431. the other inline tasks discussed previously.
  432. </para>
  433. </sect3>
  434. </sect2>
  435. <sect2 id="doc-standard.file-formatting.block-tags">
  436. <title>特殊なブロックタグの注意</title>
  437. <sect3 id="doc-standard.file-formatting.block-tags.title">
  438. <title>title</title>
  439. <para>
  440. <emphasis>&lt;title&gt;</emphasis> タグで他のタグを保持してはいけません。
  441. </para>
  442. <programlisting language="xml"><![CDATA[
  443. <!-- NOT ALLOWED -->
  444. <title>Using <classname>Zend_Class</classname></title>
  445. <!-- OK -->
  446. <title>Using Zend_Class</title>
  447. ]]></programlisting>
  448. </sect3>
  449. </sect2>
  450. </sect1>
  451. <sect1 id="doc-standard.recommendations">
  452. <title>推奨事項</title>
  453. <sect2 id="doc-standard.recommendations.editors">
  454. <title>自動でフォーマットしないエディタを使ってください</title>
  455. <para>
  456. ドキュメンテーションを編集するために、
  457. 一般的に、正式な<acronym>XML</acronym>エディタを使用するべきではありません。
  458. そのようなエディタは、通常、それらの独自の標準に合わせるために、
  459. 既存のドキュメントを自動的にフォーマットします。
  460. および/または、docbook 標準に厳密には従いません。
  461. 例えば、それらは<acronym>CDATA</acronym>タグを消したり、
  462. 4スペースの間隔をタブや2スペースに変えたりすることを経験しています。
  463. </para>
  464. <para>
  465. スタイル・ガイドラインは、通常の<command>diff</command>ツールを用いて
  466. 変更した行を翻訳者が確認できるようにするために主に書かれました。
  467. 自動フォーマットは、この処理をより難しくします。
  468. </para>
  469. </sect2>
  470. <sect2 id="doc-standard.recommendations.images">
  471. <title>イメージを使ってください</title>
  472. <!-- TODO : to be translated -->
  473. <para>
  474. Good images and diagrams can improve readability and comprehension. Use them
  475. whenever they will assist in these goals. Images should be placed in the
  476. <filename>documentation/manual/en/figures/</filename> directory, and be named after
  477. the section identifier in which they occur.
  478. </para>
  479. </sect2>
  480. <sect2 id="doc-standard.recommendations.examples">
  481. <title>ケースの例を使ってください</title>
  482. <para>
  483. Look for good use cases submitted by the community, especially those posted in
  484. proposal comments or on one of the mailing lists. Examples often illustrate usage
  485. far better than the narrative does.
  486. </para>
  487. <para>
  488. When writing your examples for inclusion in the manual, follow
  489. all coding standards and documentation standards.
  490. </para>
  491. </sect2>
  492. <sect2 id="doc-standard.recommendations.phpdoc">
  493. <title>phpdocの内容を繰り返すことを避けてください</title>
  494. <para>
  495. The manual is intended to be a reference guide for end-user usage. Replicating
  496. the phpdoc documentation for internal-use components and classes is not wanted, and
  497. the narrative should be focussed on usage, not the internal workings. In any case,
  498. at this time, we would like the documentation teams to focus on translating the
  499. English manual, not the phpdoc comments.
  500. </para>
  501. </sect2>
  502. <sect2 id="doc-standard.recommendations.links">
  503. <title>リンクを使ってください</title>
  504. <para>
  505. ドキュメントを繰り返す代わりに、
  506. マニュアルの他のセクションや外部のソースにリンクしてください。
  507. </para>
  508. <para>
  509. マニュアルの他のセクションへのリンクを
  510. <emphasis>&lt;link&gt;</emphasis>タグ(リンクのテキストを用意しなければいけません)
  511. を使って実施できるでしょう。
  512. </para>
  513. <programlisting language="xml"><![CDATA[
  514. <para>
  515. "Link" links to a section, using descriptive text: <link
  516. linkend="doc-standard.recommendations.links">documentation on
  517. links</link>.
  518. </para>
  519. ]]></programlisting>
  520. <para>
  521. 外部リソースにリンクするには、<emphasis>&lt;ulink&gt;</emphasis>を使ってください。
  522. </para>
  523. <programlisting language="xml"><![CDATA[
  524. <para>
  525. The <ulink url="http://framework.zend.com/">Zend Framework site</ulink>.
  526. </para>
  527. ]]></programlisting>
  528. </sect2>
  529. </sect1>
  530. </appendix>