Log in

View Full Version : html converter besides MS word?



chopficaro
04-14-2010, 11:22 PM
ive got a resume web site and i want to let my viewers click on a link to a particular code sample of mine to read. ive got .as files, .cpp files, .h files, .js files, ,php files, u name it, but they're all just text. now i tried just linking the user to the unaltered file and that was buggy, and i also tried pasting the code into MS word and saving it as an html file, but that was buggy too, they couldn't get the indents right. is there some software out there that converts text files into readable html with all the indenting done correctly?

BLiZZaRD
04-14-2010, 11:36 PM
There are tools out there that will convert code to HTML and vice versa, but none that I have ever seen that will do all of them. You will have to look up each individual one and do the conversions, then find the next one, and so on.

Unless someone else has seen an all in one converter.

here is a list (http://www.w3.org/Tools/html2things.html) to help get some started

djr33
04-15-2010, 02:43 AM
If you are just trying to format text from a text file into html code, there's very little that you need to convert. Basically line breaks and paragraphs. In order to get tabs to work, though, that's harder. Tabs in html are ignored, so you need to insert   (a non-breaking space-- a space that acts like a 'content' letter in a word) repeatedly, such as 5 times in a row:      .
That's a VERY VERY messy way to do it, so I don't really recommend it. The better way is to use CSS formatting to set an indent for the paragraphs (as the style). But that's a little more complex-- I'm not sure if you want to get into all that quite yet. But you can, and it's a good idea.


If you want an easy cut and paste method for this, then find any WYSIWYG editor (what you see is what you get). Examples include Dreamweaver, Frontpage, etc. And there are lots of free ones out there. Basically open it up in design mode (or 'preview' mode) and NOT 'code' mode/view. Then just paste your text and it'll format it. Save the .htm and you're done.


There are also ways to do this dynamically with PHP (and other languages) if you'd like an automated system, but of course that's much more complex.

BLiZZaRD
04-15-2010, 02:49 AM
That works for the HTML Daniel, but the OP said they have multiple formats. The way I read it they want to take a page that is currently written in PHP, one in AS, one in JS, one in CSS, etc and convert all of them to HTML keeping the original formatting, so someone can view the HTML, copy and paste and save as extension "whatever", and have it be formatted with line breaks and spacing, etc already done.

I could have read it wrong though.

djr33
04-15-2010, 03:18 AM
All of the formats are .txt "plain text" files essentially. If the idea is to DISPLAY the source code within html, it should be the same process. If not, then I read the question wrong too.

chopficaro
04-15-2010, 04:42 AM
thanks, ill try dreamweaver