diff --git a/src/components/EndNotes/EndNotes.mdx b/src/components/EndNotes/EndNotes.mdx new file mode 100644 index 00000000..b6f64b5b --- /dev/null +++ b/src/components/EndNotes/EndNotes.mdx @@ -0,0 +1,67 @@ +import { Meta, Canvas } from '@storybook/blocks'; + +import * as EndNotesStories from './EndNotes.stories.svelte'; + + + +# EndNotes + +The `EndNotes` component adds notes such as sources, clarifiying notes and minor corrections that come at the end of a story. + +```svelte + + + +``` + + + +## Using with ArchieML docs + +With the Graphics Kit, you'll likely get your text value from an ArchieML doc... + +```yaml +# ArchieML doc +[endNotes] +title: Note +text: Data is current as of today + +title: Sources +text: Data, Inc. + +title: Edited by +text: Editor, Copyeditor +[] +``` + +... which you'll pass to the `EndNotes` component. + +```svelte + + + + +``` + + diff --git a/src/components/EndNotes/EndNotes.stories.svelte b/src/components/EndNotes/EndNotes.stories.svelte index 0a78b84f..19792051 100644 --- a/src/components/EndNotes/EndNotes.stories.svelte +++ b/src/components/EndNotes/EndNotes.stories.svelte @@ -1,20 +1,15 @@ - - - + diff --git a/src/components/EndNotes/EndNotes.svelte b/src/components/EndNotes/EndNotes.svelte index 1037709f..32a7ab6e 100644 --- a/src/components/EndNotes/EndNotes.svelte +++ b/src/components/EndNotes/EndNotes.svelte @@ -7,7 +7,6 @@ title: string; /** * Contents of the note as a markdown string - * @required */ text: string; } @@ -17,28 +16,24 @@ interface Props { /** * An array of endnote items. - * @required */ - notes?: EndNote[]; + notes: EndNote[]; } - let { notes = [] }: Props = $props(); + let { notes }: Props = $props(); - {#if notes} - {#each notes as note} -
- -
-
- -
- {/each} - {/if} + {#each notes as note} +
+ +
+
+ +
+ {/each}
-