| View previous topic :: View next topic |
| Author |
Message |
OOLaw Newbie

Joined: 23 May 2009 Posts: 3 Location: Canada
|
Posted: Sat May 23, 2009 4:27 pm Post subject: [SOLVED] Pasting C++ code snippets into HTML. |
|
|
Hi everyone:
I'm really busy on a project that I'm taking seriously now. I'm witting a tutorial Involving C++ programming. My problem is that every time I paste my c++ code into my html document, the indenting goes weird. Different browsers are displaying the results differently, but it's all a big mess. I need the code to look right in the HTML and look right after my readers copy and paste it into their code editor.
I know very little about HTML. This is why I'm using OpenOffice's web writer (sweb.exe). So far it's been a pleasure to use.
Could someone please throw me a quick fix for this?
Thank-you very much.
Last edited by OOLaw on Sun May 24, 2009 8:33 am; edited 1 time in total |
|
| Back to top |
|
 |
floris_v Moderator


Joined: 12 Jul 2007 Posts: 4603 Location: Netherlands
|
Posted: Sun May 24, 2009 12:14 am Post subject: |
|
|
Try multiline input boxes for forms. That's probably the safest way to ensure that the special characters aren't converted to html coding. I don't know if it that input box respects tab characters, but you can try. Alternatively, you can save the different code parts in separate files or in one file and add a download link.
Also keep in mind that OOo isn't the best web editor around.
If your problem has been solved, please edit the first post of this thread (Edit button) and add [Solved] to the start of the subject line. _________________ LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum |
|
| Back to top |
|
 |
OOLaw Newbie

Joined: 23 May 2009 Posts: 3 Location: Canada
|
Posted: Sun May 24, 2009 5:17 am Post subject: Almost there...maybe! |
|
|
Thanks floris_v:
I was not able to make much sense of your advice, except that OpenOffice may not be the best choice for editing HTML!!!
However, I had a little success this morning by selecting my code snippet and changing the "Styles and Formating" to "Preformatted Text". Does this sound like a solution to you?
Also, someone told me to put my snippets inside a <div> tag. Is there a brainless way for me to accomplish this from within OO? Or an alternative?
Thanks! |
|
| Back to top |
|
 |
floris_v Moderator


Joined: 12 Jul 2007 Posts: 4603 Location: Netherlands
|
Posted: Sun May 24, 2009 5:48 am Post subject: |
|
|
I don't do any html coding in OOo, but I did some in the past. See here for a tutorial for text area form fields.
There are many free html editors about, Kompozer is recommended a lot in this forum. _________________ LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum |
|
| Back to top |
|
 |
OOLaw Newbie

Joined: 23 May 2009 Posts: 3 Location: Canada
|
Posted: Sun May 24, 2009 8:32 am Post subject: Thanks! |
|
|
Thnaks floris_v:
I was able to achieve an acceptable result by changing the paragraph to "Preformatted text" for my snippets.
I've started looking at Kompozer. It looks like it will make all my dreams come true.
Very happy now! Thank-you!. |
|
| Back to top |
|
 |
|