cancel
Showing results for 
Search instead for 
Did you mean: 

Pretty Preview transformer for source code?

nickburch
Confirmed Champ
Confirmed Champ
Does anyone know of an examples of content transformers for giving pretty previews in Share for source code?

Currently, some source code types are recognised by Alfresco as plain text (eg Java files), and you get a basic Share preview via OpenOffice and PDF2SWF. Other source code types are correctly recognised by their real mime type (not just shoved into text/plain), but with the disadvantage that they're then not previewable in Share…

Are there any existing examples to crib off of using one of the source code highlighting / prettifying tools to produce nicely formatted + coloured previews of source code formats for Share? I'd like to avoid reinventing the wheel if possible!
2 REPLIES 2

wabson
Star Contributor
Star Contributor
Hi Nick, did you try the Share Extras add-on already? There is a screenshot on the wiki page, or check out trunk and try it out directly (a new release is coming in the next few days).

From http://code.google.com/p/share-extras/wiki/MediaViewers

<blockquote>Prettify allows formatted code, mark-up and other supported text formats to be displayed in directly in the document and uses <a href="https://code.google.com/p/google-code-prettify/">google-code-prettify<a/> to provide an in-line browser-based view with syntax highlighting.</blockquote>

I'd be interested in your feedback on this highlighting lib plus any MIME types you think may be missing.

Cheers,
Will

nickburch
Confirmed Champ
Confirmed Champ
Ah, I'd missed that in my google searching. Looks just what I needed, thanks, I'll give it a whirl shortly!