Skip to content

Commit

Permalink
Alert component documentation and fixes for complicated markup (#297)
Browse files Browse the repository at this point in the history
Fixes xataio/frontend-next#3123

Added some documentation. The alert component typically assumes simple
strings. You can get more verbose with some whitespace.


![image](https://github.com/xataio/mdx-docs/assets/324519/8b84dee5-a94c-4dff-8d33-64296f80b2c5)
  • Loading branch information
snide authored Mar 5, 2024
1 parent 11f6839 commit b764507
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion 040-Data-operations/120-aggregate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ There are two types of aggregations:
- _bucket aggregations_, which split the data into buckets based on a column value. Examples of bucket aggregations are: `topValues`, `dateHistogram` and `numericHistogram`.
- _metric aggregations_, which compute a value based on the data in the bucket. Examples of metric aggregations are: `average`, `sum`, `min`, `max`, `count` and `uniqueCount`.

<Alert status="warning">Aggregations cannot be used with [link](/docs/concepts/data-model#link) columns.</Alert>
<Alert status="warning">

Aggregations cannot be used with [link](/docs/concepts/data-model#link) columns.

</Alert>

## Response type

Expand Down
12 changes: 11 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The following are extra components that can be used within the markdown files.

#### Alerts

Alerts accept a `status` prop with values of `info | warning | danger`
Alerts accept a `status` prop with values of `info | warning | danger`.

```tsx
<Alert status="warning">
Expand All @@ -50,6 +50,16 @@ Alerts accept a `status` prop with values of `info | warning | danger`
</Alert>
```

This component assumes your alert is simple and is a simple string (which is good practice). However, if you need multiple lines or other markdown (like links or images) you might need to include extra whitespace for proper rendering:

```
<Alert status="warning">
Aggregations cannot be used with [link](/docs/concepts/data-model#link) columns.
</Alert>
```

#### Images

Images using typical markdown syntax will transform into ones that will work with the Next JS / Vercel pipeline. Images can exist anywhere within this repo, but should be relative to the document they are referenced in
Expand Down

0 comments on commit b764507

Please sign in to comment.