Bản mẫu:NFPA 704 diamond/doc

This template produces a NFPA 704 fire diamond 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.

**Parameters**

**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)**
}, , 
1==0 
1==1 
1==2 
1==3 
1==4 
1==- (hyphen)
S=-
S=-
S=-
S=-
S=-
S=-
Parameters , ,  accept codes 0, 1, 2, 3, 4, -. Code - (hyphen) produces a blank ("no hazard code").
A blank can be set (enforced) by entering 1==-, 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 1==- (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 =&nbsp; code produces an error, but entering the nbsp character (>1== W enter W.
For W OX 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 Articles with unknown NFPA 704 code. Other pages (like this documentation) are not categorized, but have a message instead. This categorizing can be switched off by setting no
Note that =&nbsp; code produces an error, but entering the nbsp character (= ) is accepted as a space (blank).

**Adding references**
References can be added using .

The  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).

**List of codes Code description**

**Color style**
Option 2=green. Default is 1=transparent.
Colors used
Better not to use RGB colors named blue, red, yellow, 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 °C - °F temperatures? (Currently, °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.

**Tracking category**
 Articles with unknown NFPA 704 code

**See also**
 :File:NFPA 704.svg -- The background diamond image- NFPA 704 -- in a stand alone box- NFPA 704 diamond/text
The references are from the demos in this documentation.