googlearchive / code-prettify

An embeddable script that makes source-code snippets in HTML prettier.
Apache License 2.0
5.79k stars 906 forks source link

Feature: Cassandra Query Language (cql) support #451

Open peter-janssen opened 8 years ago

peter-janssen commented 8 years ago

What do I need to do to get cql supported in code-prettify? Do I need to supply a regex in a new lang-cql.js file or is there more to it?

amroamroamro commented 7 years ago

Yes, you must create a new extension lang-cql.js for that language. This consists of regex patterns to detect the different constructs (comments, strings, keywords, etc..). Finally there's a call to PR.registerLangHandler to register the language handler for the given file extensions.

Take a look at the existing extensions in src/lang-*.js to get an idea.

I'm not familiar with CQL but there is a lang-sql.js which can be a good starting point if CQL is similar to regular SQL.