Documentation
¶
Overview ¶
Package article provides constructors and methods for the HTML <article> element.
The <article>: The Article Contents element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication). Examples include: a forum post, a magazine or newspaper article, or a blog entry, a product card, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<article") TagClose = []byte("</article>") )
Byte constants for HTML rendering.
Functions ¶
func New ¶
New creates a new article element with optional child nodes Example: article.New() Renders: <article></article>
func RawText ¶
func RawText(str string) *element
RawText creates a new article element with raw text content. Uses text.RawText which is not HTML-escaped. Example: article.RawText("<h2>Title</h2><p>Content</p>") Renders: <article><h2>Title</h2><p>Content</p></article>
func RawTextf ¶
RawTextf creates a new article element with formatted raw text content. Uses text.RawTextf which is not HTML-escaped. Example: article.RawTextf("<h2>%s</h2>", headline) Renders: <article><h2>Breaking News</h2></article>
func Static ¶
func Static(str string) *element
Static creates a new article element with static text content. Uses text.Static which is not HTML-escaped and is JIT-optimisable. Example: article.Static("Breaking News") Renders: <article>Breaking News</article>