Template talk:Example-Line

From DPWiki
Jump to navigation Jump to search

This template is used to format one line (technically two rows, with stacked cells) of a standardized table holding information about a proofing or formatting example.

This template is intended to be used with the Example-Start or Example-Proof-Start and Example-End templates.

Usage

Format

{{Example-Line
|Num=<Line Number>
|Image=<Scan text>
|Proof=<Proofed Text>
|PSizeAdj=<adjustment>
|Rem=<Remarks>
|NValign=<alignment>
|IValign=<alignment>
|IHalign=<alignment>
|PValign=<alignment>
|PHalign=<alignment>
|RValign=<alignment>
|RHalign=<alignment>
}}

It is not required to give each parameter on a separate line as shown above, but when the parameters are long (as the often will be) it can be easier to edit if this format is used.

Warning: Failing to close the template call can give very odd results when used as part of a series of templates. So can using an unescaped pipe symbol or unclosed wiki-link inside a parameter

Parameters

All parameters are named so their order is irrelevant. howver, the order given here is a logical one.

  • Num= This is used for the example number, which may be any text. If ommitted, a space is substituted.
  • Image= This specifies the text representing what the user sees in the scan image, or in the original book. This parameter is required.
  • Proof= This specifies the correct DP proofing or formatting markup: what the proofer or foofer should wind up with. This parameter is required.
  • Rem=Remarks on the example, including a link to the forum post or other source for the particular example, if available. If ommitted, a space is substituted.
  • PSizeAdj= changes the font size of the "proof" (or "markup") cell, relative to the normal display font size. The default is -1. always use a - or + followed by a single digit.
  • NValign= This specifies the vertical alignment for the "number" cell. The default is "center". The valid values are "top", "center", and "bottom" (all without the quotes).
  • IValign= This specifies the vertical alignment for the "image" cell. The default is "center". The valid values are "top", "center", and "bottom" (all without the quotes).
  • IHalign= This specifies the horizontal alignment for the "image" cell. The default is "left". The valid values are "left", "center", and "right" (all without the quotes).
  • PValign= This specifies the vertical alignment for the "proof" cell. The default is "center". The valid values are "top", "center", and "bottom" (all without the quotes).
  • PHalign= This specifies the horizontal alignment for the "proof" cell. The default is "left". The valid values are "left", "center", and "right" (all without the quotes).
  • RValign= This specifies the vertical alignment for the "remarks" cell. The default is "center". The valid values are "top", "center", and "bottom" (all without the quotes).
  • RHalign= This specifies the horizontal alignment for the "remarks" cell. The default is "left". The valid values are "left", "center", and "right" (all without the quotes).


Restrictions

  • If the expression for a parameter value contains two consecutive closing braces which are not part of a variable or parameter tag, they have to be put in nowiki tags.
  • If the expression for a parameter value contains a pipe character (|) which is not part of a piped link or within an image tag, it has to be put in nowiki tags: | or written indirectly as a character reference: |.
  • The expression for a parameter value cannot contain the variable localurl with query string, due to the pipe character.

See Wikipedia's template documentation for more on these restritions and tempalte parameters generally.

Example

Here is an example of a complete table using this template and its sister templates.


{{Example-Start | Title= Example Demo (Small caps) }}
{{Example-Line
|Num=1.
|Image=This is Small Caps|Proof=<sc>This is Small Caps</sc>
|Rem= This is the basic example from the guidelines
}}
{{Example-Line
|Num=2.
|Image= He said this is Small Caps!
|Proof=He said this is <sc>Small Caps</sc>!
|Rem= Like italics and bold text, punctuation goes outside the tags unless it is an entire sentence or section that is in small caps, or the punctuation is itself part of a phrase, title or abbreviation that is in small caps.
}}
{{Example-Line
|Num=3.
|Image= Dear Sir:
|Proof=<sc>Dear Sir:</sc>
|Rem=forumtopic:15719 pg. 2 discusses this example in the Guidelines on Letters/Correspondence.  Some felt that there was an error here, and that, for consistency, the colon ought to be outside the tags. However, jhutch asserts that the guidelines are correct because "Dear Sir:" is a whole phrase/sentence. 
}} 
{{Example-End}}

This renders as follows:

Example Demo (Small caps)
No. Image Remarks
Correctly Formatted Text
1. This is Small Caps This is the basic example from the guidelines
<sc>This is Small Caps</sc>
2. He said this is Small Caps! Like italics and bold text, punctuation goes outside the tags unless it is an entire sentence or section that is in small caps, or the punctuation is itself part of a phrase, title or abbreviation that is in small caps.
He said this is <sc>Small Caps</sc>!
3. Dear Sir: forumtopic:15719 pg. 2 discusses this example in the Guidelines on Letters/Correspondence. Some felt that there was an error here, and that, for consistency, the colon ought to be outside the tags. However, jhutch asserts that the guidelines are correct because "Dear Sir:" is a whole phrase/sentence.
<sc>Dear Sir:</sc>


Discussion

Please discuss this template and possible changes to it here.