version docs pages
This commit is contained in:
parent
5865251560
commit
21e175d3a6
31 changed files with 329 additions and 388 deletions
89
src/pages/docs/[version]/types/[module]/[type].astro
Normal file
89
src/pages/docs/[version]/types/[module]/[type].astro
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
---
|
||||
import { getQMLTypeLink } from "@config/io/helpers";
|
||||
import { processMarkdown } from "@config/io/markdown";
|
||||
import { getVersionsData } from "@config/io/generateTypeData";
|
||||
import DocsLayout from "@layouts/DocsLayout.astro";
|
||||
import TOC from "@components/navigation/sidebars/TOC.astro";
|
||||
import Properties from "@components/type/Properties.astro";
|
||||
import Functions from "@components/type/Functions.astro";
|
||||
import Signals from "@components/type/Signals.astro";
|
||||
import Variants from "@components/type/Variants.astro";
|
||||
import Badge from "@components/Badge.astro";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return (await getVersionsData()).versions.flatMap(version => {
|
||||
return version.modules.flatMap(module => {
|
||||
return module.types.map(type => ({
|
||||
params: { version: version.name, module: module.name, type: type.name },
|
||||
props: { version, module, type },
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const { version, module, type } = Astro.props;
|
||||
|
||||
const superLink = type.super ? getQMLTypeLink(version.name, type.super) : null;
|
||||
|
||||
const details = type.details
|
||||
? await processMarkdown(version.name, type.details)
|
||||
: null;
|
||||
---
|
||||
<DocsLayout title={`${module.name} - ${type.name}`} description={type.description ?? ""} type={type}>
|
||||
<div class="docs">
|
||||
<div class="docs-content typedocs-content">
|
||||
<hr />
|
||||
<section class="typedocs-title">
|
||||
<h2 class="typedocs-title-text" data-pagefind-weight="10">
|
||||
{type.name}:
|
||||
{type.super?.name ? (
|
||||
<a
|
||||
href={superLink!}
|
||||
data-pagefind-ignore
|
||||
>
|
||||
{type.super.name}
|
||||
</a>
|
||||
):(
|
||||
<span class="type-datatype" data-pagefind-ignore>{type.name}</span>
|
||||
)
|
||||
}
|
||||
</h2>
|
||||
{type.flags && (
|
||||
<div class="type-flags" data-pagefind-ignore>{type.flags.map(flag => (
|
||||
<Badge badgeText={flag}/>
|
||||
))}</div>
|
||||
)}
|
||||
</section>
|
||||
<code class="type-module" data-pagefind-ignore>import {module.name}</code>
|
||||
<section class="typedocs-data typedata">
|
||||
<subheading class="typedocs-subheading">
|
||||
{details ? <span class="parsedMD" set:html={details}/> : (<span class="toparse">{type.description}</span>)}
|
||||
</subheading>
|
||||
{ Object.keys(type.properties ?? {}).length != 0 && (
|
||||
<h2>Properties <a href={`/docs/${version.name}/guide/qml-language#properties`}>[?]</a></h2>
|
||||
<Properties props={type.properties!}/>
|
||||
)}
|
||||
{ (type.functions?.length ?? 0) != 0 && (
|
||||
<h2>Functions <a href={`/docs/${version.name}guide/qml-language#functions`}>[?]</a></h2>
|
||||
<Functions
|
||||
funcData={type.functions!}
|
||||
/>
|
||||
)}
|
||||
{ Object.keys(type.signals ?? {}).length != 0 && (
|
||||
<h2>Signals <a href={`/docs/${version.name}guide/qml-language#signals`}>[?]</a></h2>
|
||||
<Signals
|
||||
signals={type.signals!}
|
||||
/>
|
||||
)}
|
||||
{ Object.keys(type.variants ?? {}).length != 0 && (
|
||||
<h2>Variants</h2>
|
||||
<Variants
|
||||
variants={type.variants!}
|
||||
/>
|
||||
)}
|
||||
</section>
|
||||
</div>
|
||||
<TOC mobile={false} type={type} data-pagefind-ignore/>
|
||||
</div>
|
||||
</DocsLayout>
|
||||
|
||||
45
src/pages/docs/[version]/types/[module]/index.astro
Normal file
45
src/pages/docs/[version]/types/[module]/index.astro
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
import DocsLayout from "@layouts/DocsLayout.astro";
|
||||
import { getVersionsData } from "@config/io/generateTypeData";
|
||||
import { processMarkdown } from "@src/config/io/markdown";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return (await getVersionsData()).versions.flatMap(version => {
|
||||
return version.modules.map(module => ({
|
||||
params: { version: version.name, module: module.name },
|
||||
props: { version, module },
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
const { version, module } = Astro.props;
|
||||
const details = module.details
|
||||
? await processMarkdown(version.name, module.details)
|
||||
: null;
|
||||
---
|
||||
|
||||
<DocsLayout
|
||||
title={module.name + " Module Types"}
|
||||
description="Quickshell Type Documentation"
|
||||
>
|
||||
<div class="docs-content">
|
||||
<hr />
|
||||
<h2 class="typedocs-title">{module.name} Definitions</h2>
|
||||
<section>
|
||||
<span>{module.description}</span>
|
||||
<div class="root-nav" data-pagefind-ignore>
|
||||
{module.types.map(type =>
|
||||
(
|
||||
<div class="root-nav-entry">
|
||||
<a class="root-nav-link" href={`/docs/${version.name}/types/${module.name}/${type.name}`}>
|
||||
{type.name}
|
||||
</a>
|
||||
<span class="root-nav-desc">{type.description}</span>
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
{details && <span class="parsedMD" set:html={details}/>}
|
||||
</section>
|
||||
</div>
|
||||
</DocsLayout>
|
||||
32
src/pages/docs/[version]/types/index.astro
Normal file
32
src/pages/docs/[version]/types/index.astro
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
import DocsLayout from "@layouts/DocsLayout.astro";
|
||||
import { getVersionsData } from "@config/io/generateTypeData";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
return (await getVersionsData()).versions.map(version => ({
|
||||
params: { version: version.name },
|
||||
props: { version },
|
||||
}));
|
||||
}
|
||||
|
||||
const { version } = Astro.props;
|
||||
---
|
||||
<DocsLayout title="Quickshell Module Listing" description="Quickshell Type Documentation">
|
||||
<div class="docs-content">
|
||||
<hr/>
|
||||
<h2>Module Listing</h2>
|
||||
<section>
|
||||
<span>All modules included with Quickshell</span>
|
||||
<div class="root-nav" data-pagefind-ignore>
|
||||
{version.modules.map(module => (
|
||||
<div class="root-nav-entry">
|
||||
<a class="root-nav-link" href={`/docs/${version.name}/types/${module.name}`}>
|
||||
{module.name}
|
||||
</a>
|
||||
<span class="root-nav-desc">{module.description}</span>
|
||||
</div>)
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</DocsLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue