Why is Github using different syntax highlighting for same file type? - github

I have two assembly files on github that should have the same syntax highlighting, but they do not as shown in the images below. The first image is wrong, comments are not grayed out, and the second image is right. Any ideas how to fix the first image?

They are probably being detected as different types of files. GitHub uses the Linguist library for this, but it's not perfect. In addition, assembly files are specifically very hard to detect because different assemblers have different register names, syntaxes, and comment forms.
You can specify an override in your .gitattributes file as specified in the Linguist documentation to force your file to be detected properly.

Related

Use doxygen to ^create^ README.md?

Many people document applications in the source files themselves, e.g. https://github.com/docopt/docopt.cpp . In the spirit of DRY (don't repeat yourself), I would like source documentation to appear in my README.md on GitHub (auto-generated from the source.) I see many user-community questions about including README.md in output documentation, but nothing about going the other way, src documentation -> README.md. doxygen seems like the tool that should own this space, but has no output formatters for markdown files.
Does it make sense to anybody else to create an output formatter for markdown?
Apparently it does make sense, and has been proposed before, as well as some bolt-on solutions developed: https://github.com/doxygen/doxygen/issues/6760

Why aren't all languages showing up in Github Repo?

I'm about to submit this project but I want to make sure the Github page looks good before I do. For some reason, not all the languages are showing up and I don't know why. I've tried to find ways to edit this under settings but I've yet to find anything.
As you see in the images below, on the homepage it says the Repo is 100% Jupyter notebooks, but if you click on "languages" you'll see that there are python and csv files as well that seem to be unaccounted for.
If anyone knows how I can change this please let me know. It's not very important but I think it'd look much nicer if the breakdown of languages was more accurate. Thank you!
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.

MercurialEclipse 2.1 (HgEclipse) icons

I've searched, but been unable to find a comprehensive (or even cursory) list of the icons and meanings used in MercurialEclipse (formerly HgEclipse).
Here are some of the icons I'm seeing (although I'm guessing there are others), along with what I think they mean:
You're right about the first two.
The third one indicates a conflict and you will see this decorating a file that has conflicts during a merge.
If you don't mind looking at the source code, you can find the overlay icons under com/vectrace/MercurialEclipse/team/images. The constants associated with these icons are defined here.

Github misclassifies Matlab .m files as Objective-C files

I'm new to Git and I'm trying to push my local branch to the remote directory on Github. My project is on Matlab, so the files have .m extension. They naturally don't show any objective-c language pattern. I even checked in some .mat files. But they are misclassified as Objective-C files.
I would like to know:
After push, can we modify directly the language in Github? I'm sorry if it is very easy to find, but I really couldn't find that.
I find that other people's Matlab project could be correctly classified, with just .m extension. Some people also mentioned if you name your files with .matlab extension, it could be easily recognized as Matlab language, but it's not a clean solution. I would like to know, what are the criteria that files could be recognized as matlab with .m extension or just to increase the chance to be recognized as matlab language. I noted that some people just add matlab in their file name, but people who don't do that also succeeded.
I've sent an email to Github for help. They answered the first question: the answer is no.
GitHub determines the language based on the total size of the files that belong to each language. We use the Linguist library to analyze source code files: https://github.com/github/linguist
I suppose this is the same problem as in the webapps stack exchange: https://webapps.stackexchange.com/questions/31654/force-github-syntax-highlighting-language-on-source-files
Seems that the way to do that is to change from the ambiguous .m extention to .matlab, even though it's not prefered by the author...
It is now possible to use Linguist overrides to override the detection results from Linguist. In particular, you can use a .gitattributes file in your repository:
*.m linguist-language=Objective-C
Note: If you're checking locally, you'll need to commit the .gitattributes file before you see the effect.

OpenOffice syntax highlighting

I have some big documentation to do that will contain pieces of code I'd like to give the conventional "coding language" syntax highlighting. I've searched the styles feature to do such a thing, but there is no way to do that (in fact I could only found a forum where people were fighting about adding this feature or not, but this is not the point).
There is an abandoned extension for OpenOffice, but using it freezes my installation of OpenOffice.
What's the easiest way to do this? Should I try to recompile the extension and debug it (although I'm already having a hard time compiling another Java project), or maybe I should use a macro? How to implement this?
One possibility is to use one of the many code to html tools out there and then include the html in your OpenOffice document (using "File..." on the Insert menu).
One possibility is highlight. Vim has a :TOhtml command that will convert the current file to syntax highlighted html using the current colour scheme. I've not tried it, but this looks promising. There are also a few online ones, such as this. I'm sure there are a great many other options.