Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose modifier repositories #10

Open
ysulyma opened this issue Mar 9, 2022 · 0 comments
Open

Expose modifier repositories #10

ysulyma opened this issue Mar 9, 2022 · 0 comments

Comments

@ysulyma
Copy link

ysulyma commented Mar 9, 2022

First: amazing project, very excited to see it ported to MathJax 3!

I have an extension for XyJax that adds

  • the ability to apply arbitrary colors to arrows
  • the ability to add data-* attributes on arrows

In XyJax 2, I did this by adding to xypic.repositories.modifierRepository. This doesn't seem to be exposed in XyJax 3. Please give a way to access the modifierRepository so I can port my extension.

The source code for my extension is https://github.com/ysulyma/rp-xyjax/blob/main/src/index.ts#L222, so you can see what I'm doing. A live example of these extensions is at https://liqvidjs.org/math/?t=3:00.

Additionally, it would be very helpful to be able to use characters other than [A-Za-z] in arrow modifiers. Currently, I have to do a convoluted base52 encoding/decoding in order to include colors or data.

import {tob52, xyEncodeColor} from "rp-xyjax";

String.raw`
\ar@[data${tob52(json)}]
\ar@[color${xyEncodeColor("AF1866")}]
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant