json-ld / json-ld.org

JSON for Linked Data's documentation and playground site
https://json-ld.org/
Other
859 stars 152 forks source link

Validate examples #578

Closed gkellogg closed 6 years ago

gkellogg commented 6 years ago

This adds a Ruby script that extracts examples from the 3 specs (soon 2) and validates them for basic syntactic correctness, and to be sure that example titles are not reused.

The rake task also can be used to extract the examples as individual files into the /examples folder.

Next steps will be to validate that the examples actually produce the results described in neighboring examples, or in some other embedded code. Also, these can be used to automatically create YAML versions of the JSON examples.

As a result, some syntactic problems were identified and corrected.

Tests are run automatically on Travis-CI and can be used as the basis of validating PRs. See https://travis-ci.org/json-ld/json-ld.org/branches for example CI run.