Skip to content

Commit

Permalink
feat: add kitchen sink for callouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporiff committed Aug 2, 2023
1 parent 815eb23 commit 2e2c9cc
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ repos:
- id: editorconfig-checker
alias: ec
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v3.0.0
hooks:
- id: prettier
1 change: 1 addition & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default defineConfig({
tabsAutoImport,
tabNameAutoImport,
tabContentAutoImport,
"@components/Aside.astro",
],
}),
// Enable Preact to support Preact JSX components.
Expand Down
91 changes: 91 additions & 0 deletions src/content/docs/en/kitchen-sink/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
title: "Kitchen sink"
description: "A test page for custom components"
slug: "en/kitchen-sink/index"
category-title: "Kitchen sink"
---

This page includes documentation for this site's custom authoring components and examples of their use.

## Callouts

Callouts are `<aside>` components which display additional information in visually distinct ways.

### Props

| Prop | Data type | Values | Required |
| ------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| `type` | String | <ul><li><code>note</code></li><li><code>tip</code></li><li><code>caution</code></li><li><code>danger</code></li><li><code>seealso</code></li></ul> | No. Defaults to `note` |
| `title` | String | The title of the callout | No. Defaults to `type` |

### Examples

#### Note callout

```mdx
<Aside type="note" title="A note callout">
This is a *note* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>
```

<Aside type="note" title="A note callout">
This is a *note* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>

#### Tip callout

```mdx
<Aside type="tip" title="A tip callout">
This is a *tip* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>
```

<Aside type="tip" title="A tip callout">
This is a *tip* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>

#### Caution callout

```mdx
<Aside type="caution" title="A caution callout">
This is a *caution* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>
```

<Aside type="caution" title="A caution callout">
This is a *caution* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>

#### Danger callout

```mdx
<Aside type="danger" title="A danger callout">
This is a *danger* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>
```

<Aside type="danger" title="A danger callout">
This is a *danger* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>

#### Seealso callout

```mdx
<Aside type="seealso" title="A seealso callout">
This is a *seealso* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>
```

<Aside type="seealso" title="A seealso callout">
This is a *seealso* callout. It **renders**
[Markdown](https://www.markdownguide.org/).
</Aside>

0 comments on commit 2e2c9cc

Please sign in to comment.