Clean up examples to be more consistent.
authorDavid I. Lehn <dlehn@digitalbazaar.com>
Sun, 22 Jan 2012 18:32:12 -0500
changeset 357 4019a84753b8
parent 356 4712dec9cb19
child 358 69113cc66f9b
Clean up examples to be more consistent.

- Add padding spaces inside {} and [].
- Start multi-line {} and [] on their own line.
- Don't indent values in just a few examples. If example values are
going to indented, it should be done in the whole document.
spec/latest/json-ld-syntax/index.html
--- a/spec/latest/json-ld-syntax/index.html	Sun Jan 22 15:45:41 2012 -0500
+++ b/spec/latest/json-ld-syntax/index.html	Sun Jan 22 18:32:12 2012 -0500
@@ -1027,9 +1027,11 @@
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  ****"@context": {
+  ****"@context":
+  {
     "xsd": "http://www.w3.org/2001/XMLSchema#",
-    "modified": {
+    "modified":
+    {
       "@id": "http://purl.org/dc/terms/modified",
       "@type": "xsd:dateTime"
     }
@@ -1047,7 +1049,8 @@
 <!--
 {
 ...
-  "modified": ****{
+  "modified":
+  ****{
     "@value": "2010-05-29T14:17:39+02:00",
     "@type": "xsd:dateTime"
   }****
@@ -1081,7 +1084,8 @@
 {
 ...
   "@id": "http://example.org/people#joebob",
-  "age": ****{
+  "age":
+  ****{
     "@value": "31",
     "@type": "http://www.w3.org/2001/XMLSchema#integer"
   }****
@@ -1156,8 +1160,8 @@
   "@id": "http://example.org/articles/8",
   "dc:title": ****
   [
-    {"@value": "Das Kapital", "@language": "de"},
-    {"@value": "Capital", "@language": "en"}
+    { "@value": "Das Kapital", "@language": "de" },
+    { "@value": "Capital", "@language": "en" }
   ]****
 }-->
 </pre>
@@ -1222,13 +1226,15 @@
   <pre class="example" data-transform="updateExample">
   <!--
   {
-    ****"@context": {
+    ****"@context":
+    {
       ...
-      "nick": {
+      "nick":
+      {
         "@id": "http://xmlns.com/foaf/0.1/nick",
         "@list": true
       }
-  }****,
+    }****,
   ...
     "@id": "http://example.org/people#joebob",
     "nick": ****[ "joe", "bob", "jaybee" ]****,
@@ -1317,18 +1323,21 @@
   <pre class="example" data-transform="updateExample">
 <!--
 {
-  "@context": {
+  "@context":
+  {
     ****"dc": "http://purl.org/dc/elements/1.1/",****
     ****"ex": "http://example.org/vocab#"****
   },
   "@id": "http://example.org/library",
   "@type": ****"ex:Library"****,
-  ****"ex:contains"****: {
+  ****"ex:contains"****:
+  {
     "@id": "http://example.org/library/the-republic",
     "@type": ****"ex:Book"****,
     ****"dc:creator"****: "Plato",
     ****"dc:title"****: "The Republic",
-    ****"ex:contains"****: {
+    ****"ex:contains"****:
+    {
       "@id": "http://example.org/library/the-republic#introduction",
       "@type": ****"ex:Chapter"****,
       ****"dc:description"****: "An introductory chapter on The Republic.",
@@ -1571,9 +1580,10 @@
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "@context": {
-    "foaf": ****{"@id": "http://xmlns.com/foaf/0.1/"}****,
-    "name": ****{"@id": "http://xmlns.com/foaf/0.1/name"}****,
+  "@context":
+  {
+    "foaf": ****{ "@id": "http://xmlns.com/foaf/0.1/" }****,
+    "name": ****{ "@id": "http://xmlns.com/foaf/0.1/name" }****,
     "homepage": ****{ "@id": "foaf:homepage" }****,
     "depiction": ****{ "@id": "foaf:depiction" }****
   },
@@ -1697,11 +1707,12 @@
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "@context": {
+  "@context":
+  {
     ****"xsd": "http://www.w3.org/2001/XMLSchema#"****,
     "name": "http://xmlns.com/foaf/0.1/name",
-    "age": {"@id": "http://xmlns.com/foaf/0.1/age", "@type": ****"xsd:integer"****},
-    "homepage": {"@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id"}
+    "age": { "@id": "http://xmlns.com/foaf/0.1/age", "@type": ****"xsd:integer"**** },
+    "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" }
   },
   ...
 }
@@ -1722,8 +1733,8 @@
     ****"foaf": "http://xmlns.com/foaf/0.1/"****,
     "xsd": "http://www.w3.org/2001/XMLSchema#",
     "name": ****"foaf:name"****,
-    "age": {"@id": ****"foaf:age"****, "@type": xsd:integer"},
-    "homepage": {"@id": ****"foaf:homepage"****, "@type": "@id"}
+    "age": { "@id": ****"foaf:age"****, "@type": "xsd:integer" },
+    "homepage": { "@id": ****"foaf:homepage"****, "@type": "@id" }
   },
   ...
 }
@@ -1742,7 +1753,7 @@
     ****"foaf": "http://xmlns.com/foaf/0.1/"****,
     "xsd": "http://www.w3.org/2001/XMLSchema#",
     "name": "foaf:name",
-    "****foaf:age****": {"@id": "foaf:age", "@type": xsd:integer"},
+    "****foaf:age****": { "@id": "foaf:age", "@type": "xsd:integer" },
     "****foaf:homepage****": ****{ "@type": "@id" }****
   },
   ...
@@ -1773,7 +1784,7 @@
     "foaf": "http://xmlns.com/foaf/0.1/",
     "xsd": "http://www.w3.org/2001/XMLSchema#",
     "name": "foaf:name",
-    "foaf:age": {"@id": "foaf:age", "@type": xsd:integer"},
+    "foaf:age": { "@id": "foaf:age", "@type": "xsd:integer" },
     "****http://xmlns.com/foaf/0.1/homepage****": { "@type": "@id" }
   },
   ...
@@ -1803,8 +1814,8 @@
 {
   "@context":
   {
-    ****"term1": {"@id": "term2:foo"},
-    "term2": {"@id": "term1:bar"}****
+    ****"term1": { "@id": "term2:foo" },
+    "term2": { "@id": "term1:bar" }****
   },
   ...
 }
@@ -1828,7 +1839,8 @@
   {
   ...
     "name": "Manu Sporny",
-    "****knows****": {
+    "****knows****":
+    {
       "****@type****": "****Person****",
       "****name****": "****Gregg Kellogg****",
     }
@@ -1945,13 +1957,14 @@
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "@context": {
-    "foaf":   "http://xmlns.com/foaf/0.1/"
+  "@context":
+  {
+    "foaf": "http://xmlns.com/foaf/0.1/"
   },
-  "@id":            "http://manu.sporny.org/i/public",
-  "@type":          "foaf:Person",
-  "foaf:name":      "Manu Sporny",
-  "foaf:homepage":  { "@id": "http://manu.sporny.org/" }
+  "@id": "http://manu.sporny.org/i/public",
+  "@type": "foaf:Person",
+  "foaf:name": "Manu Sporny",
+  "foaf:homepage": { "@id": "http://manu.sporny.org/" }
 }
 -->
 </pre>
@@ -1963,13 +1976,14 @@
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "@context": {
-    ****"":       "http://manu.sporny.org/",****
-    "foaf":   "http://xmlns.com/foaf/0.1/"
+  "@context":
+  {
+    ****"": "http://manu.sporny.org/",****
+    "foaf": "http://xmlns.com/foaf/0.1/"
   },
-  "@id":            ****":i/public"****,
-  "@type":          "foaf:Person",
-  "foaf:name":      "Manu Sporny",
+  "@id": ****":i/public"****,
+  "@type": "foaf:Person",
+  "foaf:name": "Manu Sporny",
   "foaf:homepage":  { "@id": ****":" ****}
 }
 -->
@@ -1997,15 +2011,17 @@
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "@context": {
-    "foaf":   "http://xmlns.com/foaf/0.1/"
+  "@context":
+  {
+    "foaf": "http://xmlns.com/foaf/0.1/"
   },
-  "@id":            "http://manu.sporny.org/i/public",
-  "@type":          "foaf:Person",
-  "foaf:name":      "Manu Sporny",
-  "foaf:knows": {
-    "@type":        "foaf:Person",
-    "foaf:name":    "Gregg Kellogg"
+  "@id": "http://manu.sporny.org/i/public",
+  "@type": "foaf:Person",
+  "foaf:name": "Manu Sporny",
+  "foaf:knows":
+  {
+    "@type": "foaf:Person",
+    "foaf:name": "Gregg Kellogg"
   }
 }
 -->
@@ -2020,20 +2036,21 @@
 
 <http://example.org/people#joebob> a foaf:Person;
   foaf:name "Joe Bob";
-  foaf:nick ( "joe" "bob" "jaybee") .
+  foaf:nick ( "joe" "bob" "jaybee" ) .
 -->
 </pre>
 
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "@context": {
-    "foaf":   "http://xmlns.com/foaf/0.1/"
+  "@context":
+  {
+    "foaf": "http://xmlns.com/foaf/0.1/"
   },
-  "@id":        "http://example.org/people#joebob",
-  "@type":      "foaf:Person",
-  "foaf:name":  "Joe Bob",
-  "foaf:nick":  { "@list": [ "joe", "bob", "jaybe" ] }
+  "@id": "http://example.org/people#joebob",
+  "@type": "foaf:Person",
+  "foaf:name": "Joe Bob",
+  "foaf:nick": { "@list": [ "joe", "bob", "jaybe" ] }
 }
 -->
 </pre>
@@ -2073,7 +2090,8 @@
 <!--
 {
   "@context": { "foaf": "http://xmlns.com/foaf/0.1/" },
-  "@id": [
+  "@id":
+  [
     {
       "@id": "_:bnode1",
       "@type": "foaf:Person",
@@ -2124,7 +2142,7 @@
   "@context":
   {
     "vcard": "http://microformats.org/profile/hcard#vcard",
-    "url": {"@id": "http://microformats.org/profile/hcard#url", "@type": "@id"},
+    "url": { "@id": "http://microformats.org/profile/hcard#url", "@type": "@id" },
     "fn": "http://microformats.org/profile/hcard#fn"
   },
   "@id": "_:bnode1",