ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Custom syntax highlighting
Date: Tue, 1 Mar 2016 22:53:10 +0100	[thread overview]
Message-ID: <56D60F46.1010703@wxs.nl> (raw)
In-Reply-To: <nb4cbc$adf$1@ger.gmane.org>

On 3/1/2016 4:26 PM, Nicola wrote:
> I'm using the latest beta, and I need syntax coloring for SQL
> (PostgreSQL variant). According to the wiki, there is no SQL
> syntax coloring available for MKIV yet, but I'd be happy to
> be wrong :)
>
> If I am not wrong, I'd like to write my own syntax file, but
> not starting from scratch. I cannot find any pret-* files in
> the beta, though. Should they be downloaded separately?

just fyi (as aditya already provided you a solution) there are three 
highlighters

- the build-in one, for which one can define additional variants (there 
are few defined, some assume proper syntax, some are line based)

- the module by aditya which (i assume) also needs vim installed

- a relative new mechanism based on the scite lexers that i use (for not 
it is loaded by \usemodule[scite]

The last option is supports combined tex/mp/lua as well as xml, web, 
pdf, bibtex, lua so basically all the formats used by context and
i now also added the sql one (i needed that one a while ago but never 
added it to the upcoming beta)

\usemodule[scite]

\starttext

% \scitebuffer[sql][x]
% \scitefile[sql][abc.sql]

\startscite[sql]
....
\stopscite

\stoptext

no upload yet

btw, there's also:

mtxrun --extra=listing --scite --compact foo.sql

or whatever known suffix

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2016-03-01 21:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 15:26 Nicola
2016-03-01 15:35 ` Aditya Mahajan
2016-03-01 18:14   ` Nicola
2016-03-02  2:14     ` Aditya Mahajan
2016-03-02  8:46       ` Nicola
2016-03-02 14:45         ` Aditya Mahajan
2016-03-02 15:23           ` Nicola
2016-03-02 11:06       ` Nicola
2016-03-02 11:20         ` Nicola
2016-03-02 18:21   ` Nicola
2016-03-02 19:34     ` Aditya Mahajan
2016-03-02 19:58       ` Nicola
2016-03-02 20:11         ` Aditya Mahajan
2016-03-02 20:29           ` Nicola
2016-03-01 21:53 ` Hans Hagen [this message]
2016-03-02  8:56   ` Nicola
2016-03-02  9:13     ` Hans Hagen
2016-03-02 10:45       ` Nicola
2016-03-02 23:16         ` Alan BRASLAU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D60F46.1010703@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).