Template:Classed heading/doc

Usage
This generates a HTML heading element for use in applying semantically-correct headings to works when  is insufficient (perhaps because you want to apply a class, or have multiple lines).

It explicitly has no support for direct CSS formatting: it is designed for use with classes and/or index-specific CSS.

By default, the headings have the normal MediaWiki font sizes for headings, but are centred, not bolded and do not have an underline.


 * The heading level (default: 2)
 * Optional CSS classes (use this if you have multiple heading styles in a single work). The top-level heading element always has class  as well as additional classes.
 * Optional ID (used as an anchor). If not given the contents of the first line is used. This parameter should also be used to add an suitable simple id, if markup or complex formatting is used in the first line (such as a footnote directly associated with the heading.)
 * ,, etc. The lines of the header. Each line is in a span under the default span with class  and can be targeted with   as needed.

Common CSS examples
There are a few common styling choices you may wish to replicate. You can target specific levels using the  tag names.

Margin/leading underneath the heading
Example: Page:Ayn Rand Anthem.pdf/21 (using Index:Ayn Rand Anthem.pdf/styles.css)

Small-caps for the second line onwards
Also consider  if you want Proper Nouns to appear in "all small caps", including the first letters: e.g..

Left-aligned titles
Example: Page:The Sundering Flood - Morris - 1898.djvu/15 (using Index:The Sundering Flood - Morris - 1898.djvu/styles.css)

Template data
{	"params": { "1": {			"label": "1", "description": "First line of heading", "example": "Chapter 1", "type": "line", "required": true },		"2": {			"label": "2", "description": "Second line of the heading", "example": "Down the Rabbit-Hole", "type": "line" },		"class": { "label": "class", "description": "Optional class to use to target specific CSS", "example": "chapter_heading", "type": "line" },		"id": { "label": "id", "description": "ID of the header - can be used for linking to sections", "example": "chapter1", "default": "Contents of the first line (parameter 1)" },		"level": { "aliases": [ "l" ],			"label": "level", "description": "The level of the heading (1 is the \"biggest\" heading)", "example": "3", "type": "number", "default": "3", "suggested": true }	},	"description": "Add an HTML header with optional classes", "paramOrder": [ "level", "1",		"2",		"class", "id" ],	"format": "inline" }