Skip to content

Commit

Permalink
docs: add separate examples page
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed May 31, 2024
1 parent f5ba72f commit 2abd476
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 25 deletions.
17 changes: 0 additions & 17 deletions docs/components/hot-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,3 @@
| Event |
|---------|
| `click` |

## Example

<!-- markdownlint-disable -->

<hot-button id="hotButton">Click Me!</hot-button>
<script>
const button = document.getElementById('hotButton');

button.addEventListener('click', () => {
alert('Button Clicked!');
});
</script>

<br>

<!-- markdownlint-enable -->
8 changes: 0 additions & 8 deletions docs/components/hot-toolbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,3 @@
| `hot-rightalign-click` |
| `hot-underline-click` |
| `hot-undo-click` |

## Example

<!-- markdownlint-disable -->

<hot-toolbar></hot-toolbar>

<!-- markdownlint-enable -->
1 change: 1 addition & 0 deletions docs/components/hot-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| Property | Attribute | Type | Default | Description |
|----------|-----------|-----------|----------------|----------------------------------|
| `domain` | `domain` | `string` | "" | The domains to apply tracking. |
| `force` | `force` | `boolean` | false | Force display the banner. |
| `isOpen` | | `boolean` | true | |
| `name` | `name` | `string` | "hot-tracking" | |
| `siteId` | `site-id` | `string` | "" | The Matomo site id for tracking. |
Expand Down
28 changes: 28 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Component Examples

As web components can be rendered in HTML / Markdown, here are some examples.

## Button

<!-- markdownlint-disable -->

<hot-button id="hotButton">Click Me!</hot-button>
<script>
const button = document.getElementById('hotButton');

button.addEventListener('click', () => {
alert('Button Clicked!');
});
</script>

<br>

<!-- markdownlint-enable -->

## Toolbar

<!-- markdownlint-disable -->

<hot-toolbar></hot-toolbar>

<!-- markdownlint-enable -->
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ nav:
- Header: components/hot-header.md
- Toolbar: components/hot-toolbar.md
- Tracking: components/hot-tracking.md
- Examples: examples.md
- Storybook: storybook.md
- License: LICENSE.md
- Changelog: CHANGELOG.md

0 comments on commit 2abd476

Please sign in to comment.