Skip to content

Instantly share code, notes, and snippets.

@nocke
Last active November 22, 2017 14:08
Show Gist options
  • Save nocke/1bbca000960130858d3e92269fbfec88 to your computer and use it in GitHub Desktop.
Save nocke/1bbca000960130858d3e92269fbfec88 to your computer and use it in GitHub Desktop.
SO-syntax-coloring.md
A long list, based on [this info](https://pastebin.com/AWMtu5rK)
Usage, see advice below!
[actionscript] = lang-js
[ant] = lang-xml
[boost] = lang-c
[c#-4.0] = lang-cs
[c#] = lang-cs
[c++] = lang-c
[c] = lang-c
[cl] = lang-lisp
[cocoa-touch] = lang-c
[cocoa] = lang-c
[css] = lang-css
[database] = lang-sql
[django] = lang-py
[el] = lang-lisp
[excel-vba] = lang-vb
[f#] = lang-ml
[gcc] = lang-c
[haskell] = lang-haskell
[html5] = lang-html
[html] = lang-html
[java-me] = lang-java
[java] = lang-java
[javascript] = lang-js
[jsp] = lang-java
[lisp] = lang-lisp
[lua] = lang-lua
[msbuild] = lang-xml
[mysql-query] = lang-sql
[mysql] = lang-sql
[objective-c] = lang-c
[ocaml] = lang-ml
[oracle] = lang-sql
[perl] = lang-perl
[php] = lang-php
[plsql] = lang-sql
[postgresql] = lang-sql
[protobuf] = lang-proto
[protocol-buffers] = lang-proto
[python] = lang-py
[regex] = lang-regex
[ruby-on-rails] = lang-rb
[ruby] = lang-rb
[scala] = lang-scala
[sml] = lang-ml
[sql-server-2005] = lang-sql
[sql-server-2008] = lang-sql
[sql-server] = lang-sql
[sql] = lang-sql
[sqlite] = lang-sql
[stl] = lang-c
[stored-procedures] = lang-sql
[tsql] = lang-sql
[vb.net] = lang-vb
[vb6] = lang-vb
[vb] = lang-vb
[vbscript] = lang-vb
[visual-c++] = lang-c
[xaml] = lang-xml
[xhtml] = lang-html
[xml] = lang-xml
[xpath] = lang-xml
[xslt] = lang-xml
@nocke
Copy link
Author

nocke commented Nov 21, 2017

...for those with little time...

<!-- language: lang-js -->

    const demo = { a:42, b:true};
    let double = (a) => { return 2*a; }

leading (in Stackoverflow, not general Markdown!) to:

    const demo = { a:42, b:true};
    let double = (a) => { return 2*a; }

<!-- language: lang-html -->

    <header id="x" class='foo' data-x='bar'>
        header 123 ${template}
    </header>

leading in Stackoverflow to:

    <header id="x" class='foo' data-x='bar'>
        header 123 ${template}
    </header>

To set the language for all code snippets that follow, all -all

<!-- language: lang-html -->

There's also some begin-snippet-Syntax, which I never saw nor understand:

<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->

    <meta name="viewport" content="width=device-width, initial-scale=1">

<!-- end snippet -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment