Skip to content

Commit 73f884f

Browse files
committed
add code blocks to test syntax hl in other lgs
1 parent 9ae56ef commit 73f884f

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed

doc/tests/adoc-features.adoc

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,127 @@ Asciidoctor also supports callouts and titles:
7373
<1> a docstring comes before the arguments
7474
<2> check with an earthling if uppercasing is soothing
7575

76+
What about syntax highlighting for other languages/formats?
77+
78+
.java
79+
[source,java]
80+
----
81+
public class HelloWorld {
82+
public static void main(String[] args) {
83+
System.out.println("Hello, World");
84+
}
85+
}
86+
87+
----
88+
89+
.javascript
90+
[source,javascript]
91+
----
92+
console.log('Hello, World!');
93+
----
94+
95+
.groovy
96+
[source,groovy]
97+
----
98+
class HelloWorld {
99+
static void main(String[] args) {
100+
println "Hello, World!"
101+
}
102+
}
103+
104+
----
105+
106+
.html
107+
[source,html]
108+
----
109+
<!DOCTYPE html>
110+
<html>
111+
<body>
112+
113+
<h1>Hello World!</h1>
114+
<p>How's it going?</p>
115+
116+
</body>
117+
</html>
118+
----
119+
120+
How about some common data encodings?
121+
Cribbed from https://tennen.medium.com/xml-json-toml-yaml-which-one-is-the-secret-key-to-your-data-success-bc2895d609ae
122+
123+
.xml
124+
[source,xml]
125+
----
126+
<album>
127+
<title>The Symphony of Sounds</title>
128+
<artist>The Virtuosos</artist>
129+
<year>2022</year>
130+
<tracks>
131+
<track>
132+
<title>Overture of Efficiency</title>
133+
<duration>4:30</duration>
134+
</track>
135+
<track>
136+
<title>Ballad of Simplicity</title>
137+
<duration>5:20</duration>
138+
</track>
139+
</tracks>
140+
</album>
141+
----
142+
143+
.json
144+
[source,json]
145+
----
146+
{
147+
"album": {
148+
"title": "The Symphony of Sounds",
149+
"artist": "The Virtuosos",
150+
"year": 2022,
151+
"tracks": [
152+
{
153+
"title": "Overture of Efficiency",
154+
"duration": "4:30"
155+
},
156+
{
157+
"title": "Ballad of Simplicity",
158+
"duration": "5:20"
159+
}
160+
]
161+
}
162+
}
163+
----
164+
165+
.yaml
166+
[source,yaml]
167+
-----
168+
album:
169+
title: The Symphony of Sounds
170+
artist: The Virtuosos
171+
year: 2022
172+
tracks:
173+
- title: Overture of Efficiency
174+
duration: 4:30
175+
- title: Ballad of Simplicity
176+
duration: 5:20
177+
-----
178+
179+
.toml
180+
[source,toml]
181+
----
182+
[album]
183+
title = "The Symphony of Sounds"
184+
artist = "The Virtuosos"
185+
year = 2022
186+
187+
[[album.tracks]]
188+
title = "Overture of Efficiency"
189+
duration = "4:30"
190+
191+
[[album.tracks]]
192+
title = "Ballad of Simplicity"
193+
duration = "5:20"
194+
----
195+
196+
76197
== Lists
77198

78199
Bulleted:

0 commit comments

Comments
 (0)