Syntax highlighting on GitHub's Wiki: Specifying the programming language

Amelio Vazquez-Reina picture Amelio Vazquez-Reina · Jul 19, 2012 · Viewed 7.5k times · Source

GitHub uses something known as the "GitHub Flavored Markdown" for messages, issues and comments. My questions are:

  • Does GitHub also use this syntax for their Wiki?
  • From what I understand one can specify the programming language for syntax highlighting using the following syntax:

    ```ruby  
    require 'redcarpet'  
    markdown = Redcarpet.new("Hello World!")  
    puts markdown.to_html  
    ```
    

    Where one can specify the programming language after the ``` string (e.g. ```ruby)

    My question is: How do I look up the specifier for a programming language? (e.g. C does not seem to work for the C programming language)

Answer

Robert H picture Robert H · Jul 19, 2012

For a list of the possible lexers that github wiki can use see here: http://pygments.org/docs/lexers/

If you find that a certain lexer is not supported, github recommends forking their code and submitting it via a pull request: https://github.com/blog/774-git-powered-wikis-improved