Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




How to post clean code snippet ?

web-app

Hey,

I found myself today with a tiny problem. I wanted to post some sourcecode into an issue (C# code if this is an important information). But i can´t post it in a good form.

I found the "code snippet" button but i can´t use it. The only thing I see is a blank block :

http://img1.abload.de/img/picd3of.jpg

Thanks again, as usual :D

 

Jabba
· 1
Jabba
Replies (3)
helpful
0
not helpful

Code snippets are used to insert pre-defined templates, see: http://www.telerik.com/help/aspnet-ajax/codesnippets.html


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

The way I do this is to use BBEdit, which can copy syntax-colored code to the Clipboard as RTF or HTML, either of which can then be pasted into the Gem editor (the latter using the HTML view). Further, I created a simple service that that handles all this automatically and virtually instantly - just select the code, right-click, and select the service in the context menu. Works for a wide variety of languages, too.

I'm doing all this on a Mac. If you're on a Linux or Windows machine, which I'm guessing is the case since you're writing in C#, you'll need to find different software that does the same thing. Does VS have an option to copy as formatted text? If not, I'd guess you can do it with a decent text editor like Notepad++, TextPad, or UltraEdit. (This is how I'm using BBEdit, since my IDE does not have a copy-as-formatted option.) I have no idea how to do the automation part, though... maybe PowerShell? Though, doing it manually isn't a killer if you're not doing it all the time.


bobw
· 1
bobw
helpful
0
not helpful

Use "Paste as plain text". A popup window appears, paste. Now your lines won't be wrapped.

Next switch to HTML view and wrap the entire block of code in [tt]...[/tt] tags (except use angle brackets, which I can't type here!) to get it displayed in fixed point type.


Bob Denny
· 1
Bob Denny