Skip to content

Commit

Permalink
Simplified use of tabpane -- no more Prettier or linter ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Aug 3, 2023
1 parent 1c2d9a5 commit 5b425aa
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
8 changes: 8 additions & 0 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,11 @@ body.td-page--draft .td-content {
max-width: max-content;
}
}

// TODO(@chalin): upstream
.tab-body {
> .highlight:only-child {
margin: -1.5rem;
max-width: calc(100% + 3rem);
}
}
40 changes: 20 additions & 20 deletions content/en/docs/collector/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,38 @@ Pull a docker image and run the collector in a container. Replace
`{{% param collectorVersion %}}` with the version of the Collector you wish to
run.

<!-- markdownlint-disable -->
<!-- prettier-ignore-start -->
{{< tabpane lang=shell >}}
{{< tab DockerHub >}}
{{% tabpane text=true %}} {{% tab DockerHub %}}

```sh
docker pull otel/opentelemetry-collector-contrib:{{% param collectorVersion %}}
docker run otel/opentelemetry-collector-contrib:{{% param collectorVersion %}}
{{< /tab >}}
```

{{% /tab %}} {{% tab ghcr.io %}}

{{< tab ghcr.io >}}
```sh
docker pull ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{% param collectorVersion %}}
docker run ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:{{% param collectorVersion %}}
{{< /tab >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->
<!-- markdownlint-restore -->
```

{{% /tab %}} {{% /tabpane %}}

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

<!-- markdownlint-disable -->
<!-- prettier-ignore-start -->
{{< tabpane lang=shell >}}
{{< tab DockerHub >}}
{{% tabpane text=true %}} {{% tab DockerHub %}}

```sh
docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml otel/opentelemetry-collector-contrib:{{% param collectorVersion %}}
{{< /tab >}}
```

{{% /tab %}} {{% tab ghcr.io %}}

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

{{% /tab %}} {{% /tabpane %}}

## Docker Compose

Expand Down
18 changes: 8 additions & 10 deletions content/en/docs/instrumentation/js/getting-started/nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@ npm install express
Create a file named `app.ts` (or `app.js` if not using TypeScript) and add the
following code to it:

<!-- markdownlint-disable -->
<!-- prettier-ignore-start -->
{{< tabpane langEqualsHeader=true >}}
{{% tabpane text=true %}} {{% tab TypeScript %}}

{{< tab TypeScript >}}
```TypeScript
/*app.ts*/
import express, { Express } from "express";

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

{{< tab JavaScript >}}
{{% /tab %}} {{% tab JavaScript %}}

```JavaScript
/*app.js*/
const express = require("express");

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

{{< /tabpane>}}
<!-- prettier-ignore-end -->
<!-- markdownlint-restore -->
{{% /tab %}} {{% /tabpane%}}

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

0 comments on commit 5b425aa

Please sign in to comment.