Skip to content

Commit f87355c

Browse files
Merge pull request #247 from FormidableLabs/208-add-json-to-the-default-included-languages
add json to the default included languages
2 parents e35950e + c5f2b5d commit f87355c

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.changeset/sweet-kiwis-shop.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"prism-react-renderer": minor
3+
---
4+
5+
'Add JSON as default supported language'

packages/demo/src/sample-code.ts

+27
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,31 @@ impl GroceryItem {
206206
}
207207
`,
208208
},
209+
["JSON"]: {
210+
language: "json",
211+
code: `
212+
{
213+
"id": 1,
214+
"name": "John Doe",
215+
"email": "johndoe@example.com",
216+
"address": {
217+
"street": "123 Main St",
218+
"city": "San Diego",
219+
"state": "CA",
220+
"zip": "12345"
221+
},
222+
"phoneNumbers": [
223+
{
224+
"type": "home",
225+
"number": "555-123-4567"
226+
},
227+
{
228+
"type": "work",
229+
"number": "555-901-2345"
230+
}
231+
],
232+
"interests": ["reading", "hiking", "coding"]
233+
}
234+
`,
235+
},
209236
}

packages/generate-prism-languages/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const languagesToBundle = <const>[
2222
"cpp",
2323
"markdown",
2424
"python",
25+
"json",
2526
]
2627

2728
/**

0 commit comments

Comments
 (0)