首页 > 解决方案 > 为什么不是所有语言都出现在 Github Repo 中?

问题描述

我即将提交这个项目,但我想在提交之前确保 Github 页面看起来不错。出于某种原因,并非所有语言都出现了,我不知道为什么。我试图找到在设置下编辑它的方法,但我还没有找到任何东西。

正如你在下面的图片中看到的,在主页上它说 Repo 是 100% Jupyter notebooks,但如果你点击“语言”,你会看到还有似乎下落不明的 python 和 csv 文件。

在此处输入图像描述

在此处输入图像描述

如果有人知道我可以如何改变这一点,请告诉我。这不是很重要,但我认为如果语言的细分更准确,它看起来会更好。谢谢!

标签: github

解决方案


GitHub uses Linguist to figure out which languages are part of your project. It has a languages.yml file to defined the multitude of languages to look for. Some are markup languages (like jupyter notebook), some programming languages, etc.

That percentage you see is calculated based on the bytes of code for each language. The more you have of one type, the higher the percentage.

Note, however, that this library excludes all files that it determines to be binary data, vendor code, generated code, documentation, or defined as data (in your case csv) or prose (think markdown), whilst taking into account any overrides.

IF your python code is small enough, even in 2 files, it won't get show up. Just write more python if you want it to show up.


The second screenshot provided is when you click on the languages and it's purpose is exactly what you are looking for - to give better details on the current project and what it comprises of in detail. This language bar is just an overview. It need not be 100% accurate.

FIY - It also matters which is your main branch, since it takes that into account.


Conclusion - don't worry about it. Whoever needs to see it, will see what your project has in terms of contents.


推荐阅读