layout

package
v0.0.0-...-a20b76d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

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

func ApplyLayout(n *html.Node) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL