From f28ad660dd4aa29b5c43bfbced87e74d5b0fa593 Mon Sep 17 00:00:00 2001 From: Hananoshika Yomaru Date: Thu, 21 May 2026 10:10:13 -0700 Subject: [PATCH] Remove English curriculum content and associated styles: Deleted the English curriculum files, including the main index, reading comprehension foundations, and related styles. Updated catalog JSON to remove references to English chapters and contributors, ensuring a clean slate for future curriculum updates. --- content/english/_index.md | 5 - .../_index.md | 60 ------ .../core.html | 49 ----- content/english/subject.scss | 10 - data/catalog.json | 33 ++- data/catalog.types.ts | 10 + data/english-curriculum.json | 39 ---- frontend/src/components/catalog-app.tsx | 192 ++++++++++++++++++ static/feed.xml | 164 +++++++-------- static/sitemap.xml | 40 ++-- themes/openfreebooks/sass/_catalog.scss | 124 +++++++++++ themes/openfreebooks/templates/base.html | 3 + themes/openfreebooks/templates/catalog.html | 3 +- 13 files changed, 452 insertions(+), 280 deletions(-) delete mode 100644 content/english/_index.md delete mode 100644 content/english/reading-comprehension-foundations/_index.md delete mode 100644 content/english/reading-comprehension-foundations/core.html delete mode 100644 content/english/subject.scss delete mode 100644 data/english-curriculum.json diff --git a/content/english/_index.md b/content/english/_index.md deleted file mode 100644 index 06a4475..0000000 --- a/content/english/_index.md +++ /dev/null @@ -1,5 +0,0 @@ -+++ -title = "English" -description = "Browse English chapters in the curriculum catalog." -sort_by = "weight" -+++ diff --git a/content/english/reading-comprehension-foundations/_index.md b/content/english/reading-comprehension-foundations/_index.md deleted file mode 100644 index 8c70a27..0000000 --- a/content/english/reading-comprehension-foundations/_index.md +++ /dev/null @@ -1,60 +0,0 @@ -+++ -title = "Reading comprehension foundations" -description = "Find the main idea, key details, and evidence in short texts." -template = "chapter.html" -weight = 1 -[extra] -subject = "english" -chapter_id = "reading-comprehension-foundations" -strand = "Reading & Writing Foundations" -+++ - -
-

- Reading comprehension means understanding what a text says directly and what it suggests - indirectly. In this chapter you will practice spotting the - main idea, finding - supporting details, and selecting - text evidence. -

- -

Main idea and key details

-

- The main idea is the most important message in a paragraph or passage. - Key details are specific facts or examples that support that message. -

- -
-

Quick strategy

-

- Ask: “If I had to summarize this paragraph in one sentence, what would I say?” Then check - which details in the text prove your sentence. -

-
- -

Use evidence, not guesses

-

- Good answers point to exact words or phrases in the passage. You can quote directly or - paraphrase, but your answer should always connect back to the text. -

- -
- Checkpoint: main idea -
-

- Read this sentence: “After weeks of practice, the choir finally sang in harmony during the - final rehearsal.” What is the main idea, and which words are the strongest evidence? -

-
-
- -
- Checkpoint: evidence -
-

- A student writes: “The character is brave.” Improve this answer by adding one short quote - from the text and explaining how that quote proves bravery. -

-
-
-
diff --git a/content/english/reading-comprehension-foundations/core.html b/content/english/reading-comprehension-foundations/core.html deleted file mode 100644 index 9f76039..0000000 --- a/content/english/reading-comprehension-foundations/core.html +++ /dev/null @@ -1,49 +0,0 @@ -
-

- Reading comprehension means understanding what a text says directly and what it suggests - indirectly. In this chapter you will practice spotting the - main idea, finding - supporting details, and selecting - text evidence. -

- -

Main idea and key details

-

- The main idea is the most important message in a paragraph or passage. - Key details are specific facts or examples that support that message. -

- -
-

Quick strategy

-

- Ask: “If I had to summarize this paragraph in one sentence, what would I say?” Then check - which details in the text prove your sentence. -

-
- -

Use evidence, not guesses

-

- Good answers point to exact words or phrases in the passage. You can quote directly or - paraphrase, but your answer should always connect back to the text. -

- -
- Checkpoint: main idea -
-

- Read this sentence: “After weeks of practice, the choir finally sang in harmony during the - final rehearsal.” What is the main idea, and which words are the strongest evidence? -

-
-
- -
- Checkpoint: evidence -
-

- A student writes: “The character is brave.” Improve this answer by adding one short quote - from the text and explaining how that quote proves bravery. -

-
-
-
diff --git a/content/english/subject.scss b/content/english/subject.scss deleted file mode 100644 index a9b8239..0000000 --- a/content/english/subject.scss +++ /dev/null @@ -1,10 +0,0 @@ -// Shared styles for English chapters. -// Keep chapter-specific rules in each chapter folder's chapter.scss. - -.english-key-term { - padding: 0.05rem 0.32rem; - border-radius: 4px; - background: color-mix(in srgb, var(--accent) 12%, transparent); - font-family: var(--mono); - font-size: 0.85em; -} diff --git a/data/catalog.json b/data/catalog.json index e27515d..5de126b 100644 --- a/data/catalog.json +++ b/data/catalog.json @@ -3,9 +3,36 @@ "subtitle": "Browse chapters by subject and curriculum", "curriculums": ["Foundation", "DSE", "IB", "A-Level", "AP", "IGCSE", "Common Core"], "subjects": [ - { "id": "math", "name": "Mathematics", "banner": "/catalog/banners/math.webp" }, - { "id": "english", "name": "English" }, - { "id": "physics", "name": "Physics", "banner": "/catalog/banners/physics.jpg" }, + { + "id": "math", + "name": "Mathematics", + "banner": "/catalog/banners/math.webp", + "contributors": [ + { + "id": "man-lung-yeung", + "name": "Man Lung Yeung", + "avatar": "/contributors/manlung.png", + "job_title": "EdTech specialist / software engineer", + "education": "BEng in Computer Science (HKUST) + BBA (HKUST)", + "contributions": ["Project Creator", "Math textbook", "Physics textbook"] + } + ] + }, + { + "id": "physics", + "name": "Physics", + "banner": "/catalog/banners/physics.jpg", + "contributors": [ + { + "id": "man-lung-yeung", + "name": "Man Lung Yeung", + "avatar": "/contributors/manlung.png", + "job_title": "EdTech specialist / software engineer", + "education": "BEng in Computer Science (HKUST) + BBA (HKUST)", + "contributions": ["Project Creator", "Math textbook", "Physics textbook"] + } + ] + }, { "id": "science", "name": "Science" }, { "id": "humanities", "name": "Humanities" }, { "id": "computing", "name": "Computing" } diff --git a/data/catalog.types.ts b/data/catalog.types.ts index 9bdd38f..5ac227d 100644 --- a/data/catalog.types.ts +++ b/data/catalog.types.ts @@ -34,11 +34,21 @@ export type CatalogGraph = { edges: CatalogGraphEdge[]; }; +export type CatalogSubjectContributor = { + id: string; + name: string; + avatar: string; + job_title?: string; + education?: string; + contributions?: string[]; +}; + export type CatalogSubject = { id: string; name: string; /** Root-relative URL, e.g. /catalog/banners/math.webp */ banner?: string; + contributors?: CatalogSubjectContributor[]; strands: CatalogStrand[]; graph?: CatalogGraph; }; diff --git a/data/english-curriculum.json b/data/english-curriculum.json deleted file mode 100644 index 32c50b9..0000000 --- a/data/english-curriculum.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "title": "English", - "intro": "Build reading, writing, speaking, and analysis skills through progressive chapter pathways.", - "graph": { - "edges": [] - }, - "strands": [ - { - "id": "reading-writing-foundations", - "title": "Reading & Writing Foundations", - "chapters": [ - { - "slug": "reading-comprehension-foundations", - "title": "Reading comprehension foundations", - "description": "Find main ideas, supporting details, and text evidence in short passages.", - "status": "live", - "curriculumCoverage": { - "Foundation": "core", - "IGCSE": "core", - "Common Core": "core", - "IB": "related" - } - }, - { - "slug": "paragraph-writing-basics", - "title": "Paragraph writing basics", - "description": "Write focused paragraphs with a clear topic sentence, evidence, and explanation.", - "status": "planned", - "curriculumCoverage": { - "Foundation": "core", - "IGCSE": "core", - "Common Core": "core", - "IB": "related" - } - } - ] - } - ] -} diff --git a/frontend/src/components/catalog-app.tsx b/frontend/src/components/catalog-app.tsx index c43ee80..e285cf5 100644 --- a/frontend/src/components/catalog-app.tsx +++ b/frontend/src/components/catalog-app.tsx @@ -8,6 +8,7 @@ import type { CatalogChapter, CatalogData, CatalogStrand, + CatalogSubjectContributor, CatalogSubject, CatalogViewMode, } from "../../../data/catalog.types"; @@ -33,6 +34,7 @@ function normalizeChapter(chapter: CatalogChapter): CatalogChapter { function normalizeSubject(subject: CatalogSubject): CatalogSubject { return { ...subject, + contributors: subject.contributors ?? [], strands: (subject.strands ?? []).map((strand) => ({ ...strand, chapters: (strand.chapters ?? []).map(normalizeChapter), @@ -94,6 +96,20 @@ function syncUrl(subjectId: string, viewMode: CatalogViewMode) { window.history.replaceState(null, "", url); } +function openDialogById(id: string) { + const dialog = document.getElementById(id); + if (dialog instanceof HTMLDialogElement) { + dialog.showModal(); + } +} + +function closeDialogById(id: string) { + const dialog = document.getElementById(id); + if (dialog instanceof HTMLDialogElement) { + dialog.close(); + } +} + export function CatalogApp() { const data = readCatalogData(); if (!data) { @@ -141,6 +157,37 @@ export function CatalogApp() { return `Showing ${count} ${filterText} chapter${count === 1 ? "" : "s"}`; }); + const subjectContributors = createMemo( + () => currentSubject()?.contributors ?? [] + ); + + const contributorsPickerDialogId = createMemo( + () => `catalog-contributors-picker-dialog-${currentSubjectId()}` + ); + + const contributorDialogId = (contributorId: string) => + `catalog-contributor-dialog-${currentSubjectId()}-${contributorId}`; + + const openContributorsPickerDialog = () => { + openDialogById(contributorsPickerDialogId()); + }; + + const openContributorDialog = (contributorId: string) => { + openDialogById(contributorDialogId(contributorId)); + }; + + const openContributorFromPicker = (contributorId: string) => { + closeDialogById(contributorsPickerDialogId()); + openDialogById(contributorDialogId(contributorId)); + }; + + const closeContributorsDialogOnBackdrop = (event: MouseEvent) => { + if (!(event.currentTarget instanceof HTMLDialogElement)) return; + if (event.target === event.currentTarget) { + event.currentTarget.close(); + } + }; + const selectSubject = (subjectId: string) => { if (subjectId !== "math" && viewMode() === "compare") { setViewMode("linear"); @@ -244,6 +291,151 @@ export function CatalogApp() {

{currentSubject()?.name ?? "Catalog"}

{statsLabel()}

+ 0}> +
+
    + + {(person) => ( +
  • + +
  • + )} +
    +
+ + +
+ +
+

+ {currentSubject()?.name} contributors +

+
+
+ Contributors +
    + + {(person) => ( +
  • + +
  • + )} +
    +
+
+
+ +
+ + {(person) => ( + +
+ +
+ +
+

{person.name}

+ +

{person.job_title}

+
+
+
+ +

+ Education + {person.education} +

+
+ 0}> +
+ Contributes +
    + + {(item) =>
  • {item}
  • } +
    +
+
+
+
+
+ )} +
+
+
+ diff --git a/themes/openfreebooks/templates/catalog.html b/themes/openfreebooks/templates/catalog.html index 5885d75..0d4fafb 100644 --- a/themes/openfreebooks/templates/catalog.html +++ b/themes/openfreebooks/templates/catalog.html @@ -19,7 +19,8 @@ { "id": {{ subject.id | json_encode() | safe }}, "name": {{ subject.name | json_encode() | safe }}{% if subject.banner %}, - "banner": {{ subject.banner | json_encode() | safe }}{% endif %}, + "banner": {{ subject.banner | json_encode() | safe }}{% endif %}{% if subject.contributors %}, + "contributors": {{ subject.contributors | json_encode() | safe }}{% endif %}, "strands": {{ subject_curriculum.strands | default(value=[]) | json_encode() | safe }}{% if subject_curriculum.graph %}, "graph": {{ subject_curriculum.graph | json_encode() | safe }}{% endif %} }{% if not loop.last %},{% endif %}