Skip to content

Commit

Permalink
New intro and validation error tables for extensions
Browse files Browse the repository at this point in the history
Includes validations for URLs
  • Loading branch information
Meggin committed Feb 16, 2016
1 parent de7c148 commit 0e70820
Show file tree
Hide file tree
Showing 23 changed files with 1,145 additions and 74 deletions.
46 changes: 44 additions & 2 deletions extensions/amp-access/amp-access-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,51 @@ limitations under the License.

### <a name="amp-access-spec"></a>AMP Access Spec

#Background
<table>
<tr>
<td width="40%"><strong>Description</strong></td>
<td>AMP Access or “AMP paywall and subscription support” gives publishers control over which content can be accessed by a reader and with what restrictions, based on the reader’s subscription status, number of views, and other factors.</td>
</tr>
<tr>
<td width="40%"><strong>Availability</strong></td>
<td><a href="/docs/reference/experimental.html">Experimental</a></td>
</tr>
<tr>
<td width="40%"><strong>Required Script</strong></td>
<td><code>&lt;script async custom-element="amp-access" src="https://cdn.ampproject.org/v0/amp-access-0.1.js">&lt;/script></code></td>
</tr>
<tr>
<td width="40%"><strong>Examples</strong></td>
<td><a href="https://github.com/ampproject/amphtml/blob/master/examples/article-access.amp.html">article-access.amp.html</a></td>
</tr>
</table>

The following lists validation errors specific to the `amp-access-spec` tag
(see also `amp-access-spec` in the [AMP validator specification](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii):

AMP Access or “AMP paywall and subscription support” provides control to publishers over what content can be accessed by a reader and with what restrictions,  based on the reader’s subscription status, number of views and so on.
<!---
More validations need to be added once implemented;
this table will change soon.
-->

<table>
<tr>
<th width="40%"><strong>Validation Error</strong></th>
<th>Description</th>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#tag-required-by-another-tag-is-missing">TAG_REQUIRED_BY_MISSING</a></td>
<td>Error thrown when required <code>amp-access-spec</code> extension <code>.js</code> script tag is missing or incorrect.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#mandatory-attribute-missing">MANDATORY_ATTR_MISSING</a></td>
<td>Error thrown when the <code>amp-access-spec</code> extension <code>.json</code> script is missing the mandatory attribute, <code>type</code>.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#invalid-attribute-value">INVALID_ATTR_VALUE</a></td>
<td>Error thrown when the attribute, <code>type</code>, is any value other than the required value: <code>application/json</code>. Error also thrown when the <code>src</code> attribute for the script tag is invalid. The value must be <code>"https://cdn.ampproject.org/v0/amp-access-0.1.js"</code>.</td>
</tr>
</table>

#Solution

Expand Down
39 changes: 37 additions & 2 deletions extensions/amp-analytics/amp-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,42 @@ limitations under the License.

### <a name="amp-analytics"></a>`amp-analytics`

Capture analytics data from an AMP document.
<table>
<tr>
<td width="40%"><strong>Description</strong></td>
<td>Capture analytics data from an AMP document.</td>
</tr>
<tr>
<td width="40%"><strong>Availability</strong></td>
<td>Stable</td>
</tr>
<tr>
<td width="40%"><strong>Required Script</strong></td>
<td><code>&lt;script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js">&lt;/script></code></td>
</tr>
<tr>
<td width="40%"><strong>Examples</strong></td>
<td><a href="https://github.com/ampproject/amphtml/blob/master/examples/analytics.amp.html">analytics.amp.html</a></td>
</tr>
</table>

The following lists validation errors specific to the `amp-analytics` tag
(see also `amp-analytics` in the [AMP validator specification](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii):

<table>
<tr>
<th width="40%"><strong>Validation Error</strong></th>
<th>Description</th>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#tag-required-by-another-tag-is-missing">TAG_REQUIRED_BY_MISSING</a></td>
<td>Error thrown when required <code>amp-analytics</code> extension <code>.js</code> script tag is missing or incorrect.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#invalid-attribute-value">INVALID_ATTR_VALUE</a></td>
<td>Error thrown when the <code>src</code> attribute for the script tag is invalid. The value must be <code>"https://cdn.ampproject.org/v0/amp-analytics-0.1.js"</code>.</td>
</tr>
</table>

#### <a name="behavior"></a>Behavior

Expand Down Expand Up @@ -189,6 +224,7 @@ is an https URL. These values may include placeholder tokens that can reference
```

##### Vars

`amp-analytics` defines many basic variables that can be used in requests. A list of all such variables is available in the [`amp-analytics` Variables Guide](./analytics-vars.md). In addition, all of the variables supported by [AMP HTML Substitutions Guide](../../spec/amp-var-substitutions.md) are also supported.

The `vars` attribute in the configuration can be used to define new key-value pairs or override existing variables that can be referenced in `request` values. New variables are commonly used to specify publisher specific information. Arrays can be used to specify a list of values that should be URL encoded separately while preserving the comma delimiter.
Expand Down Expand Up @@ -283,7 +319,6 @@ Use this configuration to fire a request on a regular time interval. Use `timerS

AMP Access system issues numerous events for different states in the access flow. See [amp-access-analytics.md](../amp-access/amp-access-analytics.md) for details.


##### Transport
The `transport` attribute specifies how to send a request. The value is an object with fields that
indicate which transport methods are acceptable.
Expand Down
49 changes: 48 additions & 1 deletion extensions/amp-anim/amp-anim.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,54 @@ limitations under the License.

### <a name="amp-anim"></a> `amp-anim`

A runtime-managed animated image - most typically a GIF.
<table>
<tr>
<td width="40%"><strong>Description</strong></td>
<td>A runtime-managed animated image, typically a GIF.</td>
</tr>
<tr>
<td width="40%"><strong>Availability</strong></td>
<td>Stable</td>
</tr>
<tr>
<td width="40%"><strong>Required Script</strong></td>
<td><code>&lt;script async custom-element="amp-anim" src="https://cdn.ampproject.org/v0/amp-anim-0.1.js">&lt;/script></code></td>
</tr>
<tr>
<td width="40%"><strong>Examples</strong></td>
<td><a href="https://github.com/ampproject/amphtml/blob/master/examples/everything.amp.html">everything.amp.html</a></td>
</tr>
</table>

The following lists validation errors specific to the `amp-anim` tag
(see also `amp-anim` in the [AMP validator specification](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii):

<table>
<tr>
<th width="40%"><strong>Validation Error</strong></th>
<th>Description</th>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#tag-required-by-another-tag-is-missing">TAG_REQUIRED_BY_MISSING</a></td>
<td>Error thrown when required <code>amp-anim</code> extension <code>.js</code> script tag is missing or incorrect.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#mandatory-attribute-missing">MANDATORY_ONEOF_ATTR_MISSING</a></td>
<td>Error thrown when neither <code>src</code> or <code>srcset</code> is included. One of these attributes is mandatory.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#implied-layout-isnt-supported-by-amp-tag">IMPLIED_LAYOUT_INVALID</a></td>
<td>Error thrown when implied layout is set to <code>CONTAINER</code>; this layout type isn't supported.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#specified-layout-isnt-supported-by-amp-tag">SPECIFIED_LAYOUT_INVALID</a></td>
<td>Error thrown when specified layout is set to <code>CONTAINER</code>; this layout type isn't supported.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#invalid-property-value">INVALID_PROPERTY_VALUE_IN_ATTR_VALUE</a></td>
<td>Error thrown when invalid value is given for attributes <code>height</code> or <code>width</code>. For example, <code>height=auto</code> triggers this error for all supported layout types, with the exception of <code>NODISPLAY</code>.</td>
</tr>
</table>

#### Behavior

Expand Down
65 changes: 62 additions & 3 deletions extensions/amp-audio/amp-audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,72 @@ limitations under the License.

### <a name="amp-audio"></a> `amp-audio`

A replacement for the HTML5 `audio` tag. Like all embedded external resources in a AMP file, the audio is lazily loaded only when the `amp-audio` element is in or near the viewport.
<table>
<tr>
<td width="40%"><strong>Description</strong></td>
<td>A replacement for the HTML5 <code>audio</code> tag. The <code>amp-audio</code> component is only to be used for direct HTML5 audio file embeds.</td>
</tr>
<tr>
<td width="40%"><strong>Availability</strong></td>
<td>Stable</td>
</tr>
<tr>
<td width="40%"><strong>Required Script</strong></td>
<td><code>&lt;script async custom-element="amp-audio" src="https://cdn.ampproject.org/v0/amp-audio-0.1.js">&lt;/script></code></td>
</tr>
<tr>
<td width="40%"><strong>Examples</strong></td>
<td><a href="https://github.com/ampproject/amphtml/blob/master/examples/everything.amp.html">everything.amp.html</a></td>
</tr>
</table>

The following lists validation errors specific to the `amp-audio` tag
(see also `amp-audio` in the [AMP validator specification](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii):

The `amp-audio` component is only to be used for direct HTML5 audio file embeds.
<!---
What does fixed height and fixed width mean for audio layout?
May need to add something to this table based on technical review.
-->

<table>
<tr>
<th width="40%"><strong>Validation Error</strong></th>
<th>Description</th>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#tag-required-by-another-tag-is-missing">TAG_REQUIRED_BY_MISSING</a></td>
<td>Error thrown when required <code>amp-audio</code> extension <code>.js</code> script tag is missing or incorrect.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#mandatory-tag-ancestor-with-hint">MANDATORY_TAG_ANCESTOR_WITH_HINT</a></td>
<td>Error thrown if your AMP document uses <code>audio</code> instead of <code>amp-audio</code>. Error message: The tag <code>audio</code> may only appear as a descendant of tag <code>noscript</code>. Did you mean <code>amp-audio</code>?</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#missing-url">MISSING_URL</a></td>
<td>Error thrown when <code>src</code> attribute is missing it's URL.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#invalid-url">INVALID_URL</a></td>
<td>Error thrown when <code>src</code> attribute's URL is invalid.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#invalid-url-protocol">INVALID_URL_PROTOCOL</a></td>
<td>Error thrown <code>src</code> attribute's URL is <code>http</code>; <code>https</code> protocol required.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#implied-layout-isnt-supported-by-amp-tag">IMPLIED_LAYOUT_INVALID</a></td>
<td>Error thrown when implied layout is set to <code>RESPONSIVE</code>, <code>FILL</code>, or <code>CONTAINER</code>; these layout types aren't supported.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#specified-layout-isnt-supported-by-amp-tag">SPECIFIED_LAYOUT_INVALID</a></td>
<td>Error thrown when specified layout is set to <code>RESPONSIVE</code>, <code>FILL</code>, or <code>CONTAINER</code>; these layout types aren't supported.</td>
</tr>
</table>

#### Behavior

The `amp-audio` component loads the audio resource specified by its `src` attribute lazily, at a time determined by the runtime. It can be controlled much the same way as a standard HTML5 `audio` tag.
The `amp-audio` component loads the audio resource specified by its `src` attribute at a time determined by the runtime. It can be controlled in much the same way as a standard HTML5 `audio` tag.
Like all embedded external resources in an AMP file, the audio is "lazily" loaded, only when the `amp-audio` element is in or near the viewport.

The `amp-audio` component HTML accepts up to three unique types of HTML nodes as children - `source` tags, a placeholder for before the audio starts, and a fallback if the browser doesn’t support HTML5 audio.

Expand Down
56 changes: 53 additions & 3 deletions extensions/amp-brightcove/amp-brightcove.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,61 @@ limitations under the License.

### <a name="amp-brightcove"></a> `amp-brightcove`

An `amp-brightcove` component displays the Brightcove Player as used in Brightcove's [Video Cloud](https://www.brightcove.com/en/online-video-platform) or [Perform](https://www.brightcove.com/en/perform) products.
<table>
<tr>
<td width="40%"><strong>Description</strong></td>
<td>An <code>amp-brightcove</code> component displays the Brightcove Player as used in Brightcove's <a href="https://www.brightcove.com/en/online-video-platform">Video Cloud</a> or <a href="https://www.brightcove.com/en/perform">Perform</a> products.</td>
</tr>
<tr>
<td width="40%"><strong>Availability</strong></td>
<td>Stable</td>
</tr>
<tr>
<td width="40%"><strong>Required Script</strong></td>
<td><code>&lt;script async custom-element="amp-brightcove" src="https://cdn.ampproject.org/v0/amp-brightcove-0.1.js">&lt;/script></code></td>
</tr>
<tr>
<td width="40%"><strong>Examples</strong></td>
<td><a href="https://github.com/ampproject/amphtml/blob/master/examples/brightcove.amp.html">brightcove.amp.html</a></td>
</tr>
</table>

The following lists validation errors specific to the `amp-brightcove` tag
(see also `amp-brightcove` in the [AMP validator specification](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii):

<table>
<tr>
<th width="40%"><strong>Validation Error</strong></th>
<th>Description</th>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#tag-required-by-another-tag-is-missing">TAG_REQUIRED_BY_MISSING</a></td>
<td>Error thrown when required <code>amp-brightcove</code> extension <code>.js</code> script tag is missing or incorrect.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#mandatory-attribute-missing">MANDATORY_ATTR_MISSING</a></td>
<td>Error thrown when <code>data-account</code> attribute is missing.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#implied-layout-isnt-supported-by-amp-tag">IMPLIED_LAYOUT_INVALID</a></td>
<td>Error thrown when implied layout is set to <code>CONTAINER</code>; this layout type isn't supported.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#specified-layout-isnt-supported-by-amp-tag">SPECIFIED_LAYOUT_INVALID</a></td>
<td>Error thrown when specified layout is set to <code>CONTAINER</code>; this layout type isn't supported.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#invalid-property-value">INVALID_PROPERTY_VALUE_IN_ATTR_VALUE</a></td>
<td>Error thrown when invalid value is given for attributes <code>height</code> or <code>width</code>. For example, <code>height=auto</code> triggers this error for all supported layout types, with the exception of <code>NODISPLAY</code>.</td>
</tr>
</table>

#### Example

The `width` and `height` attributes determine the aspect ratio of the player embedded in responsive layouts.

Example:

```html
<amp-brightcove
data-account="12345"
Expand All @@ -30,8 +82,6 @@ Example:
</amp-brightcove>
```

The width and height will determine the aspect ratio of the player embed in responsive layouts.

#### Attributes

**data-account**
Expand Down
50 changes: 49 additions & 1 deletion extensions/amp-carousel/amp-carousel.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,55 @@ limitations under the License.

### <a name="amp-carousel"></a> `amp-carousel`

A generic carousel for displaying multiple similar pieces of content along a horizontal axis. It is meant to be highly flexible and performant.
<table>
<tr>
<td width="40%"><strong>Description</strong></td>
<td>A generic carousel for displaying multiple similar pieces of content along a horizontal axis; meant to be highly flexible and performant.</td>
</tr>
<tr>
<td width="40%"><strong>Availability</strong></td>
<td>Stable</td>
</tr>
<tr>
<td width="40%"><strong>Required Script</strong></td>
<td><code>&lt;script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js">&lt;/script></code></td>
</tr>
<tr>
<td width="40%"><strong>Examples</strong></td>
<td><a href="https://github.com/ampproject/amphtml/blob/master/examples/everything.amp.html">everything.amp.html</a></td>
</tr>
</table>

The following lists validation errors specific to the `amp-carousel` tag
(see also `amp-carousel` in the [AMP validator specification](https://github.com/ampproject/amphtml/blob/master/validator/validator.protoascii):

<!---
Check for valid HTTPS URL coming soon;
this table will need to change too.
-->

<table>
<tr>
<th width="40%"><strong>Validation Error</strong></th>
<th>Description</th>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#tag-required-by-another-tag-is-missing">TAG_REQUIRED_BY_MISSING</a></td>
<td>Error thrown when required <code>amp-carousel</code> extension <code>.js</code> script tag is missing or incorrect.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#implied-layout-isnt-supported-by-amp-tag">IMPLIED_LAYOUT_INVALID</a></td>
<td>Error thrown when implied layout is set to <code>CONTAINER</code>; this layout type isn't supported.</td>
</tr>
<tr>
<td width="40%"><a href="/docs/reference/validation_errors.html#specified-layout-isnt-supported-by-amp-tag">SPECIFIED_LAYOUT_INVALID</a></td>
<td>Error thrown when specified layout is set to <code>CONTAINER</code>; this layout type isn't supported.</td>
</tr>
<tr>
<td width="40%"><code>Layout not supported for: responsive</code></td>
<td>Error thrown when layout set to <code>RESPONSIVE</code> and the <code>type</code> attribute is set to (or defaults to) <code>carousel</code>.</td>
</tr>
</table>

#### Behavior

Expand Down
16 changes: 14 additions & 2 deletions extensions/amp-dynamic-css-classes/amp-dynamic-css-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ limitations under the License.

### <a name="amp-dynamic-css-classes"></a> AMP Dynamic CSS Classes

The AMP Dynamic CSS Classes extension adds several dynamic CSS class
names onto the HTML element.
<table>
<tr>
<td width="40%"><strong>Description</strong></td>
<td>Adds several dynamic CSS class names onto the HTML element.</td>
</tr>
<tr>
<td width="40%"><strong>Availability</strong></td>
<td><a href="/docs/reference/experimental.html">Experimental</a></td>
</tr>
<tr>
<td width="40%"><strong>Examples</strong></td>
<td>None</td>
</tr>
</table>

#### Behavior

Expand Down
Loading

0 comments on commit 0e70820

Please sign in to comment.