Rosetta Code:Village Pump/Syntax highlighting

From Rosetta Code
Revision as of 14:40, 9 July 2009 by rosettacode>Dkf (→‎Language tags: Add HTML magic to make the page scroll less)

Discuss issues related to the Syntax Highlighting system here. The old page got huge, and it became hard to discern what problems were current.

Relationship Between Rosetta Code and GeSHi

Rosetta Code first started using GeSHi for syntax highlighting a long while back, but due to our nature, we quickly discovered, and frequently continue to discover, programming languages which GeSHi does not provide highlighting functionality. Additionally, we've uncovered bugs in various releases of the software, and the GeSHi folks have been welcoming of fixes sent to them.

Due to the way language support is managed in GeSHi, it's fairly trivial for someone who can follow PHP syntax to create a PHP file that adds support for the language of their choice. GeSHi's support for Oberon-2, Modula-3 and AutoHotKey is the direct result of contributions by MBishop and Tinku99. (If you like a language, and it doesn't appear to have syntax highlighting support, I strongly suggest you follow their lead. ;-) )

I am now also part of the GeSHi project focusing for now on adding and improving support for programming languages present on Rosetta Code. As a community of language aficionados and enthusiasts, Rosetta Code is a hotbed for opportunities for improving GeSHi, and improvement of GeSHi is extremely helpful for improving the readability code on Rosetta Code. --Short Circuit 06:43, 18 June 2009 (UTC)

So how can I add a language? I have made a GeSHi file for Vedit macro language. Where can I upload it? (I can not test it myself so I don't know if it is OK). I could do a file for RapidQ quite easily, too, since I have Vedit syntax file for it.
It would be nice if there was an example GeSHi file downloadable somewhere (or perhaps even a few of them). The only one I found was at GeSHi web page. I had to cut and paste the source from the browser, and the do quite a lot editing to get newlines etc. fixed. --PauliKL 15:26, 30 June 2009 (UTC)
Email them to me at mikemol@gmail.com, and I'll get them tested, staged on RC and committed to SVN as quickly as I can. --Short Circuit 17:06, 30 June 2009 (UTC)

C syntax highlight

I've noticed that the "string" word is highlighted as a type in C; it shouldn't be so. --ShinTakezou 23:00, 3 July 2009 (UTC)

Whitespace at program beginning/end

I just wanted to make sure that this problem doesn't get forgotten now that the thread moved to the archive page. --Ce 23:18, 6 July 2009 (UTC)

I think you're going to have to reiterate exactly what the problem is, and how it manifests itself under the current configuration. --Short Circuit 23:50, 6 July 2009 (UTC)
In
<lang cpp>
int main {}
</lang>
there are additional blank lines,

<lang cpp> int main {} </lang>

which don't appear in
<pre>
int main()
</pre>
which results in
int main()
Those lines shouldn't be there. Currently the only way to get rid of them is to put the beginning/end tag on the same line as the first/last line of the code, which makes editing (and especially modifying existing snippets) unnecessarily hard (especially it's easy to miss an end tag, since it's bolted onto the last line of the code). In addition, it's an inconsistency. The lang tags should work exactly like pre tags, except for syntax hilighting.
The old discussion is in Village Pump:Home/Syntax Highlighting ( archived 2009-06-18 )#Another problem with eating whitespace characters (note that the start of that discussion concerns an older state with a different problem; initially too much was removed). --Ce 10:42, 7 July 2009 (UTC)

Language tags

Due to changes I want to implement in the way processing of the lang tag is done, we need to standardize codes for all of the languages currently on Rosetta Code ASAP. Subsequently, all pages need to be scoured for code snippets.

Here is a list of the languages that currently exist on Rosetta code as I write this. Next to each language, place the code for that language. If the code is already established in GeSHi, make it bold. If no code is provided by GeSHi, and no code is currently in use for that language on the wiki, make one up. Once this list is fully populated, all the pages for each language need to be checked, and ensure that the code snippets for that language are correct. (Not sure what to do about command-line one-liners or similar yet, though.)

Note: AutoHotKey currently has two codes, ahk and autohotkey. When AutoHotKey support was added to GeSHi, it was added with the longer code. (lang codes are derived from the filename.) Since there were already code snippets on RC that used ahk for AutoHotKey, I created a symlink that allowed ahk to be used as a language code as well. This should likely be reversed, meaning instances of the ahk tag need to be replaced with the autohotkey tag. --Short Circuit 07:01, 18 June 2009 (UTC)

  • 4D

A

  • ALGOL 60
  • ALGOL 68
  • APL apl
  • AWK awk
  • ActionScript actionscript
  • Ada ada
  • Agda2
  • AmigaE amigae
  • AppleScript applescript
  • Assembly asm (for x86)
  • AutoHotkey autohotkey

B

  • BASIC qbasic freebasic thinbasic
  • Bc
  • Befunge
  • Brainf*** bf

C

  • C c
  • C sharp csharp
  • C++ cpp
  • Caml
  • Clean clean
  • Clojure
  • Cobol cobol
  • ColdFusion
  • Common Lisp lisp
  • Component Pascal
  • Coq

D

  • D d
  • DOS Batch File dos
  • Dc
  • Delphi delphi

E

  • E e
  • EC
  • ELLA
  • ESQL
  • Eiffel eiffel
  • Emacs Lisp
  • Erlang

F

  • F
  • F Sharp fsharp
  • FALSE
  • FP
  • Factor
  • Fan
  • Forth forth
  • Fortran fortran

G

  • GAP
  • Gnuplot
  • Groovy groovy

H

  • HaXe haxe
  • Haskell haskell

I

  • IDL idl
  • Icon
  • Io

J

  • J j
  • JSON
  • JScript.NET
  • Java java java5
  • JavaScript javascript
  • JoCaml
  • Joy joy
  • JudoScript

K

  • Korn Shell

L

  • LSE64
  • LaTeX latex
  • LabVIEW
  • Lisaac
  • Lisp lisp
  • Logo logo
  • Logtalk
  • LotusScript lotusscript
  • Lua lua
  • Lucid lucid

M

  • M4 m4
  • MAXScript maxscript
  • MIRC Scripting Language mirc
  • MS SQL
  • Make make
  • Maple
  • Mathematica mathematica
  • Maxima
  • Metafont metafont
  • Modula-3 modula3

N

  • NewLISP
  • Nial nial

O

  • OCaml ocaml
  • Oberon-2 oberon2
  • Object Pascal
  • Objective-C objc
  • Octave octave
  • Omega
  • OpenEdge/Progress
  • Oz

P

  • PHP php
  • PL/I
  • PL/SQL plsql
  • Pascal pascal
  • Perl perl
  • Pike
  • PlainTeX tex
  • Pop11 pop11
  • PostScript postscript
  • PowerShell powershell
  • Prolog prolog
  • Python python

Q

  • Q q

R

  • R r R
  • REXX rexx
  • RapidQ rapidq
  • Raven
  • Rhope
  • Ruby ruby

S

  • SAS sas
  • SETL
  • SMEQL
  • SNUSP
  • SQL sql
  • Scala scala
  • Scheme scheme
  • Script3D
  • Seed7
  • Self
  • Slate slate
  • Smalltalk smalltalk
  • Standard ML sml

T

  • TI-83 BASIC
  • TI-89 BASIC
  • Tcl tcl
  • Toka
  • Tr
  • Transact-SQL
  • Twelf

U

  • UNIX Shell bash
  • UnixPipes
  • Unlambda

V

  • V v
  • VBScript
  • Vedit macro language vedit
  • Visual Basic vb
  • Visual Basic .NET vbnet
  • Visual Objects

W

  • Wrapl

X

  • XSLT
  • XTalk

Here is a list of the codes currently provided by GeSHi.

<lang list></lang>