mirror of
https://github.com/HananoshikaYomaru/openfreebooks.git
synced 2026-11-13 13:05:51 +00:00
Refactor math chapter structure and styling: Update .gitignore to exclude specific CSS directories, enhance CONTRIBUTING.md with new guidelines for subject-specific assets, and streamline chapter content organization. Modify curriculum data to include new chapter dependencies and improve frontend logic for loading shared styles and scripts. Adjust styles for better visual consistency across math chapters.
This commit is contained in:
parent
5175811579
commit
a2679aa4de
24 changed files with 2104 additions and 530 deletions
|
|
@ -134,7 +134,21 @@ if (chapterNavRoot) {
|
|||
});
|
||||
}
|
||||
|
||||
function mountSubjectInit() {
|
||||
const article = document.querySelector<HTMLElement>("[data-chapter]");
|
||||
const chapterKey = article?.dataset.chapter;
|
||||
if (!article || !chapterKey) return;
|
||||
|
||||
const subject = chapterKey.split("/")[0];
|
||||
void import("./generated/subject-modules").then(({ subjectInitLoaders }) => {
|
||||
const loader = subjectInitLoaders[subject];
|
||||
if (!loader) return;
|
||||
void loader().then((mod) => mod.initSubject(article));
|
||||
});
|
||||
}
|
||||
|
||||
initBookMath();
|
||||
mountSubjectInit();
|
||||
mountChapterWidgets();
|
||||
|
||||
const catalogRoot = document.getElementById("catalog-app");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue