From 64e76e5bc0372ebcb129abe449142752880b4379 Mon Sep 17 00:00:00 2001 From: MinamiFunakoshiTR Date: Thu, 6 Mar 2025 12:25:04 -0800 Subject: [PATCH 1/5] updates endnotes --- src/components/EndNotes/EndNotes.mdx | 61 +++++++++++++++++++ .../EndNotes/EndNotes.stories.svelte | 19 ++---- src/components/EndNotes/EndNotes.svelte | 15 ++--- .../EndNotes/stories/docs/component.md | 24 -------- 4 files changed, 70 insertions(+), 49 deletions(-) create mode 100644 src/components/EndNotes/EndNotes.mdx delete mode 100644 src/components/EndNotes/stories/docs/component.md diff --git a/src/components/EndNotes/EndNotes.mdx b/src/components/EndNotes/EndNotes.mdx new file mode 100644 index 00000000..3ab4a92f --- /dev/null +++ b/src/components/EndNotes/EndNotes.mdx @@ -0,0 +1,61 @@ +import { Meta } from '@storybook/blocks'; + +import * as EndNotesStories from './EndNotes.stories.svelte'; + + + +# EndNotes + +End notes includes notes to the main article — usually things like sources, clarifiying notes and minor corrections at the end of a story. + +Use it like this: + +```svelte + + + +``` + +... or more commonly, you'll use it with a **ArchieML doc** in the **Graphics Kit** like this: + +```yaml +# ArchieML doc +[endNotes] +title: Note +text: Data is current as of today + +title: Sources +text: Data, Inc. + +title: Edited by +text: Editor, Copyeditor +[] +``` + +```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 5917b29f..019be9ab 100644 --- a/src/components/EndNotes/EndNotes.svelte +++ b/src/components/EndNotes/EndNotes.svelte @@ -7,21 +7,17 @@ title: string; /** * Contents of the note as a markdown string - * @required */ text: string; } - - import Block from '../Block/Block.svelte'; import Markdown from '../Markdown/Markdown.svelte'; interface Props { /** - * An array of endnote items. - * @required - */ - notes?: EndNote[]; + * An array of endnote items. + */ + notes: EndNote[]; } let { notes = [] }: Props = $props(); @@ -31,16 +27,15 @@ {#if notes} {#each notes as note}
- +
- +
{/each} {/if} -