OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[SOLVED] Pasting C++ code snippets into HTML.

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
OOLaw
Newbie
Newbie


Joined: 23 May 2009
Posts: 3
Location: Canada

PostPosted: Sat May 23, 2009 4:27 pm    Post subject: [SOLVED] Pasting C++ code snippets into HTML. Reply with quote

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
View user's profile Send private message
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Sun May 24, 2009 12:14 am    Post subject: Reply with quote

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
View user's profile Send private message
OOLaw
Newbie
Newbie


Joined: 23 May 2009
Posts: 3
Location: Canada

PostPosted: Sun May 24, 2009 5:17 am    Post subject: Almost there...maybe! Reply with quote

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
View user's profile Send private message
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Sun May 24, 2009 5:48 am    Post subject: Reply with quote

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
View user's profile Send private message
OOLaw
Newbie
Newbie


Joined: 23 May 2009
Posts: 3
Location: Canada

PostPosted: Sun May 24, 2009 8:32 am    Post subject: Thanks! Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group