Version 0.19.0
🚀 New Features
Added Support for <h4>
, <h5>
, <h6>
, and <hgroup>
Elements
Support for the <h4>
, <h5>
, <h6>
, and <hgroup>
HTML elements has been added, broadening the scope for semantic text structuring and document outline organization.
Usage Examples
Create a section with nested headings using elem.H4()
, elem.H5()
, and elem.H6()
:
sectionContent := elem.Div(nil,
elem.H4(nil, elem.Text("Section Heading Level 4")),
elem.H5(nil, elem.Text("Subsection Heading Level 5")),
elem.H6(nil, elem.Text("Subsubsection Heading Level 6")),
)
This will output:
<div>
<h4>Section Heading Level 4</h4>
<h5>Subsection Heading Level 5</h5>
<h6>Subsubsection Heading Level 6</h6>
</div>
Group headings together semantically using elem.Hgroup()
:
headingGroup := elem.Hgroup(nil,
elem.H1(nil, elem.Text("Main Title")),
elem.H2(nil, elem.Text("Subtitle")),
)
This will output:
<hgroup>
<h1>Main Title</h1>
<h2>Subtitle</h2>
</hgroup>