Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (482)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  beautify your shared code on the fly  (Read 2853 times)
0 Members and 1 Guest are viewing this topic.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Posted 2003-11-03 23:38:21 »

Not shared java code, but, I have made a PHP script which utilises regex to pretty-print Java source code on the fly.  Now if you want to show off your code in colour you can, and very easily.

Naturally, CSS is used for the colours - so changing them to suite your preferred style is simple.

http://showsrc.sourceforge.net/

The script is GPL'd.

Cheers,

Will.

Offline xbrain

Senior Newbie




Java games are the Future


« Reply #1 - Posted 2004-01-08 07:08:49 »

Nice, but what about putting your script online?

would be nice to acome on your website and to put source code in a text area, and then getting the html code in output in another text area  Wink

XBrain - Don't let others control your Mind...
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #2 - Posted 2004-02-09 01:29:50 »

good idea Smiley  I'll see what I can do

I have also added line numbers (optional) to the script which I'll release soon.

Will.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2004-02-09 09:26:26 »

ok - here it is:  http://showsrc.sourceforge.net/wshowsrc.php

Either upload a file, link to one (for some reason this doesn't work on SF) or paste it in.  Then you can simply view the HTML source of your output.

Will.

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #4 - Posted 2004-02-09 09:27:53 »

the new changes (line numbers and the "wshowsrc.php" online version) are in CVS - I'll make a release when I get the time.

Offline xbrain

Senior Newbie




Java games are the Future


« Reply #5 - Posted 2004-02-09 09:33:41 »

Nice Smiley

XBrain - Don't let others control your Mind...
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #6 - Posted 2004-02-10 06:59:26 »

Thanks.

stay tuned, got something even better coming Smiley

Will.

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #7 - Posted 2004-02-11 10:10:16 »

Ok, I've put the script on a server which doesn't mind downloading the file to display.  And for the hell of it, I got a domain as well Smiley

Check out: http://showsrc.com/ Smiley

I've also made it dead easy now to link to ones sources.  Lets say you want to provide someone the HTML version of the souce code which resides here: http://jtank.net/src/src/net/jtank/io/Ini.java .

Simply prepend "http://showsrc.com/$" to it (so that you get http://showsrc.com/$http://jtank.net/src/src/net/jtank/io/Ini.java) and bob's your uncle Smiley

Could it be any easier?  Of course this isn't a replacement for those who are showing a lot of source and will install a local version of the script, but for people with only a few sources to display it saves the hassle of uploading and configuring the script.

Cheers,

Will.

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #8 - Posted 2004-02-19 03:00:19 »

Updates:  The script now sports linkable line numbers Smiley

I'm releasing version 2.1 as soon as SF gets it's act together and fixes whatever current problem it is having with the DB.

Example:
http://showsrc.com/$http://jtank.net/src/src/net/jtank/io/Ini.java#120

Cheers,

Will.

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #9 - Posted 2004-02-19 03:12:07 »

Sweet.  If only we could get the {code} tags on this message board to format as well.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Java Cool Dude

Senior Member




Java forever


« Reply #10 - Posted 2004-02-19 04:13:58 »

Quote
Sweet.  If only we could get the {code} tags on this message board to format as well.

I'll second that
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #11 - Posted 2004-02-19 09:56:49 »

that'd be nice Smiley  Well it's open source, and really only uses regexp so technically quite possible, but we're probably just dreaming.

I've uploaded a zip and bz2 of the code now too btw:

Will.

Offline kevglass

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #12 - Posted 2004-04-12 18:45:02 »

Afraid I only just found an excuse to use this, its flippin ace! Really really useful! Nice work!

On the server I'm using the PHP version reports an error if the index referenced doesn't exist in an array so I had to add a couple of checks on whether the index "showlines" existed in the $_GET array, and default it didn't.

Even so, great! super! useful! brilliant!

Thanks William,

Kev

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #13 - Posted 2004-04-15 00:16:04 »

Kev,

glad you liked it Grin  thanks.

mind if you send me a .diff of your changes so I can incorporate them?

Cheers,

Will.

edit: typo

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!