Skip to content

Commit de152f8

Browse files
committed
Add syntax highlighting to construct documentation code examples
1 parent 87ac004 commit de152f8

19 files changed

Lines changed: 164 additions & 153 deletions

constructs/api-check.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Response time threshold in milliseconds for marking the check as degraded. This
222222

223223
**Usage:**
224224

225-
```ts
225+
```ts highlight={3}
226226
new ApiCheck("performance-check", {
227227
name: "Performance Monitoring",
228228
degradedResponseTime: 2000, // Warning at 2 seconds
@@ -242,7 +242,7 @@ Maximum response time in milliseconds before marking the check as failed. This s
242242

243243
**Usage:**
244244

245-
```ts
245+
```ts highlight={3}
246246
new ApiCheck("timeout-check", {
247247
name: "API Timeout Check",
248248
maxResponseTime: 5000, // Fail if response takes longer than 5 seconds
@@ -261,7 +261,7 @@ Whether a failure should count as a pass. When set to `true`, HTTP status codes
261261

262262
**Usage:**
263263

264-
```ts
264+
```ts highlight={3}
265265
new ApiCheck("negative-test", {
266266
name: "Test Error Handling",
267267
shouldFail: true, // Expect this to fail
@@ -316,7 +316,7 @@ Script to run before the API Check execution. Useful for setting up test data or
316316

317317
<CodeGroup>
318318

319-
```ts File Reference
319+
```ts File Reference highlight={3-5}
320320
new ApiCheck("api-with-setup", {
321321
name: "API with Setup Script",
322322
setupScript: {
@@ -329,7 +329,7 @@ new ApiCheck("api-with-setup", {
329329
})
330330
```
331331

332-
```ts Inline Script
332+
```ts Inline Script highlight={3-8}
333333
new ApiCheck('inline-setup', {
334334
name: 'API with Inline Setup',
335335
setupScript: {
@@ -369,7 +369,7 @@ Script to run after the API Check execution. Useful for cleaning up test data or
369369

370370
<CodeGroup>
371371

372-
```ts File Reference
372+
```ts File Reference highlight={3-5}
373373
new ApiCheck("api-with-teardown", {
374374
name: "API with Teardown Script",
375375
tearDownScript: {
@@ -382,7 +382,7 @@ new ApiCheck("api-with-teardown", {
382382
})
383383
```
384384

385-
```ts Inline Script
385+
```ts Inline Script highlight={3-9}
386386
new ApiCheck("inline-teardown", {
387387
name: "API with Inline Teardown",
388388
tearDownScript: {

constructs/browser-check.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Friendly name for your Browser Check that will be displayed in the Checkly dashb
186186

187187
**Usage:**
188188

189-
```ts
189+
```ts highlight={2}
190190
new BrowserCheck("my-check", {
191191
name: "User Login Flow Test",
192192
/* More options... */
@@ -200,7 +200,9 @@ How often the Browser Check should run. Use the `Frequency` enum to set the chec
200200

201201
**Usage:**
202202

203-
```ts
203+
```ts highlight={5}
204+
import { Frequency } from 'checkly/constructs'
205+
204206
new BrowserCheck("my-check", {
205207
name: "My Browser Check",
206208
frequency: Frequency.EVERY_5M,
@@ -242,7 +244,7 @@ Array of public location codes where the Browser Check should run. Multiple loca
242244

243245
**Usage:**
244246

245-
```ts
247+
```ts highlight={3}
246248
new BrowserCheck("my-check", {
247249
name: "My Browser Check",
248250
locations: ["us-east-1", "eu-west-1", "ap-southeast-1"],
@@ -288,7 +290,7 @@ Whether the browser check is enabled and will run according to its schedule.
288290

289291
**Usage:**
290292

291-
```ts
293+
```ts highlight={3}
292294
new BrowserCheck("my-check", {
293295
name: "My Browser Check",
294296
activated: false, // Disabled check
@@ -304,7 +306,7 @@ Array of tags to organize and categorize your Browser Checks in the Checkly infr
304306

305307
**Usage:**
306308

307-
```ts
309+
```ts highlight={3}
308310
new BrowserCheck("my-check", {
309311
name: "My Browser Check",
310312
tags: ["e2e", "critical-path", "user-journey"],
@@ -352,7 +354,7 @@ Check-level environment variables that will be available during test execution.
352354

353355
**Usage:**
354356

355-
```ts
357+
```ts highlight={3-6}
356358
new BrowserCheck("my-check", {
357359
name: "My Browser Check",
358360
environmentVariables: [

constructs/check-group-v2.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Friendly name for your check group that will be displayed in the Checkly dashboa
105105

106106
**Usage:**
107107

108-
```ts
108+
```ts highlight={2}
109109
const group = new CheckGroupV2("api-monitoring-group", {
110110
name: "API Monitoring Group",
111111
})
@@ -120,7 +120,7 @@ Whether checks in the group are running. When false, all checks in the group are
120120

121121
**Usage:**
122122

123-
```ts
123+
```ts highlight={3}
124124
const group = new CheckGroupV2("api-monitoring-group", {
125125
name: "API Monitoring Group",
126126
activated: false,
@@ -136,7 +136,7 @@ Whether to mute alerts for all checks in the group. Checks will still run but wo
136136

137137
**Usage:**
138138

139-
```ts
139+
```ts highlight={3}
140140
const group = new CheckGroupV2("api-monitoring-group", {
141141
name: "API Monitoring Group",
142142
muted: true, // Silence all alerts
@@ -151,7 +151,9 @@ How often to run checks within the group. This frequency applies to all checks i
151151

152152
**Usage:**
153153

154-
```ts
154+
```ts highlight={5}
155+
import { Frequency } from 'checkly/constructs'
156+
155157
const group = new CheckGroupV2('api-monitoring-group', {
156158
name: "API Monitoring Group",
157159
frequency: Frequency.EVERY_10M
@@ -168,7 +170,7 @@ Public locations for all checks in the group. Checks inherit these locations unl
168170

169171
**Usage:**
170172

171-
```ts
173+
```ts highlight={3}
172174
const group = new CheckGroupV2("api-monitoring-group", {
173175
name: "API Monitoring Group",
174176
locations: ["us-east-1", "eu-west-1", "ap-southeast-1"],

constructs/check-group.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Friendly name for your check group that will be displayed in the Checkly dashboa
110110

111111
**Usage:**
112112

113-
```ts
113+
```ts highlight={2}
114114
const group = new CheckGroup("api-monitoring-group", {
115115
name: "API Monitoring Group",
116116
})
@@ -124,7 +124,7 @@ Whether checks in the group are running. When false, all checks in the group are
124124

125125
**Usage:**
126126

127-
```ts
127+
```ts highlight={3}
128128
const group = new CheckGroup("api-monitoring-group", {
129129
name: "API Monitoring Group",
130130
activated: false,
@@ -140,7 +140,7 @@ Whether to mute alerts for all checks in the group. Checks will still run but wo
140140

141141
**Usage:**
142142

143-
```ts
143+
```ts highlight={3}
144144
const group = new CheckGroup("api-monitoring-group", {
145145
name: "API Monitoring Group",
146146
muted: true, // Silence all alerts
@@ -156,7 +156,9 @@ How often to run checks within the group. This frequency applies to all checks i
156156

157157
**Usage:**
158158

159-
```ts
159+
```ts highlight={5}
160+
import { Frequency } from 'checkly/constructs'
161+
160162
const group = new CheckGroup("api-monitoring-group", {
161163
name: "API Monitoring Group",
162164
frequency: Frequency.EVERY_10M,
@@ -173,7 +175,7 @@ Public locations for all checks in the group. Checks inherit these locations unl
173175

174176
**Usage:**
175177

176-
```ts
178+
```ts highlight={3}
177179
const group = new CheckGroup("api-monitoring-group", {
178180
name: "API Monitoring Group",
179181
locations: ["us-east-1", "eu-west-1", "ap-southeast-1"],

constructs/dashboard.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Text displayed at the top of your dashboard as the main title.
9292

9393
**Usage:**
9494

95-
```ts
95+
```ts highlight={2}
9696
new Dashboard('my-dashboard', {
9797
header: 'Production Services Status'
9898
})
@@ -107,7 +107,7 @@ Text displayed below the header providing additional context about the dashboard
107107

108108
**Usage:**
109109

110-
```ts
110+
```ts highlight={3}
111111
new Dashboard('my-dashboard', {
112112
header: 'Production Services',
113113
description: 'Real-time monitoring of all production services'
@@ -122,7 +122,7 @@ Tags that filter which checks appear on the dashboard. Empty array shows all che
122122

123123
**Usage:**
124124

125-
```ts
125+
```ts highlight={2}
126126
new Dashboard('my-dashboard', {
127127
tags: ['production', 'api']
128128
})
@@ -160,7 +160,7 @@ Subdomain under "checklyhq.com" for your dashboard (e.g., "my-status" becomes "m
160160

161161
**Usage:**
162162

163-
```ts
163+
```ts highlight={2}
164164
new Dashboard('my-dashboard', {
165165
customUrl: 'service-status'
166166
})
@@ -180,7 +180,7 @@ Custom domain for your dashboard (e.g., "status.example.com"). Must be verified
180180

181181
**Usage:**
182182

183-
```ts
183+
```ts highlight={2}
184184
new Dashboard('my-dashboard', {
185185
customDomain: 'status.example.com'
186186
})
@@ -194,7 +194,7 @@ Custom CSS styling for your dashboard. Only available on Team and Enterprise pla
194194

195195
**Usage:**
196196

197-
```ts
197+
```ts highlight={3-5,10-20}
198198
// Using file reference
199199
new Dashboard("styled-dashboard", {
200200
customCSS: {

constructs/email-alert-channel.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Email address to send notifications to. Each EmailAlertChannel supports only one
6363

6464
**Usage:**
6565

66-
```ts
66+
```ts highlight={2}
6767
new EmailAlertChannel('team-email', {
6868
address: 'dev-team@acme.com'
6969
})
@@ -115,7 +115,7 @@ Whether to send notifications when checks recover from failure or degraded state
115115

116116
**Usage:**
117117

118-
```ts
118+
```ts highlight={3}
119119
new EmailAlertChannel("recovery-email", {
120120
address: "ops@acme.com",
121121
sendRecovery: true, // Send recovery notifications
@@ -152,7 +152,7 @@ Whether to send notifications when checks fail.
152152

153153
**Usage:**
154154

155-
```ts
155+
```ts highlight={3}
156156
new EmailAlertChannel("failure-email", {
157157
address: "oncall@acme.com",
158158
sendFailure: true, // Send failure notifications
@@ -192,7 +192,7 @@ Whether to send notifications when API checks degrade (performance thresholds ex
192192

193193
**Usage:**
194194

195-
```ts
195+
```ts highlight={3}
196196
new EmailAlertChannel("performance-email", {
197197
address: "performance-team@acme.com",
198198
sendDegraded: true, // Send degraded performance notifications
@@ -207,7 +207,7 @@ Whether to send notifications for SSL certificate expiry warnings.
207207

208208
**Usage:**
209209

210-
```ts
210+
```ts highlight={3}
211211
new EmailAlertChannel("security-email", {
212212
address: "security@acme.com",
213213
sslExpiry: true,
@@ -221,8 +221,9 @@ new EmailAlertChannel("security-email", {
221221
<ResponseField name="sslExpiryThreshold" type="number">
222222
Number of days before SSL certificate expiry to send notifications. Only relevant when `sslExpiry` is enabled.
223223

224-
Usage:
225-
```ts
224+
**Usage:**
225+
226+
```ts highlight={4}
226227
new EmailAlertChannel("ssl-monitoring", {
227228
address: "devops@acme.com",
228229
sslExpiry: true,

constructs/heartbeat-monitor.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The expected period between pings from your external service. This defines how o
8888

8989
**Usage:**
9090

91-
```ts
91+
```ts highlight={3}
9292
new HeartbeatMonitor('my-heartbeat', {
9393
name: "My heartbeat",
9494
period: 1,
@@ -152,7 +152,7 @@ The time unit for the period. Defines whether the period is in seconds, minutes,
152152

153153
**Usage:**
154154

155-
```ts
155+
```ts highlight={4}
156156
new HeartbeatMonitor("my-heartbeat", {
157157
name: "My heartbeat",
158158
period: 2,
@@ -169,7 +169,7 @@ The grace period to wait before alerting after the expected ping time has passed
169169

170170
**Usage:**
171171

172-
```ts
172+
```ts highlight={4}
173173
new HeartbeatMonitor('my-heartbeat', {
174174
period: 1,
175175
periodUnit: 'hours',
@@ -233,7 +233,7 @@ The time unit for the grace period. Defines whether the grace period is in secon
233233

234234
**Usage:**
235235

236-
```ts
236+
```ts highlight={5}
237237
new HeartbeatMonitor('my-heartbeat', {
238238
period: 6,
239239
periodUnit: 'hours',
@@ -252,7 +252,7 @@ Friendly name for your heartbeat monitor that will be displayed in the Checkly d
252252

253253
**Usage:**
254254

255-
```ts
255+
```ts highlight={2}
256256
new HeartbeatMonitor('my-heartbeat', {
257257
name: 'Daily Backup Job Monitor',
258258
/* More options ... */

0 commit comments

Comments
 (0)