github-linguist / linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
MIT License
12.36k stars 4.28k forks source link

New language: XAML (Extensible Application Markup Language ) #5990

Open Schecher1 opened 2 years ago

Schecher1 commented 2 years ago

Language name

XAML (Extensible Application Markup Language)

Description

It is a FrontEnd language for (most popular) WPFs and MAUIs, is used by the VB and C# language.

URL of example repository

Press me to go to the Repo

URL of syntax highlighting grammar

Press me to get the Wikipedia Post

Most popular extensions

*.xaml

Detected language

Unfortunately it is recognized as XML and is not even displayed, apart from that there is a huge difference between XML and XAML. Only that XAML has the structure of XML.

Color of recognition

It should be a BrightBlue as well as the logo of XAML. Here are some HEX examples. As well as my source (XAML-Logo)

004AAE 145FCE 0548B3 336CBB

Alhadis commented 2 years ago

apart from that there is a huge difference between XML and XAML. Only that XAML has the structure of XML.

What huge difference? It looks exactly like ordinary XML to me.

Schecher1 commented 2 years ago

What huge difference? It looks exactly like ordinary XML to me.

So of course xaml is based on xml, but with xaml you don't store data but define an interface. Xaml is partly like HTML and CSS. As an example.

Alhadis commented 2 years ago

Syntactically, what's the difference? Is there a difference?

Schecher1 commented 2 years ago

Well, the syntax can't be much different because it's based on XML. But actually the reason would be enough that with XML you store data and with XAML you can define UI.

Data != Interface.

The UI is just described by an XML syntax.

Like:

<Button x:Name="Bttn_SelectFile" Content="Select File" HorizontalAlignment="Left" Margin="30,45,0,0" VerticalAlignment="Top" Height="45" Width="85" RenderTransformOrigin="0.294,0" FontSize="15" Click="Bttn_SelectFile_Click"/>
Schecher1 commented 2 years ago

But let's assume that XAML is XML. Why is the language not listed in the history of a repo?

I mean, I have now in a project 20 C# files and 13 XML (XAML) files. Why is only 100% C# shown? This is simply not true.

Schecher1 commented 2 years ago

image

image

Nixinova commented 2 years ago

Why is only 100% C# shown?

XML is classified as data by default and is therefore hidden in the sidebar by default. Which therein lies the justification for this request.

Schecher1 commented 2 years ago

It is understandable that XML is classified as data, because it is. But now I hope you can understand why I don't agree that XAML is represented as XML.

Schecher1 commented 2 years ago

Is there anything new? greetings

Alhadis commented 2 years ago

@Schecher1 If you want XAML files to contribute to your project's language statistics, you can use an override:

*.xaml linguist-detectable
Schecher1 commented 2 years ago

Hello, thank you for the answer. But I mean if you/we can standardize it? So that the language as well as C# is automatically detected. Apart from that, when I add this in the ".gitattributes" file only XML appears, and there we come back to my problem.

Alhadis commented 2 years ago

@Schecher1 If you know of a TextMate grammar for XAML that will improve the appearance of .xaml files, then we can add XAML as a separate language. We'd happily accept a pull-request in that case.

Schecher1 commented 2 years ago

Thanks, is there somewhere an instruction how I make the request? so what I have to add?

Alhadis commented 2 years ago

Literally everything you need to know is documented in CONTRIBUTING.md.

Schecher1 commented 2 years ago

Thank you, I will create the request and then delete this issue when everything is finished.

Schecher1 commented 2 years ago

Add a syntax-highlighting grammar for your language using:

I do not quite understand, may u can help me?

lildude commented 2 years ago

Add a syntax-highlighting grammar for your language using:

I do not quite understand, may u can help me?

Run the command shown (script/add-grammar) from within your checkout of your fork of this repo replacing the URL with the URL of the grammar you are adding.

This will require you to have met all the requirements as detailed at the start of the document.