ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: pretty printers
Date: Wed, 8 May 2019 16:55:41 -0400 (EDT)	[thread overview]
Message-ID: <nycvar.YAK.7.76.44.1905081654520.25866@ervasbepr.pvz.zptvyy.pn> (raw)
In-Reply-To: <20190508204203.GC544@akela.mendelu.cz>

On Wed, 8 May 2019, Tomas Hala wrote:

> Wed, May 08, 2019 ve 10:14:45PM +0200 Wolfgang Schuster napsal(a):
> # Tomas Hala schrieb am 08.05.2019 um 21:58:
> # >Hi all,
> # >
> # >according to our wiki, there are pretty printers in ConTeXt
> # >implemented only for TEX, LUA, XML and MP.
> # >
> # >I am searching now for PHP pretty printer but I did not find
> # >anything on the net (only C and Java). I would like to ask
> # >whether is something for PHP (or for other programming languages)
> # >available.
> # 
> # 1. Use the scite module which provides additional styles (e.g. cpp
> # or json) but php is still missing.
> # 
> # 2. Use Aditya's vim module which uses vim to highlight source code.
> # 
> # Wolfgang
>
> Maybe it is a misunderstanding but how can use these modules
> in ConTeXt? I had in mind typesetting the code in ConTeXt
> like \startTEX etc.

Here is an example with the vim module:

\usemodule[vim]
\definevimtyping[HTML][syntax=html]
\definevimtyping[PHP] [syntax=php]

\starttext

\startHTML
<html>
    <head>
       <title>Hello World</title>
    </head>

    <body>
       <?php echo "Hello, World!";?>
    </body>
</html>
\stopHTML

\startPHP
<?php
    $a = 3;
    $b = 4;
    $c = sqrt($a**2 + $b**2)
?>
\stopPHP

\stoptext

See https://github.com/adityam/filter/blob/master/vim-README.md for more 
details.

Aditya
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2019-05-08 20:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 19:58 Tomas Hala
2019-05-08 20:14 ` Wolfgang Schuster
2019-05-08 20:42   ` Tomas Hala
2019-05-08 20:55     ` Aditya Mahajan [this message]
2019-05-08 21:05       ` Tomas Hala
2019-05-08 20:59     ` Wolfgang Schuster
2019-05-08 21:08       ` Tomas Hala

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=nycvar.YAK.7.76.44.1905081654520.25866@ervasbepr.pvz.zptvyy.pn \
    --to=adityam@umich.edu \
    --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).