POC for showPointLabels with TeX#3768
Conversation
|
Size Change: +425 B (+0.08%) Total Size: 510 kB 📦 View Changed
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (ae6345c) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3768If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3768If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3768 |
benchristel
left a comment
There was a problem hiding this comment.
There are a couple problems with calling the SpeechRuleEngine on the learner's device, which I've described inline.
We might have to cut scope and not support visible labels with TeX for this first pass.
| export async function generateSpokenMathDetails( | ||
| mathString: string, | ||
| ): Promise<string> { | ||
| const engine = await SpeechRuleEngine.setup("en"); |
There was a problem hiding this comment.
We are hardcoding the "en" locale here, which is not right. It was okay to hardcode "en" when this function was only used in the editor, because the generated labels would be saved in the content and go through the normal translation process. However, if we are generating math labels dynamically on the learner's computer, we need to use the appropriate locale.
This is also going to make a web request for a JSON file that defines the spoken English for various math symbols. We have an architectural rule in Perseus that Perseus doesn't make web requests.
I think what what we need to do is generate spoken labels in the editor like we did for locked labels. We'll need to save the spoken labels and visible labels (which may include TeX) separately in the content JSON.
Alternatively, we could decide that we won't support visible labels with TeX for this first pass.
Summary:
[showlabels/02-renderer-and-flag-poc-for-tex] docs(changeset):
Issue: LEMS-XXXX
Test plan: