Topic: Pre-formated text (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=9645" title="Pages that link to Topic: Pre-formated text (Page 1 of 1)" rel="nofollow" >Topic: Pre-formated text <span class="small">(Page 1 of 1)</span>\

 
crip
Nervous Wreck (II) Inmate

From: iasi, romania
Insane since: Apr 2002

posted posted 05-25-2003 13:02

Hi...
I'm trying to take the content of a .doc written in word and put it in an html document. How can I do that so that the final html looks exactly like the doc?
If i use the <pre> tag it does preserve the pre-format of the pasted text, but it only starts a new line where there is an explicit new line (enter key pressed at that time) in the .doc. So i'm stuck with a html document that you have to horizontally scroll for about a meter or so because i have only 4 or 5 explicit new lines, the rest are the ones that result from typing just untill the end of the line, when the editor moves the cursor by itself to a new line...
Is there any way to do this because i have about 20 of the documents and writting them again inside the content of the html page would be a real pain in the a**
Thanks

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 05-25-2003 16:32

Should be easy enough to simply wrap each paragraph in paragraph tags <p></p>...



Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 05-25-2003 20:53

If you've still got access to MS Word, you can do a find-and-replace like this:

I'm assuming you've hit Enter twice after each paragraph. This is bad from a desktop-publishing perspective, but it's the most common practice.

So to insert paragraph tags where you need them, search for "^p^p" and replace it with "</p>^p<p>" (no quotes on either of those, obviously). Then, just give the document the once-over, looking for stray <p> tags, and you should be good to go.

crip
Nervous Wreck (II) Inmate

From: iasi, romania
Insane since: Apr 2002

posted posted 05-25-2003 21:04

yeap, now that you two say it it seems the obvious, but i have a feeling that i've hit enter a few times aside from the times where i've hit enter just for starting a new paragraph. I mean that i've not used enter very smart, sometimes i let word start a new line, sometimes i did it myself, and not only for starting a new paragraph. (I guess that's another way of bad publishing
And thinking of it, i guess in the end it either re-typoing the whole thing or manually formating it in html, i eman more that a couple of <p> tags.


Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 05-25-2003 23:00

There's no completely clean way of going from word-processor italics to HTML <i> tags. I'd love to see a program that would take simple RTF text and convert it to valid XHTML, adding nothing but <p>, <em>, <strong>, and <br /> tags. Every major word processor has some "save as HTML" option, and they always add a ton of cruft in the form of CSS, <span>s, or (god help us) <font> tags. I've got some perl scripts to take OpenOffice's HTML output and strip it of everything I dislike, but that's using a chainsaw where I need an X-acto knife. Anyone got a suggestion?

crip
Nervous Wreck (II) Inmate

From: iasi, romania
Insane since: Apr 2002

posted posted 05-27-2003 07:16

Well, after discussing this with a friend the same idea came to him and it haunted me ever since why didn't i thought of it The Save As Web Page option in word dit it for me. And than it was only a matter of copy and paste the code into my desired html.
But... I've used Word 97 and this version adds no css or other form strange code. At least it didn't for me. But I remembered that using word 2000 once for something similar resulted in that. So...My problem is solved, i don't know about PT's.

Gilbert Nolander
Maniac (V) Inmate

From: Washington DC
Insane since: May 2002

posted posted 05-31-2003 05:28

Hum..
Never even thought about this. You would think I have, since I only use Word 98 like everyday to write stuff. And here, I never even thought of this. Well, sometimes its the easiest solution to a problem that solves it.


.quotes.

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 05-31-2003 07:40

I type my journal entries for my web site in Word, but I type in <em> and <strong> tags rather than using the italics and bold faces. Then I run a formatting macro on the page that changes all the special characters to the appropriate HTML entities and inserts the appropriate <p> tags, etc. If you're going to be writing your content in Word and then moving it over to your site, you might want to look into making a similar macro.





www.liminality.org

crip
Nervous Wreck (II) Inmate

From: iasi, romania
Insane since: Apr 2002

posted posted 05-31-2003 09:28

I don't know much about macros but i think it's something you could post or put for download somewhere...
Could you do that please, it would help me a lot for this kind of work, large texts to put online.
Thanks in advance...

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 05-31-2003 16:11

OK. I don't have time to put it up right now (got to get to bed), but I'll try to get to it tomorrow afternoon if possible. Like PT said, there's no neat way to convert italics and bold to <em> and <strong> tags, so keep that in mind when you're writing the content (in other words, just type the tags in Word).

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 06-03-2003 05:37

Sorry about the delay, crip. I got caught up in some work over the weekend and I forgot all about the macro. Now that I've remembered it, though, I can't seem to find where it is on my hard drive so I can upload. If I can't figure it out I suppose I can upload the source code for the macro, and then you can paste that into Word's VB editor. That might get a little complicated, though. I'll keep looking.

Come to think of it, even if I find it, I'm not sure how you import macros in Word, or even if you can (I imagine you must be able to)... let me do some more checking.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu