Skip to content

Commit af0eca3

Browse files
authored
Use of tabpanes that obviates the need for Prettier/linter-ignore directives (open-telemetry#3126)
1 parent 249f954 commit af0eca3

File tree

5 files changed

+50
-60
lines changed

5 files changed

+50
-60
lines changed

assets/scss/_styles_project.scss

+8
Original file line numberDiff line numberDiff line change
@@ -278,3 +278,11 @@ body.td-page--draft .td-content {
278278
max-width: max-content;
279279
}
280280
}
281+
282+
// TODO(@chalin): upstream
283+
.tab-body {
284+
> .highlight:only-child {
285+
margin: -1.5rem;
286+
max-width: calc(100% + 3rem);
287+
}
288+
}

content/en/docs/collector/getting-started.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,38 @@ Pull a docker image and run the collector in a container. Replace
2929
`{{% param collectorVersion %}}` with the version of the Collector you wish to
3030
run.
3131

32-
<!-- markdownlint-disable -->
33-
<!-- prettier-ignore-start -->
34-
{{< tabpane lang=shell >}}
35-
{{< tab DockerHub >}}
32+
{{% tabpane text=true %}} {{% tab DockerHub %}}
33+
34+
```sh
3635
docker pull otel/opentelemetry-collector-contrib:{{% param collectorVersion %}}
3736
docker run otel/opentelemetry-collector-contrib:{{% param collectorVersion %}}
38-
{{< /tab >}}
37+
```
38+
39+
{{% /tab %}} {{% tab ghcr.io %}}
3940

40-
{{< tab ghcr.io >}}
41+
```sh
4142
docker pull ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{% param collectorVersion %}}
4243
docker run ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{% param collectorVersion %}}
43-
{{< /tab >}}
44-
{{< /tabpane >}}
45-
<!-- prettier-ignore-end -->
46-
<!-- markdownlint-restore -->
44+
```
45+
46+
{{% /tab %}} {{% /tabpane %}}
4747

4848
To load your custom configuration `config.yaml` from your current working
4949
directory, mount that file as a volume:
5050

51-
<!-- markdownlint-disable -->
52-
<!-- prettier-ignore-start -->
53-
{{< tabpane lang=shell >}}
54-
{{< tab DockerHub >}}
51+
{{% tabpane text=true %}} {{% tab DockerHub %}}
52+
53+
```sh
5554
docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml otel/opentelemetry-collector-contrib:{{% param collectorVersion %}}
56-
{{< /tab >}}
55+
```
56+
57+
{{% /tab %}} {{% tab ghcr.io %}}
5758

58-
{{< tab ghcr.io >}}
59+
```sh
5960
docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{% param collectorVersion %}}
60-
{{< /tab >}}
61-
{{< /tabpane >}}
62-
<!-- prettier-ignore-end -->
63-
<!-- markdownlint-restore -->
61+
```
62+
63+
{{% /tab %}} {{% /tabpane %}}
6464

6565
## Docker Compose
6666

content/en/docs/faas/lambda-auto-instrument.md

+13-29
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ first.
2525

2626
### Language Requirements
2727

28-
<!-- prettier-ignore -->
29-
{{< tabpane text=true >}}
30-
{{% tab Java %}}
28+
{{< tabpane text=true >}} {{% tab Java %}}
3129

3230
The Lambda layer supports the Java 8, 11, and 17 (Corretto) Lambda runtimes. For
3331
more information about supported Java versions, see the
@@ -69,26 +67,20 @@ OTEL_INSTRUMENTATION_AWS_LAMBDA_ENABLED=true
6967
OTEL_INSTRUMENTATION_AWS_SDK_ENABLED=true
7068
```
7169

72-
<!-- prettier-ignore -->
73-
{{% /tab %}}
74-
{{% tab JavaScript %}}
70+
{{% /tab %}} {{% tab JavaScript %}}
7571

7672
The Lambda layer supports Node.js v14+ Lambda runtimes. For more information
7773
about supported JavaScript and Node.js versions, see the
7874
[OpenTelemetry JavaScript documentation](https://github.com/open-telemetry/opentelemetry-js).
7975

80-
<!-- prettier-ignore -->
81-
{{% /tab %}}
82-
{{% tab Python %}}
76+
{{% /tab %}} {{% tab Python %}}
8377

8478
The Lambda layer supports Python 3.8 and Python 3.9 Lambda runtimes. For more
8579
information about supported Python versions, see the
8680
[OpenTelemetry Python documentation](https://github.com/open-telemetry/opentelemetry-python/blob/main/README.md#supported-runtimes)
8781
and the package on [PyPi](https://pypi.org/project/opentelemetry-api/).
8882

89-
<!-- prettier-ignore -->
90-
{{% /tab %}}
91-
{{< /tabpane >}}
83+
{{% /tab %}} {{< /tabpane >}}
9284

9385
### Configure `AWS_LAMBDA_EXEC_WRAPPER`
9486

@@ -124,31 +116,23 @@ there is an embedded Collector with gRPC / HTTP receivers. The environment
124116
variables do not need to be updated. However, there are varying levels of
125117
protocol support and default values by language which are documented below.
126118

127-
<!-- prettier-ignore -->
128-
{{< tabpane text=true >}}
129-
{{% tab Java %}}
119+
{{< tabpane text=true >}} {{% tab Java %}}
130120

131-
`OTEL_EXPORTER_OTLP_PROTOCOL=grpc` Supports: `grpc`, `http/protobuf` and
121+
`OTEL_EXPORTER_OTLP_PROTOCOL=grpc` supports: `grpc`, `http/protobuf` and
132122
`http/json` `OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317`
133123

134-
<!-- prettier-ignore -->
135-
{{% /tab %}}
136-
{{% tab Python %}}
137-
138-
`OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` Supports: `http/protobuf` and
139-
`http/json` `OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318`
140-
141-
<!-- prettier-ignore -->
142-
{{% /tab %}}
143-
{{% tab JavaScript %}}
124+
{{% /tab %}} {{% tab JavaScript %}}
144125

145126
`OTEL_EXPORTER_OTLP_PROTOCOL` env var is not supported The hard coded exporter
146127
uses the protocol `http/protobuf`
147128
`OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318`
148129

149-
<!-- prettier-ignore -->
150-
{{% /tab %}}
151-
{{< /tabpane >}}
130+
{{% /tab %}} {{% tab Python %}}
131+
132+
`OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf` supports: `http/protobuf` and
133+
`http/json` `OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318`
134+
135+
{{% /tab %}} {{< /tabpane >}}
152136

153137
### Publish your Lambda
154138

content/en/docs/instrumentation/js/getting-started/nodejs.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ npm install express
6464
Create a file named `app.ts` (or `app.js` if not using TypeScript) and add the
6565
following code to it:
6666

67-
<!-- markdownlint-disable -->
68-
<!-- prettier-ignore-start -->
69-
{{< tabpane langEqualsHeader=true >}}
67+
{{% tabpane text=true %}} {{% tab TypeScript %}}
7068

71-
{{< tab TypeScript >}}
69+
```TypeScript
7270
/*app.ts*/
7371
import express, { Express } from "express";
7472

@@ -86,9 +84,11 @@ app.get("/rolldice", (req, res) => {
8684
app.listen(PORT, () => {
8785
console.log(`Listening for requests on http://localhost:${PORT}`);
8886
});
89-
{{< /tab >}}
87+
```
9088

91-
{{< tab JavaScript >}}
89+
{{% /tab %}} {{% tab JavaScript %}}
90+
91+
```JavaScript
9292
/*app.js*/
9393
const express = require("express");
9494

@@ -106,11 +106,9 @@ app.get("/rolldice", (req, res) => {
106106
app.listen(PORT, () => {
107107
console.log(`Listening for requests on http://localhost:${PORT}`);
108108
});
109-
{{< /tab >}}
109+
```
110110

111-
{{< /tabpane>}}
112-
<!-- prettier-ignore-end -->
113-
<!-- markdownlint-restore -->
111+
{{% /tab %}} {{% /tabpane%}}
114112

115113
Run the application with the following command and open
116114
<http://localhost:8080/rolldice> in your web browser to ensure it is working.

0 commit comments

Comments
 (0)