amp-validator-prebuilt

0.1.1 • Public • Published

AMP HTML ⚡ Validator

A validator for the AMP HTML format.

This is a very first release, rough on the edges. Fasten your seatbelts.

Prerequisite: Linux Ubuntu 14 or similar, or Mac OS X 10.11.x or later

Mac OS X

See Building a command-line AMP Validator: Mac OS X.

Linux

Install these packages using apt-get:

  • npm
  • nodejs
  • openjdk-7-jre
  • protobuf-compiler
  • python-protobuf
  • python2.7

Then, run build.py. It creates dist/validate, a script which can print AMP HTML validation errors to the console.

$ dist/validate
usage: validate <file.html>
$ dist/validate testdata/minimum_valid_amp.html
PASS
$ touch empty.html
$ dist/validate empty.html
FAIL
empty.html:1:0 The mandatory tag 'html doctype' is missing or
incorrect. [MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'html ⚡ for top-level html' is
missing or incorrect. (see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#ampd)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'head' is missing or incorrect.
(see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#crps)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'link rel=canonical' is missing
or incorrect. (see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#canon)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'meta charset=utf-8' is missing
or incorrect. (see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#chrs)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'meta name=viewport' is missing
or incorrect. (see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#vprt)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'body' is missing or incorrect.
(see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#crps)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'amphtml engine v0.js script' is
missing or incorrect. (see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#scrpt)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'noscript enclosure for
boilerplate' is missing or incorrect. (see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'boilerplate (js enabled)' is
missing or incorrect. (see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]
empty.html:1:0 The mandatory tag 'boilerplate (noscript)' is
missing or incorrect. (see
https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#boilerplate)
[MANDATORY_AMP_TAG_MISSING_OR_INCORRECT]

Readme

Keywords

none

Package Sidebar

Install

npm i amp-validator-prebuilt

Weekly Downloads

2

Version

0.1.1

License

Apache-2.0

Last publish

Collaborators

  • quarterto