From d327e81a1ede51f29c36ec6e059df4af2965ad52 Mon Sep 17 00:00:00 2001 From: charlesLoder Date: Mon, 5 Aug 2024 17:33:31 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20charlesL?= =?UTF-8?q?oder/hebrew-transliteration@8482ff028a6aa0fb308754ddcb2b02af8e6?= =?UTF-8?q?0d5bd=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .astro/settings.json | 5 + .astro/types.d.ts | 206 ++++++++++++++++++ astro.config.mjs | 43 ++++ env.d.ts | 1 + src/content/config.ts | 6 + .../docs/getting-started/quick-start.mdx | 62 ++++++ src/env.d.ts | 3 + 7 files changed, 326 insertions(+) create mode 100644 .astro/settings.json create mode 100644 .astro/types.d.ts create mode 100644 astro.config.mjs create mode 100644 env.d.ts create mode 100644 src/content/config.ts create mode 100644 src/content/docs/getting-started/quick-start.mdx create mode 100644 src/env.d.ts diff --git a/.astro/settings.json b/.astro/settings.json new file mode 100644 index 0000000..041ee86 --- /dev/null +++ b/.astro/settings.json @@ -0,0 +1,5 @@ +{ + "_variables": { + "lastUpdateCheck": 1720661981335 + } +} \ No newline at end of file diff --git a/.astro/types.d.ts b/.astro/types.d.ts new file mode 100644 index 0000000..74a56f3 --- /dev/null +++ b/.astro/types.d.ts @@ -0,0 +1,206 @@ +declare module 'astro:content' { + interface Render { + '.mdx': Promise<{ + Content: import('astro').MarkdownInstance<{}>['Content']; + headings: import('astro').MarkdownHeading[]; + remarkPluginFrontmatter: Record; + }>; + } +} + +declare module 'astro:content' { + interface Render { + '.md': Promise<{ + Content: import('astro').MarkdownInstance<{}>['Content']; + headings: import('astro').MarkdownHeading[]; + remarkPluginFrontmatter: Record; + }>; + } +} + +declare module 'astro:content' { + type Flatten = T extends { [K: string]: infer U } ? U : never; + + export type CollectionKey = keyof AnyEntryMap; + export type CollectionEntry = Flatten; + + export type ContentCollectionKey = keyof ContentEntryMap; + export type DataCollectionKey = keyof DataEntryMap; + + type AllValuesOf = T extends any ? T[keyof T] : never; + type ValidContentEntrySlug = AllValuesOf< + ContentEntryMap[C] + >['slug']; + + export function getEntryBySlug< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >( + collection: C, + // Note that this has to accept a regular string too, for SSR + entrySlug: E + ): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + + export function getDataEntryById( + collection: C, + entryId: E + ): Promise>; + + export function getCollection>( + collection: C, + filter?: (entry: CollectionEntry) => entry is E + ): Promise; + export function getCollection( + collection: C, + filter?: (entry: CollectionEntry) => unknown + ): Promise[]>; + + export function getEntry< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >(entry: { + collection: C; + slug: E; + }): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + export function getEntry< + C extends keyof DataEntryMap, + E extends keyof DataEntryMap[C] | (string & {}), + >(entry: { + collection: C; + id: E; + }): E extends keyof DataEntryMap[C] + ? Promise + : Promise | undefined>; + export function getEntry< + C extends keyof ContentEntryMap, + E extends ValidContentEntrySlug | (string & {}), + >( + collection: C, + slug: E + ): E extends ValidContentEntrySlug + ? Promise> + : Promise | undefined>; + export function getEntry< + C extends keyof DataEntryMap, + E extends keyof DataEntryMap[C] | (string & {}), + >( + collection: C, + id: E + ): E extends keyof DataEntryMap[C] + ? Promise + : Promise | undefined>; + + /** Resolve an array of entry references from the same collection */ + export function getEntries( + entries: { + collection: C; + slug: ValidContentEntrySlug; + }[] + ): Promise[]>; + export function getEntries( + entries: { + collection: C; + id: keyof DataEntryMap[C]; + }[] + ): Promise[]>; + + export function reference( + collection: C + ): import('astro/zod').ZodEffects< + import('astro/zod').ZodString, + C extends keyof ContentEntryMap + ? { + collection: C; + slug: ValidContentEntrySlug; + } + : { + collection: C; + id: keyof DataEntryMap[C]; + } + >; + // Allow generic `string` to avoid excessive type errors in the config + // if `dev` is not running to update as you edit. + // Invalid collection names will be caught at build time. + export function reference( + collection: C + ): import('astro/zod').ZodEffects; + + type ReturnTypeOrOriginal = T extends (...args: any[]) => infer R ? R : T; + type InferEntrySchema = import('astro/zod').infer< + ReturnTypeOrOriginal['schema']> + >; + + type ContentEntryMap = { + "docs": { +"api/README.md": { + id: "api/README.md"; + slug: "api/readme"; + body: string; + collection: "docs"; + data: InferEntrySchema<"docs"> +} & { render(): Render[".md"] }; +"api/classes/Schema.md": { + id: "api/classes/Schema.md"; + slug: "api/classes/schema"; + body: string; + collection: "docs"; + data: InferEntrySchema<"docs"> +} & { render(): Render[".md"] }; +"api/classes/Text.md": { + id: "api/classes/Text.md"; + slug: "api/classes/text"; + body: string; + collection: "docs"; + data: InferEntrySchema<"docs"> +} & { render(): Render[".md"] }; +"api/functions/remove.md": { + id: "api/functions/remove.md"; + slug: "api/functions/remove"; + body: string; + collection: "docs"; + data: InferEntrySchema<"docs"> +} & { render(): Render[".md"] }; +"api/functions/sequence.md": { + id: "api/functions/sequence.md"; + slug: "api/functions/sequence"; + body: string; + collection: "docs"; + data: InferEntrySchema<"docs"> +} & { render(): Render[".md"] }; +"api/functions/transliterate.md": { + id: "api/functions/transliterate.md"; + slug: "api/functions/transliterate"; + body: string; + collection: "docs"; + data: InferEntrySchema<"docs"> +} & { render(): Render[".md"] }; +"api/interfaces/RemoveOptions.md": { + id: "api/interfaces/RemoveOptions.md"; + slug: "api/interfaces/removeoptions"; + body: string; + collection: "docs"; + data: InferEntrySchema<"docs"> +} & { render(): Render[".md"] }; +"getting-started/quick-start.mdx": { + id: "getting-started/quick-start.mdx"; + slug: "getting-started/quick-start"; + body: string; + collection: "docs"; + data: InferEntrySchema<"docs"> +} & { render(): Render[".mdx"] }; +}; + + }; + + type DataEntryMap = { + + }; + + type AnyEntryMap = ContentEntryMap & DataEntryMap; + + export type ContentConfig = typeof import("../src/content/config.js"); +} diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 0000000..060a423 --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,43 @@ +import starlight from "@astrojs/starlight"; +import { defineConfig } from "astro/config"; +import starlightTypeDoc, { typeDocSidebarGroup } from "starlight-typedoc"; + +// https://astro.build/config +export default defineConfig({ + srcDir: "./docs/src", + site: "https://charlesLoder.github.io", + base: process.env.NODE_ENV === "production" ? "/hebrew-transliteration/" : "", + redirects: { + "/": { + status: 302, + destination: "/getting-started/quick-start" + } + }, + integrations: [ + starlight({ + title: `hebrew-transliteration v${process.env.npm_package_version || ""}`, + plugins: [ + starlightTypeDoc({ + entryPoints: ["./src/index.ts"], + tsconfig: "./.config/tsconfig.json", + typeDoc: { + expandObjects: true, + parametersFormat: "table", + anchorPrefix: "/hebrew-transliteration" + } + }) + ], + social: { + github: "https://github.com/charlesLoder/hebrew-transliteration" + }, + sidebar: [ + { + label: "Getting started", + autogenerate: { directory: "getting-started" } + }, + // Add the generated sidebar group to the sidebar. + typeDocSidebarGroup + ] + }) + ] +}); diff --git a/env.d.ts b/env.d.ts new file mode 100644 index 0000000..8c34fb4 --- /dev/null +++ b/env.d.ts @@ -0,0 +1 @@ +/// \ No newline at end of file diff --git a/src/content/config.ts b/src/content/config.ts new file mode 100644 index 0000000..9b921a1 --- /dev/null +++ b/src/content/config.ts @@ -0,0 +1,6 @@ +import { defineCollection } from "astro:content"; +import { docsSchema } from "@astrojs/starlight/schema"; + +export const collections = { + docs: defineCollection({ schema: docsSchema() }) +}; diff --git a/src/content/docs/getting-started/quick-start.mdx b/src/content/docs/getting-started/quick-start.mdx new file mode 100644 index 0000000..d52c3da --- /dev/null +++ b/src/content/docs/getting-started/quick-start.mdx @@ -0,0 +1,62 @@ +--- +title: Quickstart +--- + +import { Code, TabItem, Tabs } from "@astrojs/starlight/components"; + +Create customized Hebrew transliterations. + +## Installation + + + + + + + + + + + + + +## Usage + + + + + + + + + + + + + + + + +## Key features + +This package contains 3 functions for: + +- transliteration — [`transliterate()`](/api/functions/transliterate) +- removing niqqud — [`remove()`](/api/functions/remove) +- sequencings text — [`sequence()`](/api/functions/sequence) diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 0000000..059541a --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1,3 @@ +/// +/// +///