Add global option to HelpItem

This commit is contained in:
Luc Mcgrady 2025-06-30 21:11:32 +01:00
parent da90705346
commit 9385036bd4
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C
3 changed files with 16 additions and 1 deletions

View file

@ -8,6 +8,8 @@
import Row from "./Row.svelte";
import type { HelpItem } from "./types";
import { mdiEarth } from "./icons";
import Icon from "./Icon.svelte";
export let item: HelpItem;
</script>
@ -21,6 +23,11 @@
{/if}
</h2>
{#if item.help}
{#if item.global}
<div class="icon">
<Icon icon={mdiEarth} />
</div>
{/if}
{@html renderMarkdown(item.help)}
{:else}
{@html renderMarkdown(
@ -54,4 +61,11 @@
color: var(--fg-subtle);
font-size: small;
}
.icon {
display: inline-block;
width: 1em;
fill: currentColor;
margin-bottom: 1em;
}
</style>

View file

@ -9,6 +9,7 @@ export type HelpItem = {
help?: string;
url?: string;
sched?: HelpItemScheduler;
global?: boolean;
};
export enum HelpItemScheduler {

View file

@ -133,9 +133,9 @@
},
newCardsIgnoreReviewLimit: {
title: tr.deckConfigNewCardsIgnoreReviewLimit(),
help: newCardsIgnoreReviewLimitHelp,
url: HelpPage.DeckOptions.newCardsday,
global: true,
},
applyAllParentLimits: {
title: tr.deckConfigApplyAllParentLimits(),