Skip to content

Commit 770162c

Browse files
committed
Tweak JSON HighlightJS CSS
Update the CSS so that JSON snippets are a little more colorful and align better with the way that GitHub renders them. Closes gh-31
1 parent 5e4400f commit 770162c

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/main/css/highlight.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,12 @@
9494
.hljs-strong {
9595
font-weight: bold;
9696
}
97+
98+
.language-json .hljs-number,
99+
.language-json .hljs-literal {
100+
color: var(--highlight-variable-font-color);
101+
}
102+
103+
.language-json .hljs-attr {
104+
color: var(--highlight-string-font-color);
105+
}

src/test/asciidoc/standard.adoc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,39 @@ Why not have some YAML:
242242
import: "optional:file:./dev.properties"
243243
----
244244

245+
Or JSON:
246+
247+
[source,json,indent=0]
248+
----
249+
{
250+
"glossary" : {
251+
"title" : "example glossary",
252+
"GlossDiv" : {
253+
"title" : "S",
254+
"GlossList" : {
255+
"GlossEntry" : {
256+
"ID" : "SGML",
257+
"SortAs" : "SGML",
258+
"GlossTerm" : "Standard Generalized Markup Language",
259+
"Acronym" : "SGML",
260+
"Thing" : true,
261+
"Size" : 12,
262+
"Abbrev" : "ISO 8879:1986",
263+
"GlossDef" : {
264+
"para" : "A meta-markup language, used to create markup languages such as DocBook.",
265+
"GlossSeeAlso" : [
266+
"GML",
267+
"XML"
268+
]
269+
},
270+
"GlossSee" : "markup"
271+
}
272+
}
273+
}
274+
}
275+
}
276+
----
277+
245278
Or some HTTP that also has `nowrap` set:
246279

247280
[source,http,options="nowrap"]

0 commit comments

Comments
 (0)