Apple2.gs Forums
Discussions for Apple IIgs Programming and other fun stuff. // Infinitum!

Home » Other » Site Stuff » Online Code Formatter (Please use when posting code snippets on the forum.)
Online Code Formatter [message #49] Wed, 08 October 2014 09:06 Go to next message
Dagen is currently offline  Dagen
Messages: 27
Registered: August 2014
Location: United States
Member

Ok, I may have had a great idea! I noticed that someone posted some nicely formatted source on a forum and I wanted to do the same, but I realized I needed to run it through a formatter first and *THEN* I thought, "Why don't I take the best formatter around and host it online?"

Here's what I came up with after a few beers last night.
http://apple2.gs/cadiusformatter.php

Please try to use this, along with the
[code][/code]
block when posting source code on the forum.

Paste your messy source code in there and try it out. It expects Merlin-style source.

PS- NOT affiliated or authorized by the original CADIUS authors, but I hope they are cool with the idea... I just really really like their tools!

PPS - This won't help with facebook/csa2 posting because they suck and don't have formatting like <pre> blocks. That's why this forum exists. ;)
Re: Online Code Formatter [message #51 is a reply to message #49] Wed, 08 October 2014 09:50 Go to previous messageGo to next message
Oz is currently offline  Oz
Messages: 21
Registered: October 2014
Location: France
Member

Few remarks :

- When you cut / past Text in your Original Source Window, the text having some Quotes ' ' are translated with backslash : \'. And we find them too in the formatted Source windows
- You should add a Clear button to erase the Original Source Window content.

Olivier
Re: Online Code Formatter [message #53 is a reply to message #51] Wed, 08 October 2014 12:50 Go to previous message
Dagen is currently offline  Dagen
Messages: 27
Registered: August 2014
Location: United States
Member

Thank you! I have fixed the quotes and added a "Clear" button. I apologize for not testing more before releasing.

I also made it so that when you scroll the left window, the right window scrolls in sync, so you can more easily compare the input<->output. If this is annoying, let me know. I can disable it or make it an optional checkbox or something.
Previous Topic: Mods Needed
Next Topic: Issues reading the Forum on Windows using Chrome
Goto Forum:
  


Current Time: Wed Feb 05 11:52:53 MST 2025

Total time taken to generate the page: 0.00949 seconds