Github language tag for Repository - github

On Github, some projects are tagged as being of one language or another. How do I add one of these tags. (Objective C, PHP etc.)

As far as I know, they aren't really tagged - the languages attached to them are the languages which you use in your project. Github looks through the source and figures out to the best of its ability what languages are in use.
If you go to your respository, then to the Graphs tab, you can see the language breakdown.

A repository can only be "tagged" with a single language in the search results. That language is the first from language statistics. Language statistics are computed by the open source project Linguist according to the total size of files for each language detected.
You can override language statistics using Linguist overrides. In particular, you can choose to ignore some files from statistics:
directory/to/ignore/* linguist-vendored
*.somextensiontoignore linguist-vendored
or override the detected language:
*.js linguist-language=Java

You should be able to Publish or Initial Commit with a sample file specific to the language you want it tagged as (such as an empty .cs file or .js file), then add your whole project; however, it seems like a pain.
I did find if you go to 'Add topics' on the far left under the 'Code' section, you can add all the languages you used for anyone that might be looking close enough at your project.

Make .gitattributes file in the root.Then depending on the language type make the below command true.So if your project is Javascript make it true, if your project is java make it true and so on.Push the code and refresh the page.
So now the desired language should get displayed in your git repo.
*.js linguist-detectable=true
*.java linguist-detectable=false
*.html linguist-detectable=false
*.xml linguist-detectable=false

Related

How to add languages to github projects

Github image
Hi, how can I add more languages to the description of my github repository ? I hope the image above explains what I mean,
cheers
The language is defined by GitHub itself based on language files you have in your source code. let say you have .js files in your source code then it will show javascript.
GitHub uses the open source Linguist library to determine file languages. The displayed language is simply the most used language in your project.

Importing source files and folders into IAR Workbench

I have a cup of source files in a certain folder structure in my file system. I want to use this structure for a project in the IAR Workbench. Thinking of Eclipse, that could be so easy! But in the IAR Workbench, the folders will become to "Groups", which are only kind of virtual folders. The Workbench doesn't care about folders.
Is there some easy and fast way to import them?
Up to now I have to add the groups manually each and then add the files to the groups, and that's really annoying!
Is there maybe a tool to generate a proper project file (*.ewp) out of a file/folder structure path?
This would help me a lot!
You should have a look at IAR Project/Add Project Connection command.
Although IAR doesn't seem to have any public documentation on the xml syntax, or at least I couldn't find any, you can find Infineon DAVE (Config.xml) and Freescale PE (ProjectInfo.xml) files if you search around. These can be used as examples to figure out the syntax on how to write your own xml files in one of these interfaces, to allow you to specify where all your c, h, assembly and library files are from where ever they may be in your file system. They also allow you to define preprocessor includes for compiler/assembler, and DAVE allows you to define a path variable, which is also very useful.
See: https://mcuoneclipse.com/2013/11/01/iar-arm-v6-7-comes-with-improved-processor-expert-support/
I have modified a DAVE Config.xml file and found it EXTREMELY useful for managing and migrating even just a handful of project files. For example to upgrade to a new release with all files having a new directory root, you just change a single line in the xml file (defining the new root), and all source files, compiler includes etc are all updated to the new level. No more manually editing the preprocessor includes or replacing all the files in the project. And no more fiddling around with ../../ file system hierarchy navigation stuff, you just specify directly (or indirectly via a path to) where the files are, no more relative from where your project happens to be. VERY NICE.
IAR should consider opening this up (documenting) for general users, as it is very useful for project management and migration. While at it they should also consider generalizing the xml syntax a little bit and allow for definition of IAR group heading names, specifying linker file name, and definitely allowing multiple xml files to be included (connected) (so that subprojects can be easily added or removed without effecting the other subproject definition files) and a few basic things like that.
If they where to do a bang up job on this, they might consider allowing most/all aspects of IAR project configuration that might be required by the subproject, to be defined in these xml files, and then entire (sub)projects could just be plopped down anywhere and be up an running extremely quickly (OK, just let me dream a bit :)
For anyone who happens upon this you may want to check out https://github.com/IARSystems/project-migration-tools. They have a tool for pulling in file trees here.

Goto definition like feature in custom (user-defined) language in notepad++

Is there any way (by means of plugins or settings) to create (by that I mean modifying, adding & deleting) custom tags in notepad++?
By tags I mean, to jump to the definition of an instance used anywhere in project (some kind of like 'goto definition' function like we have in other popular languages like C, C++, C#).
I searched for this topic but could not find satisfactory result.
My requirement:
I have created a custom language in Notepad++ (by adding keywords, coloring patterns and other rules). Now I need the way to add custom tags for this language. How can I achieve this?
With the help of tags I should be able to navigate to definition (just like goto definition in other popular languages) in the particular project (all files in project or at least opened files).
Now I need the way to add custom tags for this language. How can I achieve this?
If you're using Exuberant Ctags you can configure a new language definition using just a handful of regular expressions.
For example this link shows how to configure ctags for the Clipper language using this regexp approach:
I have just had to deal with essentially the same issue. I am using Notepad++ with a legacy codebase written in a custom markup language. Each file can contain cross references to definitions in other files, so a way of jumping to the definition would be very useful.
It has not been easy to find a solution that meets all four requirements: a goto definiton feature that works across multiple files and for a custom language in Notepad++. I found this question while searching for a solution; the answer jussij provided is good but it does not really provide a complete solution.
I ended up using the SourceCookifier plugin with a custom language definition. There is not a huge amount of guidance online about how to use it, but once installed you can use it to manually create a language definition using regex rules.
SourceCookifier will work for your language if you can configure the following:
A set of file extensions used by the language
A set of tag types (i.e. a function, class, variable)
A set of POSIX Basic Regular Expressions for locating each tag type, see this post
Once a language has been defined, you can highlight any instance of a found tag and use the shortcut Ctrl+Shift+Enter to jump to the definition of that tag. This can work across a whole codebase of files if you provide it with a list of files to inspect, it calls this a 'session'. All you need to do is drag and drop your codebase folder into the SourceCookifier sidebar window. The codebase I was working with is very large, so I am only using basic functionality, see this post for a good explination of that. The goto definition shortcut can also be added to a right-click context menu, see this post.

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.

How to display bazaar version number in a latex document?

I am using bazaar as a version control system for my research. I have many latex documents. I want to display the version number in all the .dvi files under bazaar.
The easiest way to accomplish this will be to use make or a similar build manager to generate your .dvi files.
Your Makefile should include a new target called version-number:
version-number:
bzr revno > VERSION.tex
and your .dvi targets should depend on version-number:
my-project.dvi: my-project.tex [OTHER STUFF] version-number
In your .tex files, at an appropriate place (in the header/footer, title block, PDF metainfo, etc) you would include the version number stored in VERSION.tex:
\input{VERSION}
When you set this up you should bzr ignore VERSION.tex so that it won't store its own version number, of course.
This is all based on a similar technique used for git in the Common Lisp Quick Reference project.
Maybe the bazaar keywords plugin can help you.
I have used the latex VC package successfully with Bazaar. It works using an external script that is called during compilation by \write18. This may seem overkill but it provides a lot of functionality and works well.