如何在我的 gitHub 页面上 "use Linguist to perform language detection"?

How do I "use Linguist to perform language detection" on my gitHub page?

我正在使用 GitHub 个页面来制作我的网站。

我正在使用 Atom 来编辑 markdown,并使用 markdown-preview-enhaced 包来预览结果。

所以当我写这样的代码时

```Java
class Teste{
  public static void main(String[] args) {
        System.out.println("Hello Hivemind");
    }
}
```

它在我的预览中保持完美着色,但是当我将页面推送到 github 时,代码块没有着色。

我搜索了一个解决方案,发现 guide

显然我必须“使用 Linguist 执行语言检测”

We use Linguist to perform language detection and to select third-party grammars for syntax highlighting. You can find out which keywords are valid in the languages YAML file.

但我不明白那是什么意思,也做不到。

这取决于用于在 GitHub 页面上呈现静态站点的工具。

你是using Jekyll, then since 2016, syntax highlighting for fenced code would be assured by rouge since 2016.

this issue

I was having the problem where Rogue didn't seem to do anything at all (not wrapping code keywords in <span> elements, so there would be nothing to style for the Pygments stylesheet).

Then I discovered jekyll/jekyll#3641 (comment), removed highlight: rouge from the root of _config.yml and add syntax_highlighter: rouge underneath the kramdown node instead:

kramdown:
  syntax_highlighter: rouge

然后您将使用 java,而不是 Java
语言学家是 .