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

API for supported languages/plugins/etc. #2146

Open
RunDevelopment opened this issue Dec 25, 2019 · 0 comments
Open

API for supported languages/plugins/etc. #2146

RunDevelopment opened this issue Dec 25, 2019 · 0 comments

Comments

@RunDevelopment
Copy link
Member

Motivation
Libraries sometimes need to know all languages/plugins/etc. Prism supports.

Description
A simple API to:

  1. Check whether a given language/plugin/etc is supported.
  2. Query all languages/plugins/etc.

My suggestion is to make this a part of components.js. Something like:

components.supported(lang: string | string[]): boolean;
components.supported.languages: string[];
components.supported.plugins: string[];

The other properties of the components object are still private to Prism. By implementing the API in components.js, both browser and NodeJS devs have easy access to it.

Alternatives
Document components.json and declare it to be a part of Prism's public API. Right now, it's considered a private part of Prism, so we could make it public.
This has the obvious downside that changes to components.json might be breaking and it takes a lot of freedom from Prism's core development team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant