Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
docs(vue): add docs for embed-content and embed-instagram component
Browse files Browse the repository at this point in the history
  • Loading branch information
preventdefault committed Jun 19, 2020
1 parent 782d96d commit 929ca2f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/vue/components/EmbedContent/EmbedContent.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import Vue, { CreateElement, PropType, VNode } from 'vue';
import Vue, { CreateElement, VNode } from 'vue';
import { getScriptSrcFromOembedHTML, loadScript } from '../../../embed-utils';
type Props = {
Expand All @@ -12,7 +12,7 @@ export default Vue.extend<NonNullish, NonNullish, NonNullish, Props>({
name: 'EmbedContent',
props: {
content: {
type: String as PropType<string>,
type: String,
required: true,
},
},
Expand Down
28 changes: 27 additions & 1 deletion src/vue/components/EmbedContent/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# Component for rendering arbitrary html content
# Component for rendering arbitrary (OEmbed) html content

This component can be used to process and display arbitrary (OEmbed) content.

## Props

| Name | Type | Required | Description |
| ------- | ------ | -------- | ----------- |
| content | string | true | HTML embed content for given vendor that usually comes from Iframely (OEmbed format) |

## Example

```vue
<template>
<embed-content :content="content"></embed-content>
</template>
<script>
import { EmbedContent } from '@spring-media/red-sourcepoint-cmp/dist/esm/vue/components';
export default {
components: { EmbedContent },
data: () => ({
content: 'some oembed/iframely html content'
}),
};
</script>
```
2 changes: 1 addition & 1 deletion src/vue/components/EmbedInstagram/EmbedInstagram.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default Vue.extend<Data, Methods, NonNullish, Props>({
props: {
content: {
type: String,
default: '',
required: true,
},
},
methods: {
Expand Down
30 changes: 30 additions & 0 deletions src/vue/components/EmbedInstagram/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# Component for Instagram Embeds

This component can be used to process and display Instagram (OEmbed format) content.

> Instagram needs to run some code after embedding content into the page. For other vendors consider using the provided generic embed component [EmbedContent](../EmbedContent/README.md).

## Props

| Name | Type | Required | Description |
| ------- | ------ | -------- | ----------- |
| content | string | true | HTML embed content for given vendor that usually comes from Iframely (OEmbed format) |

## Example

```vue
<template>
<embed-instagram :content="content"></embed-instagram>
</template>
<script>
import { EmbedInstagram } from '@spring-media/red-sourcepoint-cmp/dist/esm/vue/components';
export default {
components: { EmbedInstagram },
data: () => ({
content: 'some oembed/iframely html content'
}),
};
</script>
```

0 comments on commit 929ca2f

Please sign in to comment.