Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does pygments guess lexer?

I'm using middleman-syntax to highlight code in my blog

I'm writing my templates in markdown... and was wondering, how does pygments guess lexer?

  if I write

  ´´´ruby
  ruby code here
  ```

  it doesnt work

  if I write

  ```      
  #!ruby
  ruby here
  ```

  it does

  If I write

  ```
  <?php
  php code here
  ```

  It does

Is there a list of how pygments guess it?

like image 226
Diego Dorado Avatar asked Jan 28 '26 11:01

Diego Dorado


1 Answers

As far as I know, Pygments does not guess.

Linguist does.

like image 171
Zombo Avatar answered Jan 30 '26 18:01

Zombo