Geshi on the forum ? Simon ? Mark ?
Monkey Archive Forums/Monkey Discussion/Geshi on the forum ? Simon ? Mark ?
| ||
Hay peeps. I am sure I asked this in Max, and at some point probably in B3D as well, and thought I would ask here as well. For those that don't know, Geshi is a PHP module for creating syntax highlighted code on forums and websites, and I think we should get it for Monkeycoder. If they implement it, then when you post your normal code, it will get cleaned up and colored accurately , and since I spent the morning updated my geshi install to highlight monkey code I thought I would post about it. I have a Monkey Profile for Geshi if you need it, and an example of it working can be seen here http://dev.cruel-gaming.com/coding-conventions/ it's easy to install you guys should not have any problems with it. |
| ||
Great timing! I was going to look into ading syntax highlighting as one of the next jobs to do. This looks like it would do the job perfectly. Yes, please send us the Monkey profile, and I'll get it up and running on the site. |
| ||
E-Mail on its way mate. There is a css section at the bottom where you can change the colors if mine are not suitable. |
| ||
I would this added to the site. Also a section in the site to see all the avilable bbcodes would be great, with the youtube code and everything. |
| ||
you had a shot at this yet Simon ? |
| ||
Great! Nice initiative. |
| ||
+1 |
| ||
you had a shot at this yet Simon ? No, will take a look at the weekend. |
| ||
OK, we now have syntax highlighted code! Use bbcode and monkeycode tags. |
| ||
simonh,(as I've said on the blitzbasic forums) the text is too small to be properly readable when the tags are used. Any chance this can be fixed? |
| ||
I tried it out on one of my code snippets. The code appears on a plain background, not in a colored box as before. It is also in a font which is smaller than the surrounding text. |
| ||
Purely to see it running [monkeycode]Import mojo ' Comments? Comments. Class TestApp Extends App Method OnCreate() UpdateRate(30) End Method OnUpdate() End Method OnRender() End End Function Main() New TestApp End [/monkeycode] |
| ||
Nice work mate, there is a line number parameter in the gechi congfig's if you wana turn them on, or leave em off, its all good to me. |
| ||
Think I'll leave line numbers off as it makes copying and pasting tricker. |
| ||
So now we have [ code ], [ codebox ] , [ bbcode ] and [ monkeycode ]: [ code ] If x = 1 Then y = 10 [ codebox ] [ bbcode ] [bbcode]If x = 1 Then y = 10[/bbcode] [ bbcodebox ] ' test [bbcodebox]If x = 1 Then y = 10[/bbcodebox] [ monkeycode ] [monkeycode]If x = 1 Then y = 10[/monkeycode] [ monkeycodebox ] ' test [monkeycodebox ]If x = 1 Then y = 10[/monkeycodebox] Thats cool :) But wouldnt it be better just to replace the code for [ code ] to run [ monkeycode ] by default? |
| ||
Change [ bbcode ] to something like [ blitzcode ] or similar, so it's not confused with bbcode from other forum software. |
| ||
Here is an example with longer lines of code, clipped from http://monkeycoder.co.nz/Community/posts.php?topic=2632 Notice the "word wrap", as if this were a text document. I don't think code should do that. [monkeycode] Method UpdatePosition() 'update position / rotation by velocity Self.x = Self.x + ( Self.vx * DeltaTimer.delta ) Self.y = Self.y + ( Self.vy * DeltaTimer.delta ) Self.a = Self.a + ( Self.va * DeltaTimer.delta ) 'wrap position using size of asteroid to eliminate jumping If Self.x > DeviceWidth() + Self.radius Then Self.x = Self.x - ( DeviceWidth() + ( Self.radius * 2.0 )) If Self.y > DeviceHeight() + Self.radius Then Self.y = Self.y - ( DeviceHeight() + ( Self.radius * 2.0 )) If Self.x < 0 - Self.radius Then Self.x = Self.x + ( DeviceWidth() + ( Self.radius * 2.0 )) If Self.y < 0 - Self.radius Then Self.y = Self.y + ( DeviceHeight() + ( Self.radius * 2.0 )) End Method [/monkeycode] |
| ||
that should be fixable, but it will either explode the forum width to accommodate the extra length, or it will hide the overlap and people will not be able to see some of the code. The other option is to embed the code in an iframe, and allow it 100% width, then setting the iframe to allow scroll bars. all in all its fixable, but not a big issue. |
| ||
You don't have to use an iframe for that. Just set the code container to have white-space:nowrap and overflow:scroll. Two lines of CSS. |
| ||
@Taiphoz Could you share the monkey file for geshi, I would like to use it on my blog. |
| ||
more than happy to help out, and yeah its really nice when you show code on your own blog to have it look nice. http://dev.cruel-gaming.com/2012/05/24/geshi-monkey/ |
| ||
Currently trying to find my blitz max file but cant :( gona have to make it again.. |
| ||
Thank you. |
| ||
Great addition, but why are the old [code] and [codebox] tags not changed? I vote for that :) |