Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-06-2012, 07:20 AM   PM User | #1
pnielsen
New Coder

 
Join Date: Apr 2012
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts
pnielsen is an unknown quantity at this point
Auto insertion of <p> tags in text file

I am cutting and pasting a long Word doc into Coffee Cup. The doc. file has paragraphs indicated only by an indentation on the first line. There is no double return (white space) between adjacent paragraphs.

In Coffee Cup, even though the indent is lost, paragraphs can still be determined based upon the unequal length of the last line in one paragraph and the first line in the next.

Is there anyway this, or another method, can be used to "auto-insert" <p> </p> tags; eg. not having to enter hundreds (thousands) manually for an entire book?
pnielsen is offline   Reply With Quote
Old 11-06-2012, 07:57 AM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello pnielsen,
I don't have Coffee Cup but DreamWeaver will do it automatically easy enough. Just paste your text into the Design View window and it puts paragraph tags where they need to go.
I just tried and it's actually pretty good at it. I thought it was adding an extra <br> but the document I was copy/pasting had an extra space between each paragraph so DW even sees empty line breaks.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 11-06-2012, 09:39 PM   PM User | #3
pnielsen
New Coder

 
Join Date: Apr 2012
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts
pnielsen is an unknown quantity at this point
I also have Dreamweaver, and yes there is a menu import option to retain formatting from MS Word. However, I heard some Dreamweaver HTML tags are not recognized by eBook readers. Should be OK for just text blocks though.

Unfortunately, in my DW installation the "import from Word" option is greyed out. Will need to check out why. Maybe because Word is not installed on this computer(?)

However ... I just tried a cut-and-paste as you suggested, but with an RTF. Looks good. Maybe it would be better for this purpose to simply re-save the Word document as RTF anyway(?)
pnielsen is offline   Reply With Quote
Old 11-06-2012, 10:11 PM   PM User | #4
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
It wasn't that complicated when I did it. I just opened a new .html document, pasted into Design View, went to code view there's paragraphs formated with <p> tags.

I have not tried the import from word button yet...


edit// -- File/Import/Word Document... becomes available when you goto Design View. It is grayed out in Code View where it is not available. It does just as good a job as pasting into design view.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

Last edited by Excavator; 11-06-2012 at 10:25 PM.. Reason: tried importing a word doc
Excavator is offline   Reply With Quote
Users who have thanked Excavator for this post:
pnielsen (11-07-2012)
Old 11-07-2012, 08:30 PM   PM User | #5
pnielsen
New Coder

 
Join Date: Apr 2012
Posts: 13
Thanks: 3
Thanked 0 Times in 0 Posts
pnielsen is an unknown quantity at this point
When I try that with an RTF save from Word, there are <p> tags at the beginning of each paragraph, but <br>'s at the end. Then it is a simple matter to find/replace the latter, and reinsert any required <br>'s since there are far fewer of them ... or just work around them section by section. It also seems RTF carries through less of the Word coding.

My Word import button in DW CS5 is grayed in both views. Don't know why.

Thanks for your help in resolving this problem. Will save alot of time.
pnielsen is offline   Reply With Quote
Old 11-07-2012, 10:44 PM   PM User | #6
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Quote:
Originally Posted by pnielsen View Post
Will save alot of time.
I can imagine!
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:29 AM.


Advertisement
Log in to turn off these ads.