Skip to content

Commit e051f03

Browse files
authored
Set up VS Code support for Markdoc (#29352)
* Add a very simple configuration for the language server * Un-ignore VS code settings for repo * Add VS Code settings to support Markdoc * Reformat existing file * Flesh out Markdoc snippets * Better align the Markdoc snippet prefixes with the legacy prefixes
1 parent 3f60b6d commit e051f03

File tree

5 files changed

+177
-11
lines changed

5 files changed

+177
-11
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ Icon
226226
Network Trash Folder
227227
Temporary Items
228228
.apdisk
229-
.vscode
230229

231230
# jetbrains
232231
.idea

.vscode/markdoc.code-snippets

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"Alert box": {
3+
"prefix": ";;alert",
4+
"body": ["{% alert level=\"${1|info,warning,danger|}\" %}", "${2:This is an alert message.}", "{% /alert %}"],
5+
"description": "Markdoc alert block with a level attribute (info, warning, danger)"
6+
},
7+
8+
"Callout": {
9+
"prefix": ";;callout",
10+
"body": [
11+
"{% callout src=\"${1:https://www.example.com}\" header=\"${2:Join the Preview!}\" btn_hidden=${3|false,true|} %}",
12+
"${4:Callout content goes here.}",
13+
"{% /callout %}"
14+
],
15+
"description": "Markdoc callout block with optional header and button visibility"
16+
},
17+
18+
"Code block": {
19+
"prefix": ";;code",
20+
"body": [
21+
"```${1:javascript} {% filename=\"${2:example.js}\" collapsible=${3|true,false|} disable_copy=${4|false,true|} wrap=${5|false,true|} %}",
22+
"${6:// Your code here}",
23+
"```"
24+
],
25+
"description": "Markdoc code block with attributes and tabstop choices"
26+
},
27+
28+
"Definition list": {
29+
"prefix": ";;list",
30+
"body": [
31+
"Service",
32+
"",
33+
": Services are the building blocks of modern microservice architectures - broadly a service groups together endpoints, queries, or jobs for the purposes of building your application.",
34+
"",
35+
"Resource",
36+
"",
37+
": Resources represent a particular domain of a customer application - they are typically an instrumented web endpoint, database query, or background job.",
38+
"",
39+
"`clusterChecksRunner.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution`",
40+
": Required. A list of node selector terms. The terms are ORed.",
41+
"`site`",
42+
": Set the site of the Datadog intake for Agent data: {{< region-param key=\"dd_site\" code=\"true\" >}}. Defaults to `datadoghq.com`."
43+
],
44+
"description": "Description list"
45+
},
46+
47+
"If": {
48+
"prefix": ";;if",
49+
"body": [
50+
"{% if equals($${1:trait_id}, \"${2:option_id}\") %}",
51+
"${3:Content shown if condition is true}",
52+
"{% /if %}"
53+
],
54+
"description": "Markdoc if tag with equals condition"
55+
},
56+
57+
"Image": {
58+
"prefix": ";;image",
59+
"body": [
60+
"{% img src=\"${1:path/to/image.png}\" alt=\"${2:Descriptive alt text}\" style=\"${3:width:80%;}\" /%}"
61+
],
62+
"description": "Markdoc image with optional alt and style"
63+
},
64+
65+
"Video": {
66+
"prefix": ";;;video",
67+
"body": ["{% img src=\"${1:path/to/video.mp4}\" alt=\"${2:Descriptive video alt text}\" video=\"true\" /%}"],
68+
"description": "Markdoc video tag using img with video attribute"
69+
},
70+
71+
"Region site address": {
72+
"prefix": ";;region-param",
73+
"body": [
74+
"{% region-param key=\"${1:dd_site}\" code=${2|false,true|} link=${3|false,true|} text=\"${4:Custom link text}\" /%}"
75+
],
76+
"description": "Markdoc region-param tag with attribute choices"
77+
},
78+
79+
"Region selector": {
80+
"prefix": ";;region",
81+
"body": [
82+
"{% site-region region=\"${1|us,us3,us5,eu,ap1,gov|}\" %}",
83+
"${2:Content for this region.}",
84+
"{% /site-region %}"
85+
],
86+
"description": "Markdoc site-region block with selectable region"
87+
},
88+
89+
"Table": {
90+
"prefix": ";;table",
91+
"body": [
92+
"{% table %}",
93+
"* ${1:Header Col 1}",
94+
"* ${2:Header Col 2}",
95+
"---",
96+
"* ${3:Row 1 Col 1}",
97+
"* ${4:Row 1 Col 2}",
98+
"---",
99+
"* ${5:Row 2 Col 1}",
100+
"* ${6:Row 2 Col 2}",
101+
"{% /table %}"
102+
],
103+
"description": "Markdoc table with 2 rows and 2 columns"
104+
},
105+
106+
"Tabs": {
107+
"prefix": ";;tabs",
108+
"body": [
109+
"{% tabs %}",
110+
"",
111+
"{% tab label=\"${1:Tab 1}\" %}",
112+
"${2:Content for Tab 1. Link URLs go at the bottom of the file, not the bottom of the tab.}",
113+
"{% /tab %}",
114+
"",
115+
"{% tab label=\"${3:Tab 2}\" %}",
116+
"${4:Content for Tab 2}",
117+
"{% /tab %}",
118+
"",
119+
"{% /tabs %}"
120+
],
121+
"description": "Markdoc tabs block with two labeled tabs"
122+
},
123+
124+
"Check mark": {
125+
"prefix": ";;check",
126+
"body": "{% x/ %}",
127+
"description": "X tag (self-closing) for checkmark"
128+
}
129+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"*.mdoc.md": "markdoc"
4+
}
5+
}

content/en/real_user_monitoring/guide/proxy-mobile-rum-data.mdoc.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
11
---
22
title: Proxy Your Mobile RUM Data
33
aliases:
4-
- /real_user_monitoring/faq/proxy_mobile_rum_data/
4+
- /real_user_monitoring/faq/proxy_mobile_rum_data/
55
further_reading:
6-
- link: '/real_user_monitoring/'
7-
tag: 'Documentation'
8-
text: 'Learn about Real User Monitoring'
6+
- link: '/real_user_monitoring/'
7+
tag: 'Documentation'
8+
text: 'Learn about Real User Monitoring'
99
content_filters:
10-
- trait_id: platform
11-
option_group_id: rum_sdk_platform_options
12-
label: "SDK"
13-
- trait_id: protocol
14-
option_group_id: rum_mobile_proxy_protocol_options
10+
- trait_id: platform
11+
option_group_id: rum_sdk_platform_options
12+
label: 'SDK'
13+
- trait_id: protocol
14+
option_group_id: rum_mobile_proxy_protocol_options
1515
---
1616

1717
## Overview
1818

1919
The RUM Mobile SDKs can be configured to send requests through a proxy.
2020

2121
<!-- Android -->
22+
2223
{% if equals($platform, "android") %}
2324
Proxies use [OkHttpClient Proxy and Authenticator][2] on Android.
2425
{% /if %}
2526

2627
<!-- iOS -->
28+
2729
{% if equals($platform, "ios") %}
2830
Proxies use [URLSessionConfiguration.connectionProxyDictionary][3] on iOS.
2931
{% /if %}
3032

3133
## Prerequisite proxy setup
3234

3335
<!-- HTTP/HTTPS -->
36+
3437
{% if equals($protocol, "http_https") %}
3538
To successfully forward a request to Datadog, your proxy must support [HTTP CONNECT][1] requests.
3639
{% /if %}
3740

3841
<!-- SOCKS -->
42+
3943
{% if equals($protocol, "socks") %}
4044
To successfully forward a request to Datadog, your proxy must support [SOCKS5 proxying][4].
4145
{% /if %}
4246

4347
## Recommended SDK setup
4448

4549
<!-- HTTP/HTTPS -->
50+
4651
{% if equals($protocol, "http_https") %}
4752

4853
<!-- HTTP/HTTPS > Android -->
54+
4955
{% if equals($platform, "android") %}
5056

5157
When initializing the Android SDK, specify the following proxy configuration:
@@ -65,16 +71,19 @@ configBuilder.setProxy(proxy, authenticator)
6571
For more information, see the [OkHttpClient Proxy and Authenticator][2] documentation.
6672

6773
{% /if %}
74+
6875
<!-- end HTTP/HTTPS > Android -->
6976

7077
<!-- HTTP/HTTPS > iOS -->
78+
7179
{% if equals($platform, "ios") %}
7280

7381
When initializing the iOS SDK, specify the following proxy configuration:
7482

7583
{% tabs %}
7684

7785
{% tab label="Swift" %}
86+
7887
```swift
7988
import DatadogCore
8089

@@ -93,9 +102,11 @@ Datadog.initialize(
93102
trackingConsent: trackingConsent
94103
)
95104
```
105+
96106
{% /tab %}
97107

98108
{% tab label="Objective C" %}
109+
99110
```objective-c
100111
@import DatadogObjc;
101112

@@ -118,9 +129,11 @@ For more information, see the [URLSessionConfiguration.connectionProxyDictionary
118129
{% /tabs %}
119130
120131
{% /if %}
132+
121133
<!-- end HTTP/HTTPS > iOS -->
122134
123135
<!-- HTTP/HTTPS > React Native -->
136+
124137
{% if equals($platform, "react_native") %}
125138
When initializing the React Native SDK, specify the following proxy configuration:
126139
@@ -131,16 +144,21 @@ const config = new DatadogProviderConfiguration('<client token>', '<environment>
131144
132145
config.proxyConfig = new ProxyConfiguration(ProxyType.HTTPS, '<www.example.com>', <123>, '<proxy user>', '<proxy password>');
133146
```
147+
134148
{% /if %}
149+
135150
<!-- end HTTP/HTTPS > React Native -->
136151

137152
{% /if %}
153+
138154
<!-- end HTTP/HTTPS -->
139155

140156
<!-- SOCKS -->
157+
141158
{% if equals($protocol, "socks") %}
142159

143160
<!-- SOCKS > Android -->
161+
144162
{% if equals($platform, "android") %}
145163
When initializing the Android SDK, specify the following proxy configuration:
146164

@@ -159,15 +177,18 @@ configBuilder.setProxy(proxy, authenticator)
159177
For more information, see the [OkHttpClient Proxy and Authenticator][2] documentation.
160178

161179
{% /if %}
180+
162181
<!-- end SOCKS > Android -->
163182

164183
<!-- SOCKS > iOS -->
184+
165185
{% if equals($platform, "ios") %}
166186
When initializing the iOS SDK, specify the following proxy configuration:
167187

168188
{% tabs %}
169189

170190
{% tab label="Swift" %}
191+
171192
```swift
172193
import DatadogCore
173194

@@ -186,9 +207,11 @@ Datadog.initialize(
186207
trackingConsent: trackingConsent
187208
)
188209
```
210+
189211
{% /tab %}
190212

191213
{% tab label="Objective C" %}
214+
192215
```objective-c
193216
@import DatadogObjc;
194217

@@ -210,9 +233,11 @@ For more information, see the [URLSessionConfiguration.connectionProxyDictionary
210233
{% /tabs %}
211234
212235
{% /if %}
236+
213237
<!-- end SOCKS > iOS -->
214238
215239
<!-- SOCKS > React Native -->
240+
216241
{% if equals($platform, "react_native") %}
217242
218243
When initializing the React Native SDK, specify the following proxy configuration:
@@ -226,12 +251,14 @@ config.proxyConfig = new ProxyConfiguration(ProxyType.SOCKS, '<www.example.com>'
226251
```
227252

228253
{% /if %}
254+
229255
<!-- end SOCKS > React Native -->
230256

231257
{% /if %}
258+
232259
<!-- end SOCKS -->
233260

234261
[1]: https://www.rfc-editor.org/rfc/rfc9110#CONNECT
235262
[2]: https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html
236263
[3]: https://developer.apple.com/documentation/foundation/urlsessionconfiguration/1411499-connectionproxydictionary
237-
[4]: https://datatracker.ietf.org/doc/html/rfc1928
264+
[4]: https://datatracker.ietf.org/doc/html/rfc1928

markdoc.config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{
3+
"id": "datadog-docs",
4+
"path": "content/en"
5+
}
6+
]

0 commit comments

Comments
 (0)