GitHub 使用什么 JavaScript 语法荧光笔?

发布于 2024-12-27 11:03:32 字数 43 浏览 2 评论 0原文

当您单击文件名时,GitHub 在其网站上使用什么语法荧光笔来显示代码?

What syntax highlighter is GitHub using on their site to display the code when you click on the file names?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乞讨 2025-01-03 11:03:32

作为此帮助页面 GitHub.com 表示,他们正在使用 Linguist 库,它是用 Ruby 编写的。

Linguist 每种语言的荧光笔位于 vendor/grammars< /a>.可以找到支持的语言列表 此处此处此处

As this help page of GitHub.com says, they’re using the Linguist library, which is written in Ruby.

Linguist’s highlighters for each language are within vendor/grammars. And a list of supported languages can be found here, here, and here.

撩动你心 2025-01-03 11:03:32

GitHub 使用 tree-sitter 语法来突出显示以下语言的语法:CSS、Go、 JavaScript、EJS、ERB、HTML、Python、Ruby、TypeScript 和 CodeQL。 JavaScript tree-sitter 语法在这里: https://github.com/tree-sitter /tree-sitter-javascript (语法.jssrc/scanner.c 是重要文件)

来源:https://github.com/github/linguist/discussions/5572#discussioncomment-1355712

GitHub uses tree-sitter grammars for syntax highlighting the following languages: CSS, Go, JavaScript, EJS, ERB, HTML, Python, Ruby, TypeScript and CodeQL. The JavaScript tree-sitter grammar is here: https://github.com/tree-sitter/tree-sitter-javascript (grammar.js and src/scanner.c are the important files)

Source: https://github.com/github/linguist/discussions/5572#discussioncomment-1355712

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文