From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- .../core/en/doc-standard.file-formatting.html | 599 +++++++++++++++++++++ 1 file changed, 599 insertions(+) create mode 100644 zend/documentation/manual/core/en/doc-standard.file-formatting.html (limited to 'zend/documentation/manual/core/en/doc-standard.file-formatting.html') diff --git a/zend/documentation/manual/core/en/doc-standard.file-formatting.html b/zend/documentation/manual/core/en/doc-standard.file-formatting.html new file mode 100644 index 0000000..b395748 --- /dev/null +++ b/zend/documentation/manual/core/en/doc-standard.file-formatting.html @@ -0,0 +1,599 @@ + + + + + Documentation File Formatting - Zend Framework Manual + + + + + + + + +
+ + + + + + + + +
+ Overview + + + + +
+
+

Documentation File Formatting

+ + +

XML Tags

+ + +

+ Each manual file must include the following XML declarations at + the top of the file: +

+ +
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. +
  3. <!-- Reviewed: no -->
+ + +

+ XML files from translated languages must also include a revision + tag containing the revision of the corresponding English-language file the + translation was based on. +

+ +
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. +
  3. <!-- EN-Revision: 14978 -->
  4. +
  5. <!-- Reviewed: no -->
+ +
+ +

Maximum Line Length

+ + +

+ The maximum line length, including tags, attributes, and indentation, is not to + exceed 100 characters. There is only one exception to this rule: attribute and value + pairs are allowed to exceed the 100 chars as they are not allowed to be separated. +

+
+ +

Indentation

+ + +

Indentation should consist of 4 spaces. Tabs are not allowed.

+

Tags which are at the same level must have the same indentation.

+ +
  1. <sect1>
  2. +
  3. </sect1>
  4. +
  5.  
  6. +
  7. <sect1>
  8. +
  9. </sect1>
+ + +

+ Tags which are one level under the previous tag must be indented with 4 additional + spaces. +

+ +
  1. <sect1>
  2. +
  3.     <sect2>
  4. +
  5.     </sect2>
  6. +
  7. </sect1>
+ + +

+ Multiple block tags within the same line are not allowed; multiple inline tags are + allowed, however. +

+ +
  1. <!-- NOT ALLOWED: -->
  2. +
  3. <sect1><sect2>
  4. +
  5. </sect2></sect1>
  6. +
  7.  
  8. +
  9. <!-- ALLOWED -->
  10. +
  11. <para>
  12. +
  13.     <classname>Zend_Magic</classname> does not exist. <classname>Zend_Acl</classname> does.
  14. +
  15. </para>
+ +
+ +

Line Termination

+ + +

+ Line termination follows the Unix text file convention. Lines must end with a + single linefeed (LF) character. Linefeed characters are represented as ordinal 10, + or hexadecimal 0x0A. +

+ +

+ Note: Do not use carriage returns (CR) as is the convention in + Apple OS's (0x0D) or the carriage return - linefeed combination + (CRLF) as is standard for the Windows OS (0x0D, 0x0A). +

+
+ +

Empty tags

+ + +

+ Empty tags are not allowed; all tags must contain text or child tags. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. <para>
  4. +
  5.     Some text. <link></link>
  6. +
  7. </para>
  8. +
  9.  
  10. +
  11. <para>
  12. +
  13. </para>
+ +
+ +

Usage of whitespace within documents

+ + +

Whitespace within tags

+ + +

+ Opening block tags should have no whitespace immediately following them other + than line breaks (and indentation on the following line). +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. <sect1>WHITESPACE
  4. +
  5. </sect1>
+ + +

+ Opening inline tags should have no whitespace immediately following them. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. This is the class <classname> Zend_Class</classname>.
  4. +
  5.  
  6. +
  7. <!-- OK -->
  8. +
  9. This is the class <classname>Zend_Class</classname>.
+ + +

+ Closing block tags may be preceded by whitespace equivalent to the current + indentation level, but no more than that amount. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3.     <sect1>
  4. +
  5.      </sect1>
  6. +
  7.  
  8. +
  9. <!-- OK -->
  10. +
  11.     <sect1>
  12. +
  13.     </sect1>
+ + +

+ Closing inline tags must not be preceded by any whitespace. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. This is the class <classname>Zend_Class </classname>
  4. +
  5.  
  6. +
  7. <!-- OK -->
  8. +
  9. This is the class <classname>Zend_Class</classname>
+ +
+ +

Multiple line breaks

+ + +

+ Multiple line breaks within or between tags are not allowed. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. <para>
  4. +
  5.     Some text...
  6. +
  7.  
  8. +
  9.     ... and more text
  10. +
  11. </para>
  12. +
  13.  
  14. +
  15.  
  16. +
  17. <para>
  18. +
  19.     Another paragraph.
  20. +
  21. </para>
  22. +
  23.  
  24. +
  25. <!-- OK -->
  26. +
  27. <para>
  28. +
  29.     Some text...
  30. +
  31.     ... and more text
  32. +
  33. </para>
  34. +
  35.  
  36. +
  37. <para>
  38. +
  39.     Another paragraph.
  40. +
  41. </para>
+ +
+ +

Separation between tags

+ + +

+ Tags at the same level must be separated by an empty line to improve + readability. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. <para>
  4. +
  5.     Some text...
  6. +
  7. </para>
  8. +
  9. <para>
  10. +
  11.     More text...
  12. +
  13. </para>
  14. +
  15.  
  16. +
  17. <!-- OK -->
  18. +
  19. <para>
  20. +
  21.     Some text...
  22. +
  23. </para>
  24. +
  25.  
  26. +
  27. <para>
  28. +
  29.     More text...
  30. +
  31. </para>
+ + +

+ The first child tag should open directly below its parent, with no empty line + between them; the last child tag should close directly before the closing tag of + its parent. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. <sect1>
  4. +
  5.  
  6. +
  7.     <sect2>
  8. +
  9.     </sect2>
  10. +
  11.  
  12. +
  13.     <sect2>
  14. +
  15.     </sect2>
  16. +
  17.  
  18. +
  19.     <sect2>
  20. +
  21.     </sect2>
  22. +
  23.  
  24. +
  25. </sect1>
  26. +
  27.  
  28. +
  29. <!-- OK -->
  30. +
  31. <sect1>
  32. +
  33.     <sect2>
  34. +
  35.     </sect2>
  36. +
  37.  
  38. +
  39.     <sect2>
  40. +
  41.     </sect2>
  42. +
  43.  
  44. +
  45.     <sect2>
  46. +
  47.     </sect2>
  48. +
  49. </sect1>
+ +
+
+ +

Program Listings

+ + +

+ The opening <programlisting> tag must indicate the + appropriate "language" attribute and be indented at the same level as its sibling + blocks. +

+ +
  1. <para>Sibling paragraph.</para>
  2. +
  3.  
  4. +
  5. <programlisting language="php"><![CDATA[
  6. +
+ + +

+ CDATA should be used around all program listings. +

+ +

+ <programlisting> sections must not add linebreaks or + whitespace at the beginning or end of the section, as these are then represented in + the final output. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. <programlisting language="php"><![CDATA[
  4. +
  5.  
  6. +
  7. $render = "xxx";
  8. +
  9.  
  10. +
  11. ]]></programlisting>
  12. +
  13.  
  14. +
  15. <!-- OK -->
  16. +
  17. <programlisting language="php"><![CDATA[
  18. +
  19. $render = "xxx";
  20. +
  21. ]]></programlisting>
+ + +

+ Ending CDATA and <programlisting> + tags should be on the same line, without any indentation. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3.     <programlisting language="php"><![CDATA[
  4. +
  5. $render = "xxx";
  6. +
  7. ]]>
  8. +
  9.     </programlisting>
  10. +
  11.  
  12. +
  13. <!-- NOT ALLOWED -->
  14. +
  15.     <programlisting language="php"><![CDATA[
  16. +
  17. $render = "xxx";
  18. +
  19.     ]]></programlisting>
  20. +
  21.  
  22. +
  23. <!-- OK -->
  24. +
  25.     <programlisting language="php"><![CDATA[
  26. +
  27. $render = "xxx";
  28. +
  29. ]]></programlisting>
+ + +

+ The <programlisting> tag should contain the "language" + attribute with a value appropriate to the contents of the program listing. Typical + values include "css", "html", "ini", "javascript", "php", "text", and "xml". +

+ +
  1. <!-- PHP -->
  2. +
  3. <programlisting language="php"><![CDATA[
  4. +
  5.  
  6. +
  7. <!-- Javascript -->
  8. +
  9. <programlisting language="javascript"><![CDATA[
  10. +
  11.  
  12. +
  13. <!-- XML -->
  14. +
  15. <programlisting language="xml"><![CDATA[
  16. +
+ + +

+ For program listings containing only PHP code, + PHP tags (e.g., "<?php", "?>") are not required, and + should not be used. They simply clutter the narrative, and are implied by the use + of the <programlisting> tag. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. <programlisting language="php"<![CDATA[<?php
  4. +
  5.     // ...
  6. +
  7. ?>]]></programlisting>
  8. +
  9.  
  10. +
  11. <programlisting language="php"<![CDATA[
  12. +
  13. <?php
  14. +
  15.     // ...
  16. +
  17. ?>
  18. +
  19. ]]></programlisting>
+ + +

+ Line lengths within program listings should follow the coding standards + recommendations. +

+ +

+ Refrain from using require_once(), + require(), include_once(), and + include() calls within PHP listings. + They simply clutter the narrative, and are largely obviated when using an + autoloader. Use them only when they are essential to the example. +

+ +

Note: Never use short tags
+ + + + Short tags (e.g., "<?", "<?=") should never be used within + programlisting or the narrative of a document. +
+

+
+ +

Notes on specific inline tags

+ + +

classname

+ + +

+ The tag <classname> must be used each time a class + name is represented by itself; it should not be used when combined with a + method name, variable name, or constant, and no other content is allowed within + the tag. +

+ +
  1. <para>
  2. +
  3.     The class <classname>Zend_Class</classname>.
  4. +
  5. </para>
+ +
+ +

varname

+ + +

+ Variables must be wrapped in the <varname> tag. + Variables must be written using the "$" sigil. No other content is allowed + within this tag, unless a class name is used, which indicates a class variable. +

+ +
  1. <para>
  2. +
  3.     The variable <varname>$var</varname> and the class variable
  4. +
  5.     <varname>Zend_Class::$var</varname>.
  6. +
  7. </para>
+ +
+ +

methodname

+ + +

+ Methods must be wrapped in the <methodname> tag. + Methods must either include the full method signature or at the least a pair of + closing parentheses (e.g., "()"). No other content is allowed within this tag, + unless a class name is used, which indicates a class method. +

+ +
  1. <para>
  2. +
  3.     The method <methodname>foo()</methodname> and the class method
  4. +
  5.     <methodname>Zend_Class::foo()</methodname>. A method with a full signature:
  6. +
  7.     <methodname>foo($bar, $baz)</methodname>
  8. +
  9. </para>
+ +
+ +

constant

+ + +

+ Use the <constant> tag when denoting constants. + Constants must be written in UPPERCASE. No other content is + allowed within this tag, unless a class name is used, which indicates a class + constant. +

+ +
  1. <para>
  2. +
  3.     The constant <constant>FOO</constant> and the class constant
  4. +
  5.     <constant>Zend_Class::FOO</constant>.
  6. +
  7. </para>
+ +
+ +

filename

+ + +

+ Filenames and paths must be wrapped in the + <filename> tag. No other content is allowed in this + tag. +

+ +
  1. <para>
  2. +
  3.     The filename <filename>application/Bootstrap.php</filename>.
  4. +
  5. </para>
+ +
+ +

command

+ + +

+ Commands, shell scripts, and program calls must be wrapped in the + <command> tag. If the command includes arguments, + these should also be included within the tag. +

+ +
  1. <para>
  2. +
  3.     Execute <command>zf.sh create project</command>.
  4. +
  5. </para>
+ +
+ +

code

+ + +

+ Usage of the <code> tag is discouraged, in favor of + the other inline tasks discussed previously. +

+
+
+ +

Notes on specific block tags

+ + +

title

+ + +

+ The <title> tag is not allowed to hold other tags. +

+ +
  1. <!-- NOT ALLOWED -->
  2. +
  3. <title>Using <classname>Zend_Class</classname></title>
  4. +
  5.  
  6. +
  7. <!-- OK -->
  8. +
  9. <title>Using Zend_Class</title>
+ +
+
+
+
+ + + + + + + + + +
+ Overview + + + + +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.3