mirror of
https://github.com/HananoshikaYomaru/openfreebooks.git
synced 2026-11-13 13:05:51 +00:00
Refactor question bank feature in spec, update math curriculum status to live, enhance math rendering in frontend, and add new styles for question presentation in SASS. Improve catalog styles for planned chapters and enhance visual elements for better user experience.
This commit is contained in:
parent
2ac34d52fc
commit
be5b3dba75
11 changed files with 1096 additions and 18 deletions
|
|
@ -7,12 +7,18 @@ const DELIMITERS = [
|
|||
{ left: "\\[", right: "\\]", display: true },
|
||||
];
|
||||
|
||||
export function renderBookMath() {
|
||||
document.querySelectorAll<HTMLElement>(".book-prose, .book-callout").forEach((el) => {
|
||||
renderMathInElement(el, {
|
||||
delimiters: DELIMITERS,
|
||||
throwOnError: false,
|
||||
strict: "ignore",
|
||||
});
|
||||
});
|
||||
const RENDER_OPTIONS = {
|
||||
delimiters: DELIMITERS,
|
||||
throwOnError: false,
|
||||
strict: "ignore" as const,
|
||||
};
|
||||
|
||||
export function renderMathInContainer(el: HTMLElement) {
|
||||
renderMathInElement(el, RENDER_OPTIONS);
|
||||
}
|
||||
|
||||
export function renderBookMath() {
|
||||
document
|
||||
.querySelectorAll<HTMLElement>(".book-prose, .book-callout, .math-widget__caption")
|
||||
.forEach(renderMathInContainer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue