Page 2 of 2
Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Mon Jan 31, 2011 6:42 pm
by jacmoe
And how should the forum display those attachments?
I am too lazy to be opening archives..
Download the highlight.js package and take a look at the language folder. It seems to be easy enough.
I plan to add support for Ogre classes/functions when/if I have time.
If one is not beating me to it.
You can just attach it here, or send it to me by PM.
I need to rebuild our packed script, though.

Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Mon Jan 31, 2011 6:58 pm
by betajaen
Test
[Edit]
Urgh, I thought the server would just show it when you clicked on it. Mime type problem?
Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Mon Jan 31, 2011 7:26 pm
by spacegaier
No, I think that's the common behavior: Download

.
Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Mon Jan 31, 2011 7:35 pm
by betajaen
But I've seen websites properly give out the mime type before, the browser knows what it is and just displays it in the browser as a text file.
[Edit]
For example; This website gives out the
right mime type for files - Click any .c file and the browser receives a "text/plain" plain mime type for which the browse just shows it. It also shows when it does not (Makefile).
Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Tue Feb 01, 2011 7:32 pm
by jacmoe
xavier wrote:Highlighting time isn't horrible. Hightlighting all the numbers is distracting.
I missed your post, Xavier.

I will see if I can implement a log parser.
I'll do some tests and then I need to re-pack the highlighter once it works.
Need to find out how to do this routine anyway in case someone wants to contribute Ogre script parsers and additional Ogre keywords for the cpp parser.
The beauty of this highlighter is that it cost next to nothing on the server.
And it's definitely among the fastest on the client.
Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Tue Feb 01, 2011 8:34 pm
by jacmoe
Code: Select all
21:59:58: Creating resource group General
21:59:58: Creating resource group Internal
21:59:58: Creating resource group Autodetect
21:59:58: SceneManagerFactory for type 'DefaultSceneManager' registered.
21:59:58: Registering ResourceManager for type Material
21:59:58: Registering ResourceManager for type Mesh
21:59:58: Registering ResourceManager for type Skeleton
21:59:58: MovableObjectFactory for type 'ParticleSystem' registered.
21:59:58: OverlayElementFactory for type Panel registered.
21:59:58: OverlayElementFactory for type BorderPanel registered.
21:59:58: OverlayElementFactory for type TextArea registered.
21:59:58: Registering ResourceManager for type Font
Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Tue Feb 01, 2011 8:38 pm
by jacmoe
Now I hacked the message parser so that it changes the code tag to code=off if you put an Ogre log in it.
Hopefully.
It checks if the contents of the tag contains text like this:
That's two digits and a semicolon three times in a row.
That ought to take care of the problem.

Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Tue Feb 01, 2011 11:19 pm
by Zonder
nice work
I agree it definatly should be on as default with cpp
Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Tue Feb 01, 2011 11:47 pm
by jacmoe
I can do that by checking if the language parameter is missing, just as I check if the contents is an Ogre log.
That means that if you submit a post with a code tag using no parameters, the board will sneakily change it to code=cpp.
If that's okay with you guys, I'll do that change.

So if it's a log it becomes code=off, otherwise it becomes code=cpp.
That should take care of it.
Re: [SOLVED]Syntax highlighter inside [code][/code] tags
Posted: Thu Feb 03, 2011 2:36 pm
by Zonder
that seems ok to me since I can't really remember much else been posted other than those two. And if somthing shows up that is really bad I am sure a mod can change it
