-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
List of language types #178
Comments
It's the name of these files: https://github.com/LeaVerou/prism/tree/gh-pages/components Should probably add a definite list somewhere though. |
Yes, good call! There needs to be a list somewhere, or at least mention the IDs in the download page... |
I think the class list should be in the "Basic Usage" section because it mentions the "language-xxxx" syntax, but to do anything you need to know the language abbreviations available. It shouldn't require starting to assemble a kit to see which languages are available or how to configure them. |
It's totally weird that this plugin has absolutly no list of supported languages and how to use them! This is #1 prio, lots of people will reject this plugin otherwise. |
This is done here: So I think this can be closed? |
Yep, that works. Thanks! |
For those who are looking for a drop-down ( |
I think I will have a prebuild script in my project, read node_modules/prismjs/components and writes it to a file module. Especially with typescript and |
..created a module for that.. https://www.npmjs.com/package/create-prism-list |
I created the viewer of the list of supported languages. I hope this helps developers who are looking up it. |
I have written a small script that you can paste directly into your browser's at Prism's homepage console whenever to get a full list of the most up to date languages. No need to fiddle with manual entries and parsing sheets. It will output all the data as a JSON stringified array in a new tab, which you can copy and paste directly into your own files. Hope it helps 😊 const languageBlocks = document.querySelectorAll(`li[data-id]`)
const languages = []
languageBlocks.forEach((languageBlock) => {
const title = languageBlock.innerText.split(` - `)[0]
const langValue = languageBlock.querySelector(`code`).innerText
languages.push({ title, code: langValue })
})
console.log(languages)
const tab = window.open(`about:blank`, `_blank`)
tab.document.write(JSON.stringify(languages))
tab.document.close() Output from console in new tabInside Editor |
http://prismjs.com/#languages-list List of all Supported Languages by Prism. |
Is there a list of supported class="language-xxx" values?
I spent about 15 minutes looking through the site and GitHub issues, but couldn't find this anywhere.
Namely, ran into this issue trying to use "language-html" which is actually "language-markup". Seems like an odd choice given that every other language uses its abbreviation.
The text was updated successfully, but these errors were encountered: