PDA

Click to See Complete Forum and Search --> : [RESOLVED] VB.net Code to coloured html?


dethredic
Mar 17th, 2010, 10:50 AM
I did some googleing but couldn't find anything. I am wondering if there is a program or site that will allow me to paste in code / choose a file, and it will convert it to nice looking, colored html.

weirddemon
Mar 17th, 2010, 10:54 AM
Well, if there is, a VB .NET forum isn't the proper place to ask about HTML questions. But, this question seems more like a general question than coding.

dethredic
Mar 17th, 2010, 11:04 AM
I figured someone might have written something in vb.net. who knows.

weirddemon
Mar 17th, 2010, 11:24 AM
I figured someone might have written something in vb.net. who knows.

Well... they might have... but you're not attempting to create the app and you're not asking for help on how to. No worries though. I've alerted the mods and hopefully they'll move it to the appropriate section soon.

si_the_geek
Mar 17th, 2010, 11:56 AM
Thread moved to 'General Developer' forum.

(thanks for letting us know weirddemon :thumb: )

dethredic
Mar 18th, 2010, 09:36 AM
thanks si.

I would really think this should be easier to find.

DeanMc
Mar 20th, 2010, 07:31 PM
Ive seen a few of them but they tend to be a bit brutal and the ones that are not tend to be proprietary to whatever site is using them. Highlighter's arent hard to make, just tedious, they are automated so require a large amount of testing. If your interested there is a highlighter here: www.xlight.mendhak.com with a link to its code base.

gep13
Mar 21st, 2010, 11:18 AM
Hey,

If you are talking specifically about taking code from your IDE and making that into HTML to paste somewhere, then have a look at this Visual Studio Addin:

http://copysourceashtml.codeplex.com/

It does exactly what it says on the tin. Takes the code, and copies it as HTML, as well as giving you options to exactly what you want to copy.

Hope that helps!

Gary

dethredic
Mar 22nd, 2010, 08:22 AM
Thanks grep13, but I can't figure out how to make it work. I installed it then opened up visual studios but I couldn't find options for it anywhere. I also couldn't find any addin manager.

It just seems to copy a .addin and a .dll to some programs files folder. Opening the .addin just shows some trivial code.

gep13
Mar 22nd, 2010, 09:23 AM
Hey,

Once installed, simply select the code that you want, right click on it, and select Copy As Html...

If this doesn't work, can you tell us what edition of Visual Studio you are using?

Gary

dethredic
Mar 22nd, 2010, 09:54 AM
There is no Copy As Html option.

I have Microsoft Visual Basic 2008 Express Edition.

gep13
Mar 22nd, 2010, 10:08 AM
Ah, I think that might be your problem...

I don't think it supports the Express Editions, sorry!

Gary

dethredic
Mar 22nd, 2010, 10:21 AM
darn, thanks anyways.

gep13
Mar 22nd, 2010, 10:51 AM
If you do ever get a higher version of Visual Studio you should give it a try.

As a work around, you might want to try the following:

http://blogs.msdn.com/brada/archive/2004/10/05/238427.aspx

Gary

dethredic
Mar 23rd, 2010, 08:46 AM
well that works great until I put it in <pre> tags. Ohh well.

gep13
Mar 23rd, 2010, 09:15 AM
Hey,

I'm confused, where are you putting <pre> tags?

Gary

dethredic
Mar 23rd, 2010, 09:34 AM
Maybe I should explain better. I pasted the code into word, then saved as a .htm file. This works fine, but it is super long and complex with tons of redundancy (to be expected from an auto generated file).

What I do for my site is have my code in 1 file, then use php to include it in another, and wrap that in <pre> tags so it looks nice and keeps the indenting.

Word exported it in such a way that it didn't need <pre> tags to do the indentations, so adding them just messed it up. I simply just made a new div with the same style as my <pre> tags and now it seems to be working just fine.

gep13
Mar 23rd, 2010, 10:00 AM
Ah, I see what you are getting at.

Yes, you will get lot's of additional inline styles, div's and p tags, to get the required formatting, it isn't pretty, but it works.

Sounds like you have got a workaround in place, glad to hear it!!

Gary