Difference between revisions of "Template:Chset-cell-unified/doc"
imported>HarJIT (→Usage) |
imported>HarJIT (→Usage) |
||
| Line 15: | Line 15: | ||
** Parameter <code>unic</code>: ''hhhh'', Unicode value in hexadecimal, 4 digits for most codepoints (those on the [[Basic Multilingual Plane]]) and 5 otherwise, (e.g., ''0020'', ''1D44A''). | ** Parameter <code>unic</code>: ''hhhh'', Unicode value in hexadecimal, 4 digits for most codepoints (those on the [[Basic Multilingual Plane]]) and 5 otherwise, (e.g., ''0020'', ''1D44A''). | ||
** May if necessary include multiple mappings (in the <code>0020 (00A0)</code> or <code>0020/00A0</code> form) and may if necessary be followed by (a sparing number of) footnotes. | ** May if necessary include multiple mappings (in the <code>0020 (00A0)</code> or <code>0020/00A0</code> form) and may if necessary be followed by (a sparing number of) footnotes. | ||
| − | ** Set to <code>&nbsp;</code> or <code>-</code> for a character without a Unicode mapping. Alternatively, if a Private Use Area mapping is in established use for such a character (e.g. the Apple logo in [[Mac OS Roman]]) then it may be given, but [[WP:NOR|don't make them up]]. | + | ** Set to <code>&nbsp;</code> or <code>-</code> for a character without a Unicode mapping. Alternatively, if a Private Use Area mapping is in established/documented use for such a character (e.g. the Apple logo in [[Mac OS Roman]]) then it may be given, but [[WP:NOR|don't make them up]]. |
** Set to <code>LEAD</code> for a lead byte (rather than a character). | ** Set to <code>LEAD</code> for a lead byte (rather than a character). | ||
* Subsequent rows: | * Subsequent rows: | ||
Revision as of 07:37, 3 September 2018
| This is a documentation subpage for Template:Chset-cell-unified. It contains usage information, categories and other content that is not part of the original template page. |
Note
This template combines the functionality of Template:chset-ctrl, Template:chset-ctrl3, Template:chset-ctrl4, Template:chset-cell, Template:chset-cell3 and Template:chset-cell4. The intention is to implement them using this template and thus make it easier to keep them in sync.
Usage
Used with Template:chset-tableformat to indicate a table cell.
- First row:
- Parameter
char: the character in question. May link to the appropriate article or Wiktionary page if appropriate. Only provide for a non-control, non-whitespace printing character. If the Unicode value is given as one value with no footnotes, this does not need to be specified. - Parameter
ctrl: XX, name of a whitespace, control, format, separator or otherwise non-printing character (e.g., SP, LF, HT, NBSP, ZWNJ, PDO), with link to appropriate article if it exists. Do not provide at the same time aschar.
- Parameter
- Second row:
- Parameter
unic: hhhh, Unicode value in hexadecimal, 4 digits for most codepoints (those on the Basic Multilingual Plane) and 5 otherwise, (e.g., 0020, 1D44A). - May if necessary include multiple mappings (in the
0020 (00A0)or0020/00A0form) and may if necessary be followed by (a sparing number of) footnotes. - Set to
or-for a character without a Unicode mapping. Alternatively, if a Private Use Area mapping is in established/documented use for such a character (e.g. the Apple logo in Mac OS Roman) then it may be given, but don't make them up. - Set to
LEADfor a lead byte (rather than a character).
- Parameter
- Subsequent rows:
- Parameter
deci: d(d(d)), character code for the encoding, in decimal. 1–3 digits (e.g., 32). May be followed by footnotes. Note that the hexadecimal character code can be discerned from the column and row and hence does not need to be stated. - Parameter
octl: ooo, character code for the encoding, in octal. 3 digits, left-padded with 0 (e.g., 040). If specified,decishould also be. - Parameter
kuten: JIS (men)kuten, GB quwei, KS hangyol or equivalent code (English: (plane-)row-cell, or (plane-)section-position).- This is a important identifier for characters in CJK DBCSs such as JIS X 0208 (more so than e.g.
deci, which is not usually used for a DBCS). - (d(d)-)d(d)-d(d) (two or three numbers of up to two digits each, e.g.,
91-1,2-2-1). Generally numbers 1 through 94 correspond with encoding bytes of either 0x21 through 0x7E, or 0xA1 through 0xFE. - For a lead byte, specify underscores in place of subsequent numbers, this may look something like
16-_. - For visual consistency, may be set to
-for a byte which is not within the lead/trail byte range, but which is in the same line as those which are.
- This is a important identifier for characters in CJK DBCSs such as JIS X 0208 (more so than e.g.
- Parameter
Examples
A few examples:
{| {{chset-tableformat}}
<!-- ctrl4 plus kuten -->
|{{chset-color-misc}}|{{chset-cell-unified|unic=3000|ctrl=[[space character|IDSP]]|deci=33|octl=041|kuten=1-1}}
<!-- ctrl4 -->
|{{chset-color-misc}}|{{chset-cell-unified|unic=00A0|ctrl=[[non-breaking space|NBSP]]|deci=160|octl=240}}
<!-- cell4 plus kuten -->
|{{chset-color-graph}}|{{chset-cell-unified|unic=26E3|char=[[⛣]]|deci=33|octl=041|kuten=91-1}}
<!-- cell4 plus kuten -->
|{{chset-color-graph}}|{{chset-cell-unified|unic=26E3|deci=33|octl=041|kuten=91-1}}
<!-- cell4 -->
|{{chset-color-ext-punct}}|{{chset-cell-unified|unic=00A1|char=[[inverted exclamation mark|¡]]|deci=161|octl=241}}
<!-- cell4 -->
|{{chset-color-ext-punct}}|{{chset-cell-unified|unic=00A1|deci=161|octl=241}}
<!-- ctrl3 plus kuten -->
|{{chset-color-misc}}|{{chset-cell-unified|unic=3000|ctrl=[[space character|IDSP]]|deci=33|kuten=1-1}}
<!-- ctrl3 -->
|{{chset-color-misc}}|{{chset-cell-unified|unic=00A0|ctrl=[[non-breaking space|NBSP]]|deci=160}}
<!-- cell3 plus kuten -->
|{{chset-color-graph}}|{{chset-cell-unified|unic=26E3|char=[[⛣]]|deci=33|kuten=91-1}}
<!-- cell3 plus kuten -->
|{{chset-color-graph}}|{{chset-cell-unified|unic=26E3|deci=33|kuten=91-1}}
<!-- cell3 -->
|{{chset-color-ext-punct}}|{{chset-cell-unified|unic=00A1|char=[[inverted exclamation mark|¡]]|deci=161}}
<!-- cell3 -->
|{{chset-color-ext-punct}}|{{chset-cell-unified|unic=00A1|deci=161}}
<!-- ctrl plus kuten -->
|{{chset-color-misc}}|{{chset-cell-unified|unic=3000|ctrl=[[space character|IDSP]]|kuten=1-1}}
<!-- ctrl -->
|{{chset-color-misc}}|{{chset-cell-unified|unic=00A0|ctrl=[[non-breaking space|NBSP]]}}
<!-- cell plus kuten -->
|{{chset-color-graph}}|{{chset-cell-unified|unic=26E3|char=[[⛣]]|kuten=91-1}}
<!-- cell plus kuten -->
|{{chset-color-graph}}|{{chset-cell-unified|unic=26E3|kuten=91-1}}
<!-- cell -->
|{{chset-color-ext-punct}}|{{chset-cell-unified|unic=00A1|char=[[inverted exclamation mark|¡]]}}
<!-- cell -->
|{{chset-color-ext-punct}}|{{chset-cell-unified|unic=00A1}}
|}
| Template:Sc2 3000 33 041 1-1 |
Template:Sc2 00A0 160 240 |
⛣ 26E3 33 041 91-1 |
⛣ 26E3 33 041 91-1 |
¡ 00A1 161 241 |
¡ 00A1 161 241 |
Template:Sc2 3000 33 1-1 |
Template:Sc2 00A0 160 |
⛣ 26E3 33 91-1 |
⛣ 26E3 33 91-1 |
¡ 00A1 161 |
¡ 00A1 161 |
Template:Sc2 3000 1-1 |
Template:Sc2 00A0 |
⛣ 26E3 91-1 |
⛣ 26E3 91-1 |
¡ 00A1 |
¡ 00A1 |
Chset family of templates
See ISO 8859-1, Windows-1252, and EBCDIC for examples of usage.
- Template:chset-table-header — Header and title row for a 16 column character set table
- Template:chset-table-footer — Footer row for a 16 column character set table
Character row header
- Template:chset-left — Left row code header
Character cell colors
15px Note: if adjusting these colors, reference Template:Chset-table-header/family-test-sheet for a reference of how well they work together, and whether base / variant / boxed / legend colours are properly in sync.
- Template:chset-color-letter — Letter (alphabetic, syllabic or logographic) character cell color (Unicode category L)
- Template:chset-color-digit — Number character cell color (Unicode category N)
- Template:chset-color-graph — Symbol character cell color (Unicode category S)
- Template:chset-color-punct — Punctuation character cell color (Unicode category P)
- Template:chset-color-undef — Undefined/unassigned character cell color
- Template:chset-color-misc — Combining, whitespace or end-user defined character cell color (Unicode category M, Z, Co)
- Template:chset-color-ctrl — Control character cell color (Unicode category Cc, Cf). Currently treated the same as misc.
- Template:chset-color-esc — Lead byte in a multi-byte encoding (not a complete character).
For generating colours for cells by Unicode category, this script may be helpful.
Certain colours are in the process of being phased out:
- Template:chset-color-ext-punct — Extended punctuation character cell color. Intended to represent non-ASCII punctuation, this is not a category used by Unicode (and there are no corresponding ext-digit, ext-graph etc). Currently renders the same as punct.
In addition to these, boxed and slightly shaded variants of these exist in order to indicate some kind of additional information (depending on the article) like, for example, a derivation from a base codepage, a variance of definition of the corresponding codepage in different sources (to be explained in the article) or in different revisions of a code page:
- Template:chset-color-letter-box — Boxed letter character cell color
- Template:chset-color-digit-box — Boxed number character cell color
- Template:chset-color-graph-box — Boxed symbol character cell color
- Template:chset-color-punct-box — Boxed punctuation character cell color
- Template:chset-color-undef-box — Boxed undefined/unassigned character cell color
- Template:chset-color-misc-box — Boxed combining, whitespace or end-user defined character cell color
- Template:chset-color-ctrl-box — Boxed control character cell color
- Template:chset-color-esc-box — Boxed lead byte cell color
- Template:chset-color-ext-punct-box exists, but see the note above.
and
- Template:chset-color-letter-var — Shaded letter character cell color
- Template:chset-color-digit-var — Shaded number character cell color
- Template:chset-color-graph-var — Shaded symbol character cell color
- Template:chset-color-punct-var — Shaded punctuation character cell color
- Template:chset-color-undef-var — Shaded undefined/unassigned character cell color
- Template:chset-color-misc-var — Shaded combining, whitespace or end-user defined character cell color
- Template:chset-color-ctrl-var — Shaded control character cell color
- Template:chset-color-esc-var — Shaded lead byte cell color
- Template:chset-color-ext-punct-var exists, but see the note above
Please note that the boxed variants must not be used, if a cell, which is not to be marked, is surrounded by four cells, which need to be marked, as this would make the central cell appear marked as well. The shaded variants do not exhibit this problem.
For as long as there is no need to differentiate one or a few of the cells in a group from the other cells in the same group, refer to the normal (that is, the non-"box"- or "var"-type) templates further above.
Character cell contents
- Template:chset-cell — Character cell with character + Unicode value
- Template:chset-cell3 — Character cell with character + Unicode value + decimal index
- Template:chset-cell4 — Character cell with character + Unicode value + decimal + octal index
- Template:chset-ctrl — Control character cell with name + Unicode value
- Template:chset-ctrl3 — Control character cell with name + Unicode value + decimal index
- Template:chset-ctrl4 — Control character cell with name + Unicode value + decimal + octal index
- Template:chset-cell-unified — Any of the above, plus optional kuten