diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..d447da8 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +src/content/index.ts \ No newline at end of file diff --git a/package.json b/package.json index 71ddfd6..d8951e5 100644 --- a/package.json +++ b/package.json @@ -67,4 +67,4 @@ "vite": "^4.0.0", "vite-plugin-pwa": "^0.15.2" } -} +} \ No newline at end of file diff --git a/src/content/index.ts b/src/content/index.ts index 683371f..f1f6c21 100644 --- a/src/content/index.ts +++ b/src/content/index.ts @@ -130,13 +130,13 @@ import * as phraseBuilder from "./phrase-builder.mdx"; import * as dictionary from "./dictionary.mdx"; type ChapterSection = { - import: any; - slug: string; + "import": any; + "slug": string; }; type ChaptersSection = { - heading: string; - subdirectory: string; - chapters: ChapterSection[]; + "heading": string; + "subdirectory": string; + "chapters": ChapterSection[]; }; // for the super hacky sitemap generator to work this array needs to be @@ -145,297 +145,297 @@ type ChaptersSection = { export const contentTree: (ChapterSection | ChaptersSection)[] = /* content-tree */ [ { - import: intro, - slug: "intro", + "import": intro, + "slug": "intro" }, { - import: games, - slug: "games", + "import": games, + "slug": "games" }, { - import: phraseBuilder, - slug: "phrase-builder", + "import": phraseBuilder, + "slug": "phrase-builder" }, { - heading: "Equatives", - subdirectory: "equatives", - chapters: [ + "heading": "Equatives", + "subdirectory": "equatives", + "chapters": [ { - import: presentEquative, - slug: "present-equative", + "import": presentEquative, + "slug": "present-equative" }, { - import: habitualEquative, - slug: "habitual-equative", + "import": habitualEquative, + "slug": "habitual-equative" }, { - import: otherEquatives, - slug: "other-equatives", - }, - ], + "import": otherEquatives, + "slug": "other-equatives" + } + ] }, { - heading: "Nouns", - subdirectory: "nouns", - chapters: [ + "heading": "Nouns", + "subdirectory": "nouns", + "chapters": [ { - import: nounsGender, - slug: "nouns-gender", + "import": nounsGender, + "slug": "nouns-gender" }, { - import: nounsUnisex, - slug: "nouns-unisex", + "import": nounsUnisex, + "slug": "nouns-unisex" }, { - import: nounsPlural, - slug: "nouns-plural", + "import": nounsPlural, + "slug": "nouns-plural" }, { - import: specialPlurals, - slug: "special-plurals", + "import": specialPlurals, + "slug": "special-plurals" }, { - import: bundledPlurals, - slug: "bundled-plurals", - }, - ], + "import": bundledPlurals, + "slug": "bundled-plurals" + } + ] }, { - heading: "Phrase Structure 🧱", - subdirectory: "phrase-structure", - chapters: [ + "heading": "Phrase Structure 🧱", + "subdirectory": "phrase-structure", + "chapters": [ { - import: BlocksAndKids, - slug: "blocks-and-kids", + "import": BlocksAndKids, + "slug": "blocks-and-kids" }, { - import: NPIntro, - slug: "np", + "import": NPIntro, + "slug": "np" }, { - import: APIntro, - slug: "ap", + "import": APIntro, + "slug": "ap" }, { - import: EPIntro, - slug: "ep", + "import": EPIntro, + "slug": "ep" }, { - import: VPIntro, - slug: "vp", + "import": VPIntro, + "slug": "vp" }, { - import: Complement, - slug: "complement", + "import": Complement, + "slug": "complement" }, { - import: ShorteningVPs, - slug: "shortening-vps", - }, - ], + "import": ShorteningVPs, + "slug": "shortening-vps" + } + ] }, { - heading: "Verbs", - subdirectory: "verbs", - chapters: [ + "heading": "Verbs", + "subdirectory": "verbs", + "chapters": [ { - import: verbsIntro, - slug: "verbs-intro", + "import": verbsIntro, + "slug": "verbs-intro" }, { - import: verbAspect, - slug: "verb-aspect", + "import": verbAspect, + "slug": "verb-aspect" }, { - import: rootsAndStems, - slug: "roots-and-stems", + "import": rootsAndStems, + "slug": "roots-and-stems" }, { - import: presentVerbs, - slug: "present-verbs", + "import": presentVerbs, + "slug": "present-verbs" }, { - import: subjunctiveVerbs, - slug: "subjunctive-verbs", + "import": subjunctiveVerbs, + "slug": "subjunctive-verbs" }, { - import: futureVerbs, - slug: "future-verbs", + "import": futureVerbs, + "slug": "future-verbs" }, { - import: imperativeVerbs, - slug: "imperative-verbs", + "import": imperativeVerbs, + "slug": "imperative-verbs" }, { - import: pastVerbs, - slug: "past-verbs", + "import": pastVerbs, + "slug": "past-verbs" }, { - import: perfectVerbsIntro, - slug: "perfect-verbs-intro", + "import": perfectVerbsIntro, + "slug": "perfect-verbs-intro" }, { - import: allPerfectVerbs, - slug: "all-perfect-verbs", + "import": allPerfectVerbs, + "slug": "all-perfect-verbs" }, { - import: negativeVerbs, - slug: "negative-verbs", + "import": negativeVerbs, + "slug": "negative-verbs" }, { - import: ability, - slug: "ability", + "import": ability, + "slug": "ability" }, { - import: jussive, - slug: "jussive", + "import": jussive, + "slug": "jussive" }, { - import: passiveVoice, - slug: "passive-voice", + "import": passiveVoice, + "slug": "passive-voice" }, { - import: verbEndings, - slug: "verb-endings", + "import": verbEndings, + "slug": "verb-endings" }, { - import: masterChart, - slug: "master-chart", - }, - ], + "import": masterChart, + "slug": "master-chart" + } + ] }, { - heading: "Compound Verbs", - subdirectory: "compound-verbs", - chapters: [ + "heading": "Compound Verbs", + "subdirectory": "compound-verbs", + "chapters": [ { - import: compoundVerbsIntro, - slug: "intro", + "import": compoundVerbsIntro, + "slug": "intro" }, { - import: helperVerbs, - slug: "helper-verbs", + "import": helperVerbs, + "slug": "helper-verbs" }, { - import: stativeCompounds, - slug: "stative-compounds", + "import": stativeCompounds, + "slug": "stative-compounds" }, { - import: dynamicCompounds, - slug: "dynamic-compounds", + "import": dynamicCompounds, + "slug": "dynamic-compounds" }, { - import: moreOnCompounds, - slug: "more-on-compounds", - }, - ], + "import": moreOnCompounds, + "slug": "more-on-compounds" + } + ] }, { - heading: "Participles", - subdirectory: "participles", - chapters: [ + "heading": "Participles", + "subdirectory": "participles", + "chapters": [ { - import: introToParticiples, - slug: "intro", - }, - ], + "import": introToParticiples, + "slug": "intro" + } + ] }, { - heading: "Pronouns", - subdirectory: "pronouns", - chapters: [ + "heading": "Pronouns", + "subdirectory": "pronouns", + "chapters": [ { - import: pronounsBasic, - slug: "pronouns-basic", + "import": pronounsBasic, + "slug": "pronouns-basic" }, { - import: pronounsMini, - slug: "pronouns-mini", + "import": pronounsMini, + "slug": "pronouns-mini" }, { - import: directionalPronouns, - slug: "pronouns-directional", - }, - ], + "import": directionalPronouns, + "slug": "pronouns-directional" + } + ] }, { - heading: "Inflection 🔘", - subdirectory: "inflection", - chapters: [ + "heading": "Inflection 🔘", + "subdirectory": "inflection", + "chapters": [ { - import: inflectionIntro, - slug: "inflection-intro", + "import": inflectionIntro, + "slug": "inflection-intro" }, { - import: inflectionPatterns, - slug: "inflection-patterns", - }, - ], + "import": inflectionPatterns, + "slug": "inflection-patterns" + } + ] }, { - heading: "Sandwiches 🥪", - subdirectory: "sandwiches", - chapters: [ + "heading": "Sandwiches 🥪", + "subdirectory": "sandwiches", + "chapters": [ { - import: sandwiches, - slug: "sandwiches", - }, - ], + "import": sandwiches, + "slug": "sandwiches" + } + ] }, { - heading: "Writing 🖊", - subdirectory: "writing", - chapters: [ + "heading": "Writing 🖊", + "subdirectory": "writing", + "chapters": [ { - import: phonetics, - slug: "phonetics", + "import": phonetics, + "slug": "phonetics" }, { - import: diacritics, - slug: "diacritics", + "import": diacritics, + "slug": "diacritics" }, { - import: theFiveYeys, - slug: "the-five-yeys", + "import": theFiveYeys, + "slug": "the-five-yeys" }, { - import: typingIssues, - slug: "typing-issues", - }, - ], + "import": typingIssues, + "slug": "typing-issues" + } + ] }, { - heading: "Recipes 👩‍🍳", - subdirectory: "recipes", - chapters: [ + "heading": "Recipes 👩‍🍳", + "subdirectory": "recipes", + "chapters": [ { - import: unrealConditionals, - slug: "unreal-conditionals", - }, - ], + "import": unrealConditionals, + "slug": "unreal-conditionals" + } + ] }, { - heading: "Practice Tools 🔧", - subdirectory: "practice-tools", - chapters: [ + "heading": "Practice Tools 🔧", + "subdirectory": "practice-tools", + "chapters": [ { - import: pronounPicker, - slug: "pronoun-picker", - }, - ], + "import": pronounPicker, + "slug": "pronoun-picker" + } + ] }, { - import: dictionary, - slug: "dictionary", - }, - ]; /* content-tree */ + "import": dictionary, + "slug": "dictionary" + } + ] /* content-tree */ export const content = contentTree .map((item) => { function prepareChapter(chp: any, subdir?: any) { return { path: subdir ? `/${subdir}/${chp.slug}/` : `/${chp.slug}/`, - slug: chp.slug, + "slug": chp.slug, content: chp.import.default, frontMatter: chp.import.frontMatter, tableOfContents: chp.import.tableOfContents, @@ -445,7 +445,7 @@ export const content = contentTree ? prepareChapter(item) : { ...item, - chapters: item.chapters?.map((c) => { + "chapters": item.chapters?.map((c) => { return prepareChapter(c, item.subdirectory); }), }; @@ -516,7 +516,7 @@ export const content = contentTree return { ...item, // @ts-ignore - chapters: item.chapters.map((chapter, j, chapters) => + "chapters": item.chapters.map((chapter, j, chapters) => withNextPrev(chapter, j, chapters) ), }; diff --git a/src/content/nouns/PluralTable.tsx b/src/content/nouns/PluralTable.tsx index e75c30b..2485b0d 100644 --- a/src/content/nouns/PluralTable.tsx +++ b/src/content/nouns/PluralTable.tsx @@ -1,7 +1,13 @@ import Table from "../../components/Table"; import { defaultTextOptions as opts } from "@lingdocs/ps-react"; -function PluralTable({ children, inflection }) { +function PluralTable({ + children, + inflection, +}: { + children: any; + inflection: boolean; +}) { return (