8000 Set up VS Code support for Markdoc by jhgilbert · Pull Request #29352 · DataDog/documentation · GitHub
[go: up one dir, main page]

Skip to content

Set up VS Code support for Markdoc #29352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ Icon
Network Trash Folder
Temporary Items
.apdisk
.vscode

# jetbrains
.idea
Expand Down
129 changes: 129 additions & 0 deletions .vscode/markdoc.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"Alert box": {
"prefix": ";;alert",
"body": ["{% alert level=\"${1|info,warning,danger|}\" %}", "${2:This is an alert message.}", "{% /alert %}"],
"description": "Markdoc alert block with a level attribute (info, warning, danger)"
},

"Callout": {
"prefix": ";;callout",
"body": [
"{% callout src=\"${1:https://www.example.com}\" header=\"${2:Join the Preview!}\" btn_hidden=${3|false,true|} %}",
"${4:Callout content goes here.}",
"{% /callout %}"
],
"description": "Markdoc callout block with optional header and button visibility"
},

"Code block": {
"prefix": ";;code",
"body": [
"```${1:javascript} {% filename=\"${2:example.js}\" collapsible=${3|true,false|} disable_copy=${4|false,true|} wrap=${5|false,true|} %}",
"${6:// Your code here}",
"```"
],
"description": "Markdoc code block with attributes and tabstop choices"
},

"Definition list": {
"prefix": ";;list",
"body": [
"Service",
"",
": 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.",
"",
"Resource",
"",
": Resources represent a particular domain of a customer application - they are typically an instrumented web endpoint, database query, or background job.",
"",
"`clusterChecksRunner.affinity.podAffinity.preferredDuringSchedulingIgnoredDuringExecution`",
": Required. A list of node selector terms. The terms are ORed.",
"`site`",
": Set the site of the Datadog intake for Agent data: {{< region-param key=\"dd_site\" code=\"true\" >}}. Defaults to `datadoghq.com`."
],
"description": "Description list"
},

"If": {
"prefix": ";;if",
"body": [
"{% if equals($${1:trait_id}, \"${2:option_id}\") %}",
"${3:Content shown if condition is true}",
"{% /if %}"
],
"description": "Markdoc if tag with equals condition"
},

"Image": {
"prefix": ";;image",
"body": [
"{% img src=\"${1:path/to/image.png}\" alt=\"${2:Descriptive alt text}\" style=\"${3:width:80%;}\" /%}"
],
"description": "Markdoc image with optional alt and style"
},

"Video": {
"prefix": ";;;video",
"body": ["{% img src=\"${1:path/to/video.mp4}\" alt=\"${2:Descriptive video alt text}\" video=\"true\" /%}"],
"description": "Markdoc video tag using img with video attribute"
},

"Region site address": {
"prefix": ";;region-param",
"body": [
"{% region-param key=\"${1:dd_site}\" code=${2|false,true|} link=${3|false,true|} text=\"${4:Custom link text}\" /%}"
],
"description": "Markdoc region-param tag with attribute choices"
},

"Region selector": {
"prefix": ";;region",
"body": [
"{% site-region region=\"${1|us,us3,us5,eu,ap1,gov|}\" %}",
"${2:Content for this region.}",
"{% /site-region %}"
],
"description": "Markdoc site-region block with selectable region"
},

"Table": {
"prefix": ";;table",
"body": [
"{% table %}",
"* ${1:Header Col 1}",
"* ${2:Header Col 2}",
"---",
"* ${3:Row 1 Col 1}",
"* ${4:Row 1 Col 2}",
"---",
"* ${5:Row 2 Col 1}",
"* ${6:Row 2 Col 2}",
"{% /table %}"
],
"description": "Markdoc table with 2 rows and 2 columns"
},

"Tabs": {
"prefix": ";;tabs",
"body": [
"{% tabs %}",
"",
"{% tab label=\"${1:Tab 1}\" %}",
"${2:Content for Tab 1. Link URLs go at the bottom of the file, not the bottom of the tab.}",
"{% /tab %}",
"",
"{% tab label=\"${3:Tab 2}\" %}",
"${4:Content for Tab 2}",
"{% /tab %}",
"",
"{% /tabs %}"
],
"description": "Markdoc tabs block with two labeled tabs"
},

"Check mark": {
"prefix": ";;check",
"body": "{% x/ %}",
"description": "X tag (self-closing) for checkmark"
}
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"*.mdoc.md": "markdoc"
}
}
Original file line number Diff line number Diff line change
@@ -1,51 +1,57 @@
---
title: Proxy Your Mobile RUM Data
aliases:
- /real_user_monitoring/faq/proxy_mobile_rum_data/
- /real_user_monitoring/faq/proxy_mobile_rum_data/
further_reading:
- link: '/real_user_monitoring/'
tag: 'Documentation'
text: 'Learn about Real User Monitoring'
- link: '/real_user_monitoring/'
tag: 'Documentation'
text: 'Learn about Real User Monitoring'
content_filters:
- trait_id: platform
option_group_id: rum_sdk_platform_options
label: "SDK"
- trait_id: protocol
option_group_id: rum_mobile_proxy_protocol_options
- trait_id: platform
option_group_id: rum_sdk_platform_options
label: 'SDK'
- trait_id: protocol
option_group_id: rum_mobile_proxy_protocol_options
---

## Overview

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

<!-- Android -->

{% if equals($platform, "android") %}
Proxies use [OkHttpClient Proxy and Authenticator][2] on Android.
{% /if %}

<!-- iOS -->

{% if equals($platform, "ios") %}
Proxies use [URLSessionConfiguration.connectionProxyDictionary][3] on iOS.
{% /if %}

## Prerequisite proxy setup

<!-- HTTP/HTTPS -->

{% if equals($protocol, "http_https") %}
To successfully forward a request to Datadog, your proxy must support [HTTP CONNECT][1] requests.
{% /if %}

<!-- SOCKS -->

{% if equals($protocol, "socks") %}
To successfully forward a request to Datadog, your proxy must support [SOCKS5 proxying][4].
{% /if %}

## Recommended SDK setup

<!-- HTTP/HTTPS -->

{% if equals($protocol, "http_https") %}

<!-- HTTP/HTTPS > Android -->

{% if equals($platform, "android") %}

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

{% /if %}

<!-- end HTTP/HTTPS > Android -->

<!-- HTTP/HTTPS > iOS -->

{% if equals($platform, "ios") %}

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

{% tabs %}

{% tab label="Swift" %}

```swift
import DatadogCore

Expand All @@ -93,9 +102,11 @@ Datadog.initialize(
trackingConsent: trackingConsent
)
```

{% /tab %}

{% tab label="Objective C" %}

```objective-c
@import DatadogObjc;

Expand All @@ -118,9 +129,11 @@ For more information, see the [URLSessionConfiguration.connectionProxyDictionary
{% /tabs %}

{% /if %}

<!-- end HTTP/HTTPS > iOS -->

<!-- HTTP/HTTPS > React Native -->

{% if equals($platform, "react_native") %}
When initializing the React Native SDK, specify the following proxy configuration:

Expand All @@ -131,16 +144,21 @@ const config = new DatadogProviderConfiguration('<client token>', '<environment>

config.proxyConfig = new ProxyConfiguration(ProxyType.HTTPS, '<www.example.com>', <123>, '<proxy user>', '<proxy password>');
```

{% /if %}

<!-- end HTTP/HTTPS > React Native -->

{% /if %}

<!-- end HTTP/HTTPS -->

<!-- SOCKS -->

{% if equals($protocol, "socks") %}

<!-- SOCKS > Android -->

{% if equals($platform, "android") %}
When initializing the Android SDK, specify the following proxy configuration:

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

{% /if %}

<!-- end SOCKS > Android -->

<!-- SOCKS > iOS -->

{% if equals($platform, "ios") %}
When initializing the iOS SDK, specify the following proxy configuration:

{% tabs %}

{% tab label="Swift" %}

```swift
import DatadogCore

Expand All @@ -186,9 +207,11 @@ Datadog.initialize(
trackingConsent: trackingConsent
)
```

{% /tab %}

{% tab label="Objective C" %}

```objective-c
@import DatadogObjc;

Expand All @@ -210,9 +233,11 @@ For more information, see the [URLSessionConfiguration.connectionProxyDictionary
{% /tabs %}

{% /if %}

<!-- end SOCKS > iOS -->

<!-- SOCKS > React Native -->

{% if equals($platform, "react_native") %}

When initializing the React Native SDK, specify the following proxy configuration:
Expand All @@ -226,12 +251,14 @@ config.proxyConfig = new ProxyConfiguration(ProxyType.SOCKS, '<www.example.com>'
```

{% /if %}

<!-- end SOCKS > React Native -->

{% /if %}

<!-- end SOCKS -->

[1]: https://www.rfc-editor.org/rfc/rfc9110#CONNECT
[2]: https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html
[3]: https://developer.apple.com/documentation/foundation/urlsessionconfiguration/1411499-connectionproxydictionary
[4]: https://datatracker.ietf.org/doc/html/rfc1928
[4]: https://datatracker.ietf.org/doc/html/rfc1928
6 changes: 6 additions & 0 deletions markdoc.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"id": "datadog-docs",
"path": "content/en"
}
]
Loading
0