Documentation ¶
Overview ¶
Package layout applies the AMP layout algorithm to a custom element (prefixed with "amp-").
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyLayout ¶
ApplyLayout applies the AMP layout algorithm to the given custom element (prefixed with "amp-"), by performing the same calculations that the AMP runtime would perform, and recording the results in the style attribute. Returns an error if the layout isn't supported.
<amp-audio> is an exception because it requires knowing the dimensions of the browser. Therefore no layout is applied to it. Also, any descendants of <template> are ignored.
func ParseAMPLayout ¶
func ParseAMPLayout(n *html.Node) amppb.AmpLayout_Layout
Parses the layout attribute value of the given node and returns the corresponding AmpLayout_Layout enum.
Types ¶
This section is empty.