Skip to content

Latest commit

 

History

History
83 lines (68 loc) · 1.63 KB

syntax-highlighting-markdown.md

File metadata and controls

83 lines (68 loc) · 1.63 KB

Syntax highlighting for code snippets in Markdown

Fenced code blocks are an easy way to enable syntax highlighting for your code snippets. The general format for fenced code blocks is:

```alias
...
your code goes in here
...
```

The alias after the initial three '`' characters defines the syntax highlighting to be used. The following is a list of commonly used programming languages on the Azure platform and the matching label:

Language or CLI Language alias
Azure CLI azurecli
AzCopy azcopy
C++ cpp
C# csharp
F# fsharp
Java java
JavaScript javascript
JSON json
NodeJS nodejs
Objective-C objc
PHP php
PowerShell powershell
Python python
Ruby ruby
SQL / T-SQL sql
Swift swift
VB vb
XAML xaml
XML xml

For a full list of languages that are supported, see Language names and aliases...

Example: C#

Markdown

```csharp
// Hello1.cs
public class Hello1
{
    public static void Main()
    {
        System.Console.WriteLine("Hello, World!");
    }
}
```

Render

// Hello1.cs
public class Hello1
{
    public static void Main()
    {
        System.Console.WriteLine("Hello, World!");
    }
}

Example: SQL

Markdown

```sql
CREATE TABLE T1 (
  c1 int PRIMARY KEY,
  c2 varchar(50) SPARSE NULL
);
```

Render

CREATE TABLE T1 (
  c1 int PRIMARY KEY,
  c2 varchar(50) SPARSE NULL
);