doddoreul / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

Support for XQuery 1.0 #124

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This would be nice.  There's regexp support in vim for it.

If you'd take contributions on this, please let me know.

Original issue reported on code.google.com by eric.bloch on 23 Jul 2010 at 8:50

GoogleCodeExporter commented 8 years ago
I've implemented a xquery lang file for google-code-prettify
Take a look at the files right here:

http://www.patrick-wied.at/static/xquery/prettify/

I noticed that there wasn't a token for functions or variables therefore I've 
added the required JS/CSS.
If you don't want a large lang file, you could exclude the xquery functions and 
the filesize will shrink down to ~3.2kb

Original comment by patrick....@googlemail.com on 29 Sep 2010 at 11:18

GoogleCodeExporter commented 8 years ago
Thanks for the patch, Patrick.

I want a way for languages to be able to specify new token types but let 
stylesheets that don't mention them gracefully degrade.

So I didn't add the function and var token names to prettify.js.  They're 
defined in lang-xq.js and they're defined as
    var PR_FUNCTION = 'fun pln';
so that stylesheets that style
    .fun { color: red }
will show it as red, but other stylesheets will fall back to the rule for .pln.

See 
http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-xq.js
 and the tests at 
http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test_2.html 
which I put in a separate file because the sheer number of language extensions 
are becoming unmanageable in one test file.

Original comment by mikesamuel@gmail.com on 4 Mar 2011 at 9:29