0

I've been searching google for a while to determine the most coder-friendly example boxes.

I'm wanting to share varying forms of ECMA script (JS for example) etc that provides the user with color coding and a simple way of copying the code. I know there are several out there, but I wanted to get some opinions from SOF since you guys probably have good experience with code.

so- What's the code-sharing tool you [would] use?

the solution

I ended up using Gist for complete snippets and am using Syntax Highlighter for *incomplete * code samples. There's a Drupal plugin for the Syntax Highlighter, but I dare say it's more of a pain to figure out the plugin than it is to just do things the old fashioned way (old fashioned being like 5 years ago..)

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284

2 Answers2

2

I use http://jsfiddle.net/

Color coding — check
HTML, CSS, JS — check
Live demo — check

ayanami
  • 1,588
  • 13
  • 20
  • I really like JS fiddle for testing, and I'm looking for something very similar as far as the features are concerned. However, I would only want the users to be able to view or fork. Is there a way to have the actual code appear on my site or would I only be able to display a link for them? – Jacksonkr Sep 18 '11 at 15:17
  • Well, I’m afraid unless you’re willing to build some embedding middleware — no, you cannot embed jsfiddle, only link to it. But it’s pretty useful anyway, IMO. – ayanami Sep 19 '11 at 19:33
1

gist has syntax highlighting and users can download the files separately, as a zip archive or using git. You can embed the files easily on other sites.

Additionally, the site tracks changes and other users can add comments or fork a gist to change it themselves.

Luchs
  • 1,133
  • 1
  • 9
  • 10
  • That's cool. I didn't know github had a version of this so +1. I'm more so looking for a stand-alone version that only displays code on my site as examples. Perhaps with a "copy to clipboard" functionality? Can this do that? If not, have you seen anything like this that you like? – Jacksonkr Sep 18 '11 at 15:18
  • @Jackson gist is embeddable into your site. – ayanami Sep 19 '11 at 19:31
  • How can a user download a gist as a zip? With the download button I only get a .tar.gz file which is hard to unzip even in Linux and without additional software impossible for windows users. – 2ndkauboy Aug 01 '13 at 16:56