GeSHi / geshi-1.0

Original version of Generic Syntax Highlighter for PHP
http://qbnz.com/highlighter/
GNU General Public License v2.0
168 stars 100 forks source link

Add CSH language file #115

Closed apjanke closed 1 month ago

apjanke commented 5 years ago

Would you accept a CSH/TCSH language definition file?

The Open MPI website uses GeSHi for highlighting and has some CSH snippets. They're currently styled using the bash highlighter; would be nice if there was a CSH highlighter so we could get them just right.

splitbrain commented 4 years ago

@BenBE looks like there went something wrong on travis. Can you trigger a rebuild please?

splitbrain commented 4 years ago

The language file seems to contain a whole lot of non-CSH related commands (like apache, git, etc). I don't think they should be in here.

apjanke commented 4 years ago

I'm just following the example of the existing bash.php, which has a ton of these common commands: https://github.com/GeSHi/geshi-1.0/blob/5861c58981244ab6ee0dd337f096ff14bf15b1eb/src/geshi/bash.php#L95-L367. (Personally, I think it makes more sense to not have them.)

I can remove if you'd prefer. Would you also want a PR removing them from the Bash scheme?

splitbrain commented 4 years ago

huh. weird. I never noticed. I would say those shouldn't be there (neither in bash nor csh). Typical shell programming tools like sed or awk would be okay I'd think, but the rest should go IMO. @BenBE what do you think?

BenBE commented 4 years ago

I think having the common commands in there is kinda beneficial to average users as most snippets that use this language file are e.g. on blogs explaining things and would look rather strange if half of the commands suddenly were missing markup. What I could agree (but IIRC this is already the case) would be to have them in a separate group, thus build-ins, POSIX and other typical shell commands and such extra utilities were actually different groups.

Which brings up another discussion: What about sharing of keywords across languages? Like: Having such a utility program list in bash and tcsh would be rather nice to have in one place, instead of maintaining them one for each language file (bash, tcsh, zsh, ...).

apjanke commented 4 years ago

I think they are separate already: KEYWORDS group 1 and 3 are builtins; KEYWORDS group 2 is the external commands.

What about sharing of keywords across languages? Like: Having such a utility program list in bash and tcsh would be rather nice to have in one place, instead of maintaining them one for each language file (bash, tcsh, zsh, ...)

I think that's a great idea. I don't know enough PHP to help make it happen, though.