Skip to content
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

require multiple BCD tables by specifying browser-compat as an array #20051

Merged
merged 5 commits into from
Oct 20, 2022
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ First you need to find the query string for the relevant compatibility data you
The compatibility data query should be specified in the page front-matter using the `browser-compat` key.
For example, for the {{domxref("AbortController")}} this would be added as shown below:

```plain
```yaml
yin1999 marked this conversation as resolved.
Show resolved Hide resolved
---
title: AbortController
slug: Web/API/AbortController
Expand All @@ -484,7 +484,21 @@ browser-compat: api.AbortController

The compatibility and specification tables corresponding to the key are then automatically rendered in place of the `\{{Compat}}` and `\{{Specifications}}` macros in the source.

You can also specify the desired API as the first argument to the macro as shown: `\{{Compat("api.AbortController")}}`. This can be useful if multiple compatibility tables are required on the same page.
> **Note:** If multiple compatibility/specification tables are required on the same page, you can specify the value of `browser-compat` as an array.
> For example, for the {{domxref("Channel Messaging API")}} this would be added as shown below:
>
> ```yaml
yin1999 marked this conversation as resolved.
Show resolved Hide resolved
> ---
> title: Channel Messaging API
> slug: Web/API/Channel_Messaging_API
>
> …
>
> browser-compat:
> - api.MessageChannel
> - api.MessagePort
> ---
> ```

The macro calls generate the following tables (and corresponding set of notes):

Expand Down