feat: some more docs

This commit is contained in:
TrèsAbhi committed 2026-03-20 19:58:56 -05:00
1 parent d88f7ad539
commit c116b40dfc
5 files changed
+18 -14

No files matched your search

@@ -59,6 +59,8 @@ for (const line of bodyOriginal.split("\n")) {
flex-direction: column; flex-direction: column;
gap: var(--space-4); gap: var(--space-4);
width: 100%;
padding-top: var(--space-4); padding-top: var(--space-4);
padding-bottom: var(--space-3); padding-bottom: var(--space-3);
} }
@@ -1,22 +1,12 @@
--- ---
import { resolve } from "path";
import { readFile } from "fs/promises";
import { Link } from "./Link";
import { api } from "../core/api/dynamic";
import HighlightedCodeBlock from "./HighlightedCodeBlock.astro";
import { Text } from "./Text";
import { ArrowBottomRightIcon } from "@radix-ui/react-icons"; import { ArrowBottomRightIcon } from "@radix-ui/react-icons";
import { Code } from "./Code"; import { resolve } from "path";
import { import {
createProgram, createProgram,
forEachChild, forEachChild,
isArrayTypeNode, isArrayTypeNode,
isEnumDeclaration,
isExpressionWithTypeArguments,
isInterfaceDeclaration, isInterfaceDeclaration,
isMethodSignature,
isPropertySignature, isPropertySignature,
isTypeAliasDeclaration,
isTypeNode, isTypeNode,
isTypeReferenceNode, isTypeReferenceNode,
type InterfaceDeclaration, type InterfaceDeclaration,
@@ -24,12 +14,19 @@ import {
type Symbol, type Symbol,
type TypeNode, type TypeNode,
} from "typescript"; } from "typescript";
import { api } from "../core/api/dynamic";
import { Code } from "./Code";
import HighlightedCodeBlock from "./HighlightedCodeBlock.astro";
import { Link } from "./Link";
import { Text } from "./Text";
interface Props { interface Props {
value: string; value: string;
locale: string; locale: string;
} }
const DEFAULT_EXPANDED = 8;
const { value, locale } = Astro.props; const { value, locale } = Astro.props;
const strings = await api.strings(locale); const strings = await api.strings(locale);
@@ -192,7 +189,10 @@ content = content.trim();
<ArrowBottomRightIcon /> <ArrowBottomRightIcon />
</div> </div>
<div class="types"> <div
class="types"
data-expanded={content.split("\n").length <= DEFAULT_EXPANDED}
>
<HighlightedCodeBlock {lang} content={content} /> <HighlightedCodeBlock {lang} content={content} />
<div class="overlay"> <div class="overlay">
+1 -1
View File
@@ -195,7 +195,7 @@ export class ServerAPI extends AbstractAPI {
protected async _avatarList() { protected async _avatarList() {
const avatars = await this.avatars(); const avatars = await this.avatars();
const list = Object.keys(avatars.avatars); const list = avatars.avatars.map((avatar) => avatar.name);
return { list }; return { list };
} }
@@ -2,7 +2,7 @@ import { api } from "../../../core/api/dynamic";
/** /**
* Identical to `avatars/[id].json`, but returns data on all avatars at once, * Identical to `avatars/[id].json`, but returns data on all avatars at once,
* mapped by `id`. Beware, the returned `JSON` is large. * mapped by `id`.
* *
* @type avatars.Avatars * @type avatars.Avatars
*/ */
@@ -1,6 +1,8 @@
import { api } from "../../../core/api/dynamic"; import { api } from "../../../core/api/dynamic";
/** /**
* Returns a list of all avatars ids.
*
* @type avatar_list.AvatarList * @type avatar_list.AvatarList
*/ */
export async function GET() { export async function GET() {