Template:NFPA 704 diamond/doc

This template produces a NFPA 704 safety square with optionally four hazard codes. It is designed to be used in a table.

Primary use is through Chembox, the NFPA 704 box and OrganicBox complete (chemical data pages).

When used stand-alone (outside of a table), consider the NFPA 704 box.

Input options
Main rule: if the quarter must be blank, input is the hyphen, -. Do not depend on default behavior in this situation.

Basic 0–4 and - (hyphen)
Parameters H, F, I accept codes. Code  (hyphen) produces a blank ("no hazard code").

A blank can be set (enforced) by entering =-, a hyphen. This is the preferred way to reflect what the source states (don't depend on the default blank in this situation).

Default code (blank)
All four codes default to blank, that is: no NFPA code is present or shown. There is no specific text (just a link to the NFPA color section). Note that a blank is not the same as code "0". Code "0" is an explicit statement, while a blank is the absence of any statement.

A blank can also be enforced by entering =- (hyphen). This is the preferred way to reflect what the source states (do not depend on default).

From the input, spaces and even newlines (all whitespace) are treated as blank. Note that  code produces an error, but entering the nbsp character (>= <) is accepted as a space (blank).

Special hazard options
For  enter W.

For  enter W+OX, W OX or WOX.

The "Special" quarter is sometimes called "Other".

Unknown codes (error)
The diamond template checks for unknown codes.

Articles with unknown codes are listed for maintenance (correction) in. Other pages (like this documentation) are not categorized, but have a message instead. This categorizing can be switched off by setting no

Note that  code produces an error, but entering the nbsp character (= ) is accepted as a space (blank).

Adding references
References can be added using ref.



The &lt;ref> ... &lt;/ref> tags should be added. Multiple references can be entered. Depending on cell width, the links show above or next to the diamond. While technically possible to enter plain text, this is not supported (and this could be disallowed in the future).

Color style

 * Option background. Default is transparent.

Colors used

Better not to use RGB colors named, because these produce a bad contrast with the text.

Template data
{	"params": { "ref": {}, "background": {}, "H": { "suggestedvalues": [ "0, 1, 2, 3, 4, -"			],			"label": "Health (blue)", "type": "string" },		"F": { "suggestedvalues": [ "0, 1, 2, 3, 4, -"			],			"label": "Flammability (red)", "type": "string" },		"I": { "aliases": [ "R" ],			"type": "string", "suggestedvalues": [ "0, 1, 2, 3, 4, -"			],			"label": "Instability, Reactivity (yellow)" },		"S": { "label": "Special code (white)", "type": "string", "suggestedvalues": [ " OX, W, WOX, W+OX, ACID, ALK, BIO, COR, CRYO, RA" ]		},		"showimage": { "description": "shows S image when available", "type": "boolean" },		"cat": {} },	"paramOrder": [ "H", "F", "I", "S", "background", "ref", "showimage", "cat" ] }

Known issues

 * Is there an ENGVAR-like switch needed, eg for the order of &deg;C - &deg;F temperatures? (Currently, &deg;C is first)
 * For documentation, could use a diamond with the four letters in the quadrants.
 * The non-standard S (on white) codes should be complete, and maybe listed for attention.