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

feat: Add latex rendering #315

Open
brenapp opened this issue Apr 10, 2021 · 6 comments
Open

feat: Add latex rendering #315

brenapp opened this issue Apr 10, 2021 · 6 comments
Labels
Discussion A thread to hold active discussion about the future of the bot or a feature enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@brenapp
Copy link
Contributor

brenapp commented Apr 10, 2021

Is your feature request related to a problem? Please describe.
Having the ability to succinctly add equations can be incredibly useful for discussions, especially for more math-intensive courses.

Describe the solution you'd like
Add a command to display tex equations.

Reference Implementation
The simplest way to do this would be to rely on an online service like codecogs. I did this in my bot. The slightly better/more fancy version of this image would be to download the generated image, and then upload it so the URL doesn't display.
https://github.com/MayorMonty/vexbot/blob/master/src/commands/latex.ts

Example invocation

image

@Jay-Madden
Copy link
Member

This is an amazing idea, what are the rate limits like for that site?

@Jay-Madden Jay-Madden added Discussion A thread to hold active discussion about the future of the bot or a feature enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 10, 2021
@brenapp
Copy link
Contributor Author

brenapp commented Apr 10, 2021

I have not encountered any for mine, so as long as we are responsible, and enforce reasonable rate limits on our end, it isn't an issue.

@Jay-Madden
Copy link
Member

gotcha, ya seems to be relatively simple. Is this something you would like to add or are you just leaving the suggestion?

@zepthro
Copy link
Contributor

zepthro commented Apr 11, 2021

If there is an api, it seems simple enough. Have you researched the subject? @MayorMonty

For @Jay-Madden's rate limit problem, we could add a call back function? That way the bot doesn't get stuck on one person's code.

@Jay-Madden
Copy link
Member

Rate limits won't hang the bot, it'll just be a different response. Due to how async works every command is a seperate thing so one call hanging or being rate limited wont effect the bot itself

@brenapp
Copy link
Contributor Author

brenapp commented Apr 11, 2021

The service does not enforce rate limits, as far as I can tell. We should be respectful of it, and only allow the command to execute every few seconds (5 is probably more than reasonable), and we should be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion A thread to hold active discussion about the future of the bot or a feature enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants