move type-link processing to build stage
This commit is contained in:
parent
ab2a9ca7ed
commit
6d353e0c6b
15 changed files with 161 additions and 300 deletions
|
@ -3,18 +3,15 @@ import type {
|
|||
QMLTypeLinkObject,
|
||||
QuickshellFunction,
|
||||
} from "@config/io/types";
|
||||
import {
|
||||
parseMarkdown,
|
||||
getQMLTypeLink,
|
||||
} from "@config/io/helpers";
|
||||
import { getQMLTypeLink } from "@config/io/helpers";
|
||||
import { Tag } from "@icons";
|
||||
import TypeDetails from "./TypeDetails.astro"
|
||||
|
||||
export interface Props {
|
||||
funcData: QuickshellFunction[];
|
||||
title: string;
|
||||
}
|
||||
|
||||
const { funcData, title } = Astro.props;
|
||||
const { funcData } = Astro.props;
|
||||
---
|
||||
<ul class="typedata typefuncs">
|
||||
{
|
||||
|
@ -51,9 +48,7 @@ const { funcData, title } = Astro.props;
|
|||
)
|
||||
:null
|
||||
}
|
||||
<section class="typedata-details">
|
||||
<div class="typedata-detailsdata" set:html={parseMarkdown(item.details, title)}/>
|
||||
</section>
|
||||
<TypeDetails markdown={item.details} />
|
||||
</li>
|
||||
)
|
||||
})
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
---
|
||||
import {
|
||||
parseMarkdown,
|
||||
getQMLTypeLink,
|
||||
} from "@config/io/helpers";
|
||||
import { getQMLTypeLink } from "@config/io/helpers";
|
||||
import type {
|
||||
QMLTypeLinkObject,
|
||||
QuickshellProps,
|
||||
} from "@config/io/types";
|
||||
import { Tag, Flag } from "@icons";
|
||||
|
||||
import TypeDetails from "./TypeDetails.astro"
|
||||
|
||||
export interface Props {
|
||||
propsKeys: string[];
|
||||
propsData: QuickshellProps;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const { propsKeys, propsData, title } = Astro.props;
|
||||
const { propsKeys, propsData } = Astro.props;
|
||||
---
|
||||
<ul class="typedata typeprops">
|
||||
{
|
||||
|
@ -73,9 +71,7 @@ const { propsKeys, propsData, title } = Astro.props;
|
|||
</p>
|
||||
):null
|
||||
}
|
||||
<section class="typedata-details">
|
||||
<div id="injectedMd" class="typedata-detailsdata" set:html={parseMarkdown(propData.details, title)} />
|
||||
</section>
|
||||
<TypeDetails markdown={propData.details} />
|
||||
</li>
|
||||
)
|
||||
})
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
---
|
||||
import type { QuickshellSignal } from "@config/io/types";
|
||||
import { Tag, PowerCord } from "@icons";
|
||||
import { parseMarkdown } from "@config/io/helpers";
|
||||
import TypeDetails from "./TypeDetails.astro";
|
||||
|
||||
export interface Props {
|
||||
signalKeys: string[];
|
||||
signalsData: QuickshellSignal;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const { signalKeys, signalsData, title } = Astro.props;
|
||||
const { signalKeys, signalsData } = Astro.props;
|
||||
---
|
||||
<ul class="typedata typesignals">
|
||||
{
|
||||
|
@ -44,9 +43,7 @@ const { signalKeys, signalsData, title } = Astro.props;
|
|||
</p>
|
||||
) : null
|
||||
}
|
||||
<section class="typedata-details">
|
||||
<div class="typedata-detailsdata" set:html={parseMarkdown(signalData.details, title)} />
|
||||
</section>
|
||||
<TypeDetails markdown={signalData.details} />
|
||||
</li>
|
||||
)
|
||||
})
|
||||
|
|
14
src/components/type/TypeDetails.astro
Normal file
14
src/components/type/TypeDetails.astro
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
import { processQsMarkdown } from "@config/io/helpers"
|
||||
|
||||
export interface Props {
|
||||
markdown?: string,
|
||||
}
|
||||
|
||||
const { markdown } = Astro.props;
|
||||
|
||||
const html = markdown ? await processQsMarkdown(markdown) : null;
|
||||
---
|
||||
<section class="typedata-details">
|
||||
{html ? <div class="typedata-detailsdata" set:html={html} /> : <em>No details provided</em>}
|
||||
</section>
|
|
@ -1,15 +1,14 @@
|
|||
---
|
||||
import type { QuickshellVariant } from "@config/io/types";
|
||||
import { FourDiamonds } from "../icons";
|
||||
import { parseMarkdown } from "@src/config/io/helpers";
|
||||
import TypeDetails from "./TypeDetails.astro";
|
||||
|
||||
export interface Props {
|
||||
variantKeys: string[];
|
||||
variantsData: QuickshellVariant;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const { variantKeys, variantsData, title } = Astro.props;
|
||||
const { variantKeys, variantsData } = Astro.props;
|
||||
---
|
||||
<ul class="typedata typevariants">
|
||||
{
|
||||
|
@ -34,9 +33,7 @@ const { variantKeys, variantsData, title } = Astro.props;
|
|||
)
|
||||
:null
|
||||
}
|
||||
<section class="typedata-details">
|
||||
<div class="typedata-detailsdata" set:html={parseMarkdown(variantData.details, title)} />
|
||||
</section>
|
||||
<TypeDetails markdown={variantData.details} />
|
||||
</li>
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue