open-telemetry / opentelemetry.io

The OpenTelemetry website and documentation
https://opentelemetry.io
Creative Commons Attribution 4.0 International
565 stars 1.22k forks source link

Support the use of GitHub markdown alerts for the specs #5557

Open chalin opened 2 weeks ago

chalin commented 2 weeks ago

GitHub markdown alerts are now being used in the OTel spec. I would be a nice to have to support their proper formatting (which I thought that Hugo already did -- I'll have to investigate, it might require a bit of extra coding).

For example, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#logs-api.

https://github.com/open-telemetry/opentelemetry-specification/blob/8bc96330a1c17ff5194c5afcf7d32b9ee24b65e3/specification/logs/sdk.md?plain=1#L542-L545:

## Logs API

> [!NOTE]
> We are currently in the process of defining a new [Logs API](./api.md#logs-api).

This currently renders as follows for the OTel website:

image

On GitHub, it looks like this (we don't have to match the look exactly):

image

We might want to consider wrapping that into an {{% alert %}}?

svrnm commented 2 weeks ago

When you say wrapping that into the alert shortcode do you mean we write some transformation code that turns

> [!NOTE]
> We are currently in the process of defining a new [Logs API](./api.md#logs-api).

into

{{% alert title="Note" color="info" %}}
We are currently in the process of defining a new [Logs API](./api.md#logs-api).
{{% /alert %}}

?

chalin commented 2 weeks ago

Yes. The idea is that Hugo would be doing that automatically for us using a block-quote hook.