Syntax Highligting for Code

Started by G_G, June 08, 2011, 01:08:17 pm

Previous topic - Next topic

G_G

I found this SMF mod. http://custom.simplemachines.org/mods/index.php?mod=2109
It will format the code to match syntax colors and stuff. It would be used like this [code=alias][/code].

It includes all the supported languages, include Ruby. I think it'd be interesting to have. And as far as I know, the normal [code][/code] still works as well.

Blizzard

June 08, 2011, 02:14:13 pm #1 Last Edit: June 08, 2011, 02:15:24 pm by James McCloud
I've already tried to add that syntax highlighting a few times, but every time it was a complete disaster to implement or it would break everything else. I was going to try again the next time I have time.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Holyrapid

Well, if you get it to work, I'd say that it would make finding mistakes in codes easier, at least a little...

Blizzard

You don't type code in the forum. And the syntax highlighting would only be applied to already posted stuff, not to the text you are typing.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Theres this project called GeSHi. There used to be an SMF mod but due to GeSHi's license it was removed from the SMF site. However, I have found a copy of it on the internet, if you want it I'll PM it to you.

More on GeSHi http://qbnz.com/highlighter/

Blizzard

June 22, 2011, 05:19:38 am #5 Last Edit: June 22, 2011, 05:44:45 am by Blizzard
I've tried to integrate it today and I found two problems. The first one was that it simply didn't work. :/ The second one is this: http://code.google.com/p/syntaxhighlighter/wiki/Overview *points to part with performance*

EDIT: I added the Select option for code, though.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

June 22, 2011, 06:13:28 am #6 Last Edit: June 22, 2011, 06:33:45 am by game_guy
Woo! Bans over! Anyways, theres still this.

Quote from: game_guy on June 11, 2011, 07:11:27 pm
Theres this project called GeSHi. There used to be an SMF mod but due to GeSHi's license it was removed from the SMF site. However, I have found a copy of it on the internet, if you want it I'll PM it to you.

More on GeSHi http://qbnz.com/highlighter/


EDIT:

Sexy






Select







Button





*orgrasms*

Blizzard

Yeah, I know. I'll try that one another time.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G


Blizzard

I wasn't able to integrate this syntax highlighting mod due to some problems when I tried to a few months back. But Ryex was able to backport a mod from SMF 2.x which I will add over the course of the next few days. You can all thank Ryex by giving him a blowjob. Or even better: give me a blowjob. I love you all. <3
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

The things I do when I get board but don't really want to work on the things I need to...
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

Glad to finally see this happening. Pretty awesome. :3

Blizzard

I added it. I had to first fix a few small problems (and a big one) with the add-on and afterwards adjust the style sheet, but after that everything is the way I want it.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

winkio

Just checked it out, looks nice.  Good work :)

Blizzard

I just finished applying everything on the dark themes, too. Now I only have to figure out why the "Select" button doesn't appear anymore and how to add back where it says "Code" is no name for the tag was specified.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

looking pretty good if I do say so myself :P
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ThallionDarkshine

It looks like the <a> tag is there, its just that it has no text in it. Maybe something got messed up in the php or javascript and its not returning the text for the select button.

Blizzard

Does the code box appear in the center to anybody else except me? If yes, which browser are you using (I'm on Opera)?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

winkio

The box itself is stretched across the entire width of the post, and the text is aligned to the left, on Chrome.

ThallionDarkshine

It's the same in firefox as in chrome.