Skip to content

Instantly share code, notes, and snippets.

@flavioespinoza
Last active October 22, 2019 01:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flavioespinoza/a881e24d2265b7b552473ba075d7b937 to your computer and use it in GitHub Desktop.
Save flavioespinoza/a881e24d2265b7b552473ba075d7b937 to your computer and use it in GitHub Desktop.

Show JSON with Comments

Render JSON with comments in Github by changing code block language definition from json to jsonc


change this:

```json

```

to this:

```jsonc

```

code block defined as json

{
  // Comment ..............
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/2018/credentials/examples/v1"
  ],
  // Comment ..............
  "id": "http://example.edu/credentials/3732",
  "type": ["VerifiableCredential", "UniversityDegreeCredential"],
  "issuer": "https://example.edu/issuers/14",
  "issuanceDate": "2010-01-01T19:23:24Z",
  "credentialSubject": {
    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
    "degree": {
      "type": "BachelorDegree", // Comment ..............
      "name": "Bachelor of Science and Arts"
    }
  },
  "credentialSchema": {
    "id": "https://example.org/examples/degree.json",
    "type": "JsonSchemaValidator2018"
  },
  "proof": {}
}

code block defined as jsonc

{
  // Comment ..............
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/2018/credentials/examples/v1"
  ],
  // Comment ..............
  "id": "http://example.edu/credentials/3732",
  "type": ["VerifiableCredential", "UniversityDegreeCredential"],
  "issuer": "https://example.edu/issuers/14",
  "issuanceDate": "2010-01-01T19:23:24Z",
  "credentialSubject": {
    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
    "degree": {
      "type": "BachelorDegree", // Comment ..............
      "name": "Bachelor of Science and Arts"
    }
  },
  "credentialSchema": {
    "id": "https://example.org/examples/degree.json",
    "type": "JsonSchemaValidator2018"
  },
  "proof": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment