List for cgit developers and users
 help / color / mirror / Atom feed
From: Jason at zx2c4.com (Jason A. Donenfeld)
Subject: RESEND: syntax-highlighting.py
Date: Wed, 8 Jan 2014 17:28:48 +0100	[thread overview]
Message-ID: <CAHmME9qeP0XoocaAY4HGFvZo9HNp2J-zRe6ex-P1h32KcnMWNQ@mail.gmail.com> (raw)
In-Reply-To: <52CD7B30.3010208@sevenbyte.org>

On Wed, Jan 8, 2014 at 5:22 PM, Stefan Tatschner <stefan at sevenbyte.org> wrote:
> I have looked in pygment's sourcecode and found this [0]. I just have to
> add the filenames in the lexer definitions. I will try to create an
> upstream pull request. The only problem is that the latest release of
> pygments is almost 1 year old. It think it will take a while until the
> changes get merged...
>
> As a workaround we could create such a dict as you suggested and check
> if the filenames match.

Another workaround might be just to monkey patch _mapping.LEXERS. Any
of these possibilities is probably fine.


> At first I run guess_lexer_for_filename (line 26). It checks the content
> of the file and also looks at the filename. After that I check if there
> is a shebang because the script has already looked at the content with
> guess_lexer_for_filename. I have tested this without the shebang
> detection and especially with plaintext files it often returns crap...

Okay fair enough. Shebang guessing only.


> It will take a few days because currently I have exams... Should I work
> on the master branch or something else?

Yes the master branch.

>
> What do you want to de with the CSS definitions? Just put them into the
> default cgit CSS file or maybe include it seperately?

We already handle that on line 34 of [1], so no need to do anything
differently. Please base your work off [1] generally.


Thanks a bunch! Looking forward to seeing the results.

Jason

[1] http://git.zx2c4.com/cgit/tree/filters/syntax-highlighting.py


  reply	other threads:[~2014-01-08 16:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <52CD7ADF.2080903@sevenbyte.org>
2014-01-08 16:22 ` Fwd: " stefan
2014-01-08 16:28   ` Jason [this message]
2014-01-09 19:52     ` stefan
2013-11-04 20:46 syntax-highlighting.py stefan
2014-01-08 14:56 ` RESEND: syntax-highlighting.py stefan
2014-01-08 15:14   ` Jason
     [not found]     ` <CAHmME9p-89eXYBW0V-nn32XNrkFadFHD6r==qDjf9Pwk+jDNPg@mail.gmail.com>
2014-01-10 13:07       ` stefan
2014-01-10 16:19         ` Jason

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=CAHmME9qeP0XoocaAY4HGFvZo9HNp2J-zRe6ex-P1h32KcnMWNQ@mail.gmail.com \
    --to=cgit@lists.zx2c4.com \
    /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).