I did something like that using WordStar years ago, to make help files of pages 
that fit on 24 x 80 screens.  I also used database reports with markup around 
the fields that turned the text into RTF when I printed the text to disk.  Here 
are some observations that may give you some ideas:

 1. The hard part is the 300-word chunks.  If you really mean exactly 300 words 
(and not the average writing assumption of the space that 300 5-character words 
take), you need to process the text file in some sort of program that inserts 
separators of some kind every 300 words.

 2. If you mean 300 words on the average, what is considered an average amount 
of text on a page in a paper, you can set up the document to have pages that 
fit 300 words of text on the average.  Just fiddle with the margins until the 
right amount is on a page after you load up the text as a document.

 3 Then you can experiment with the File | Send > Create HTML Document to see 
if it will make a set of web pages for you.  My experience is that the 
converter for this is very flaky, but it might work for the text you have if it 
is simple.

 4. Another solution is to get the page size to where it holds 300 words of 
text and then save it as text (not text encoding, which you can try, but just 
.text).

 5. Then to make separators, you can create page headings and footer that 
insert something like the literal characters "<p>" at the top of the page and 
"</p>" at the bottom of the page. (Pray that the Save As ... .text keeps 
headers and footers.) 

 6. Rename as .html and look at it in your browser.  Most of the extra white 
space will go away and you'll have those blocks of words as HTML paragraphs.  
You might be able to load the .html into LibreOffice Writer and resave it as 
HTML to clean it up.

(Warning: If your text has "&", "<", and ">" characters in it, you'll have to 
do more to prevent them appearing in the HTML in a way that has them be 
mistaken as markup and treated incorrectly.)

 - Dennis



-----Original Message-----
From: Eric S. Johansson [mailto:[email protected]] 
Sent: Saturday, June 11, 2011 17:43
To: [email protected]
Subject: [libreoffice-users] specialized HTML generation

does anybody have an idea if I can use libreoffice to convert and "ordinary 
document" into 300 word chunks, each chunk in its own HTML page or, preferably, 
HTML fragment.

--- eric


-- 
Unsubscribe instructions: E-mail to [email protected]
In case of problems unsubscribing, write to [email protected]
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to