Support for retrieving the list of supported functions and symbols
- Dominant language
- TypeScript
- Stars
- 20.4k
- Forks
- 1.3k
- Avg merge
- 14h 37m
- Merged PRs (30d)
- 7
Description
**Is your feature request related to a problem? Please describe.**
I'm currently implementing some basic autocomplete for KaTeX in an app of mine, by basically scraping the [support table](https://katex.org/docs/support_table.html) for supported `\.*` names and autocompleting those within the app.
The "problem" is that I seem to be using 33 dependencies (just [`cheerio`](https://github.com/cheeriojs/cheerio) and its dependencies) just for scraping that page, and I'd like to find a cleaner/simpler solution.
Is there some nicer way of getting that list of functions and symbols?
**Describe the solution you'd like:**
I'm thinking potentially some APIs could be added for this, but they would feel a bit out of place, KaTeX's API seems pretty minimal.
Maybe there's already some way to retrieve the internal list from KaTeX itself without requiring additional APIs? That would be ideal because it would also spare me the ~10kb needed to list all those functions and symbols somewhere.
Maybe there's some other file in this repo that lists them all that's easier to scrape? [`mapping.pl`](https://github.com/KaTeX/KaTeX/blob/01488c6d3cb024f49fdb51691f2162d3db849abe/src/metrics/mapping.pl) seems the closest that I can see, but I'm not sure if it lists all of them.
**Link to or name of a (La)TeX package that provides the same feature:**
N/A
**Describe alternatives you've considered:**
Keep scraping the support table.
**Additional context:**
N/A
Contributor guide
Research direction
Start by comparing the support table with the repository's src/metrics/mapping.pl and reviewing the existing KaTeX API surface. Determine where the complete function and symbol list currently comes from and define an approach that avoids scraping and unnecessary dependencies. Done means the supported names can be retrieved through a documented, maintainable mechanism.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100