pypi/inspector

feature: try to detect language from filename for syntax highlighting

miketheman opened this issue · 5 comments

Source:

<pre id="line" class="line-numbers linkable-line-numbers language-python">
<code class="language-python">{{- code }}</code>

When viewing a non-python file via Inspector, like a README.md, the browser highlights the contents incorrectly.

Prism supports a lot of languages and advises on using their autoloader for languages.

hi @di, Can I work on the issue?
I have tested the changes locally, Should I need to add all languages or only a few

di commented

Sure! Seems like we should support all languages that Prism supports, via the autoloader.

Should I use the CDNs provided from PrismJS

di commented

I don't think so, we should include it here as a static file similar to: https://github.com/pypi/inspector/tree/main/inspector/static

Okay