Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: GeSHi Syntax Highlighting  (Read 4591 times)

0 Members and 1 Guest are viewing this topic.
GeSHi Syntax Highlighting
« on: March 26, 2012, 05:41:36 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
I've just implemented GeSHi Syntax Highlighting into code tags within the forum.

Use is simple:
[ code = <language> ]

For example, to display a syntax-highlighted Ruby script, you would use [ code = ruby ] (sans the spaces):
Code: Ruby
  1. def ExampleClass
  2.     def initialize(p = {})
  3.         @name = (p[:name].blank? ? "" : p[:name])
  4.     end
  5. end

Because it is the most commonly-used language within these forums, here is an example with GML ([ code = gml ]:
Code: GML
  1. global.PlayerX = 5
  2. image_index = 20

For a full list of supported languages, you can go to GeSHi's website: http://qbnz.com/highlighter.
« Last Edit: March 26, 2012, 05:50:48 am by ミン宇宙人 »
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: GeSHi Syntax Highlighting
« Reply #1 on: March 26, 2012, 10:44:15 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Posts: 728
I like the addition, but the highlighting seems off? Like for instance, the keyword "global" would be in blue, "image_index" would be a reddish color, and the numeric values would be a light blue, for the Windows version of Game Maker 8.
Logged
  • Pyxosoft
Re: GeSHi Syntax Highlighting
« Reply #2 on: March 26, 2012, 06:54:57 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
At first, I was under the impression that the coloring scheme was specific to GeSHi itself - but it appears language colors are defined specifically within their language spec with GeSHi. I've attached the GeSHi file for GML, if you're interested in editing it - I'm not familiar with the colors or keywords used within GML.

Alternatively, if you can give me a list of colors based on symbol types, I could go through and edit the file as well.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: GeSHi Syntax Highlighting
« Reply #3 on: March 26, 2012, 07:13:02 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
While the appearance of the code box seems fine to me in both the Vaati and Minish themes, question has been raised about its appearance in Vaati. Can I get some opinions on the styling of the code box in each theme?

Edit: Apparently there's a "Lite" edition of Game Maker for Mac now, so I'm downloading it to check on what it uses for keyword colors.

Edit 2: Seems GM:Mac uses different syntax highlighting rules..

Edit 3: I've edited the colors based on GM:Mac's colors - but I'll probably hook up my desktop machine to pull the colors off of that whenever I get the chance today.
« Last Edit: March 26, 2012, 07:33:49 pm by ミン宇宙人 »
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: GeSHi Syntax Highlighting
« Reply #4 on: March 26, 2012, 08:14:11 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Posts: 728
Yeah, I can go through them. At work right now. I also believe the older versions of GM have different highlighting as well. Although I'm not sure if you want to take that into consideration or not.
Logged
  • Pyxosoft
Re: GeSHi Syntax Highlighting
« Reply #5 on: March 26, 2012, 08:56:31 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
I've updated the script now with colors based on Game Maker 8 for Windows.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: GeSHi Syntax Highlighting
« Reply #6 on: March 26, 2012, 10:20:46 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Posts: 728
Hmmm are you currently working with it? Because the syntax is no longer highlighted at all.
Logged
  • Pyxosoft
Re: GeSHi Syntax Highlighting
« Reply #7 on: March 26, 2012, 10:26:28 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Yeah, GM broke our toys (this and the Spoiler tags). Give us a sec.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog

thestig

Re: GeSHi Syntax Highlighting
« Reply #8 on: March 26, 2012, 10:29:21 pm »
Yeah, GM broke our toys (this and the Spoiler tags). Give us a sec.
My bad. :X I accidentally dun goofed on this part.

EDIT: K, most of the tags should be fixed. Waiting on MiN to upload geshi. My bad guys, I accidentally neglected something when changing the root index around. :X

EDIT #2: Code-tag restored. MiN's gonna restore the GML stuff. I apologize for accidentally the tags.
« Last Edit: March 26, 2012, 10:58:48 pm by gm112 »
Logged
Re: GeSHi Syntax Highlighting
« Reply #9 on: March 26, 2012, 11:01:53 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Alright, it's updated. Now, the colors I used are what I got looking at the colors in Paint, but they don't really seem all that bright to me - still, the colors are quite straightforward, so I can edit them to full value (instead of half) if you think that'd be more appropriate. (The colors are essentially half-value (128/#80) on their corresponding colors and empty on the others.)
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: GeSHi Syntax Highlighting
« Reply #10 on: March 26, 2012, 11:30:52 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Posts: 728
Looks good to me meng.
Logged
  • Pyxosoft
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.056 seconds with 61 queries.

anything