Merge pull request #236 from reuters-graphics/mf-byline-docs

Adds ArchieML example to docs
This commit is contained in:
MinamiFunakoshiTR 2025-03-13 14:21:28 -05:00 committed by GitHub
commit fd5df38dcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 3 deletions

View file

@ -25,6 +25,37 @@ The `Byline` component adds a byline, published and updated datelines to your pa
/> />
``` ```
## Using with ArchieML docs
With the Graphics Kit, you'll likely get your text value from an ArchieML doc...
```yaml
# ArchieML doc
[authors]
* Dea Bankova
* Prasanta Kumar Dutta
* Anurag Rao
* Mariano Zafra
[]
publishTime: 2021-09-12T00:00:00.000Z
updateTime: 2021-09-12T12:57:00.000Z
```
... which you'll pass to the `Byline` component.
```svelte
<script>
import { Byline } from '@reuters-graphics/graphics-components';
import content from '$locales/en/content.json';
</script>
<Byline
authors={content.authors}
publishTime={content.publishTime}
updateTime={content.updateTime}
/>
```
<Canvas of={BylineStories.Demo} /> <Canvas of={BylineStories.Demo} />
## Cutomisation ## Cutomisation

View file

@ -42,16 +42,16 @@
/** /**
* Optional snippet for a custom byline. * Optional snippet for a custom byline.
*/ */
byline?: Snippet | null; byline?: Snippet;
/** /**
* Optional snippet for a custom published dateline. * Optional snippet for a custom published dateline.
*/ */
// Specify that this prop should have the type of a Svelte snippet, i.e. basic html // Specify that this prop should have the type of a Svelte snippet, i.e. basic html
published?: Snippet | null; published?: Snippet;
/** /**
* Optional snippet for a custom updated dateline. * Optional snippet for a custom updated dateline.
*/ */
updated?: Snippet | null; updated?: Snippet;
} }
let { let {