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

List of language types #178

Closed
brendanfalkowski opened this issue Nov 1, 2013 · 12 comments
Closed

List of language types #178

brendanfalkowski opened this issue Nov 1, 2013 · 12 comments

Comments

@brendanfalkowski
Copy link

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.

@milesj
Copy link
Contributor

milesj commented Nov 1, 2013

It's the name of these files: https://github.com/LeaVerou/prism/tree/gh-pages/components

Should probably add a definite list somewhere though.

@LeaVerou
Copy link
Member

LeaVerou commented Nov 3, 2013

Yes, good call! There needs to be a list somewhere, or at least mention the IDs in the download page...

@brendanfalkowski
Copy link
Author

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.

@panique
Copy link

panique commented Jan 24, 2014

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.

@loganfranken
Copy link
Contributor

This is done here:
http://prismjs.com/#languages-list

So I think this can be closed?

@Golmote Golmote closed this as completed Jun 20, 2015
@brendanfalkowski
Copy link
Author

Yep, that works. Thanks!

@imabot2
Copy link

imabot2 commented Nov 13, 2018

For those who are looking for a drop-down (<select><option>) list of supported languages, it can be found here : https://ans.wiki/q/ou-trouver-une-liste-deroulante-des-languages-supportes-par-prism/

@loopmode
Copy link

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 export const supportedLanguages = [...theLanguages] as const; it's very useful to have such list explicitly. Too bad there is none "at the core".

@loopmode
Copy link

..created a module for that.. https://www.npmjs.com/package/create-prism-list

@suin
Copy link

suin commented May 12, 2020

I created the viewer of the list of supported languages.

I hope this helps developers who are looking up it.

List_of_supported_languages_by_Prism

List of supported languages by Prism

@clementohNZ
Copy link

clementohNZ commented Feb 3, 2024

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 tab

Screenshot 2024-02-04 at 07 15 51

Inside Editor

Screenshot 2024-02-04 at 07 15 26

@webcog-pk
Copy link

webcog-pk commented Dec 26, 2024

http://prismjs.com/#languages-list

List of all Supported Languages by Prism.

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