Domanda

I cannot find this anywhere and I swear I used to be able to very simply without much prying. Can anyone help me? Thanks. I would appreciate it. Also, does prettify support Batch?

È stato utile?

Soluzione 2

You can find a table in the FAQ, under the header For which languages does it work?:

The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, Makefiles, and Rust. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, but doesn't work on Smalltalk.

Other languages are supported via extensions: ...


You can find the handlers, with their extensions in the loader directory


For the mapping from extensions to builtin languages, see the registerLangHandler calls in prettify.js

Altri suggerimenti

I thought it would be helpful to have an actual list rather than just a link. I found it in the loader directory that @MikeSamuel linked to from Javascript code prettifier. As the readme states, the prettify.js comments are the authoritative source. However, What is syntax highlighting and how does it work? provided a better formatted list, so I will copy that below. Refer to the the links for the most up-to-date information.

If you are using the Prettify codes to markup Stack Overflow code, you use

<!-- language: lang-or-tag-here -->

    your code

Language Codes:

Let Prettify interpret the code and guess.

default

Explicitly do not use any syntax highlighting.

lang-none

Bash and other Shell scripting

lang-bash, lang-bsh, lang-csh, lang-sh

C, C++, et al

lang-c, lang-cc, lang-cpp, lang-cxx, lang-cyc, lang-m

C#

lang-cs

Clojure

lang-clj

CoffeeScript

lang-coffee

CSS

lang-css

Dart

lang-dart

Delphi

lang-pascal

Erlang

lang-erl, lang-erlang

Go

lang-go

Haskell

lang-hs

HTML

lang-html

Java

lang-java

JavaScript

lang-js, lang-javascript

JSON

lang-json

LaTeX and TeX

lang-latex, lang-tex

Lisp and Scheme

lang-cl, lang-el, lang-lisp, lang-lsp, lang-scm, lang-ss, lang-rkt

Lua

lang-lua

OCaml, SML, F#, et al

lang-fs, lang-ml

Pascal

lang-pascal

Perl

lang-pl, lang-perl

PHP

lang-php

Protocol buffers

lang-proto

Python

lang-py, lang-python, lang-cv

R and S

lang-r, lang-s

Regex

lang-regex

Ruby

lang-rb, lang-ruby

Rust

lang-rc, lang-rs, lang-rust

Scala

lang-scala

SQL

lang-sql

VHDL

lang-vhdl, lang-vhd

Visual Basic

lang-vb, lang-vbs

XML

lang-xml
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top