Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 04-27-2023, 09:40 PM   #1
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,969
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
txt > epub conversion question

I had this problem before:
https://www.mobileread.com/forums/sh...d.php?t=348081

I have some saved walkthroughs from GameFAQs and Neoseeker and other sites. Here's a few examples: [1] [2] [3].

These often have ASCII art and specific fixed-width alignment which causes them to misbehave if I open them directly in ebook-viewer.

If I convert them to ePub, the fixed-width alignment also tends to get messed up (I've tried different paragraph & formatting styles but had no luck).

So instead, here's what I do:

1. Convert to ePub. (Unlike 'add an empty file,' this generates structure and OPF data.) Open in ebook-editor.

2. Replace this to stylesheet.css:
Code:
pre {
   font-family: "courier new", courier, monospace;
   font-size: 10px;
   white-space: pre-wrap;
3. Go to index.html. Remove everything from between the body tags. Replace it with this:
Code:
  <body>
    <pre>
[the text copied from the original .txt]
    </pre>
  </body>
It ends up looking as expected, and I can use ebook-viewer's search:

Click image for larger version

Name:	2023-04-27 22_47_07-Morrowind Scroll FAQ [EPUB] — E-book viewer.png
Views:	154
Size:	36.5 KB
ID:	201324

But this isn't really the proper way and I can't do things like add a ToC. Does anybody else have a suggestion of what to do?


Last edited by ownedbycats; 04-27-2023 at 09:53 PM.
ownedbycats is offline   Reply With Quote
Old 04-28-2023, 06:15 AM   #2
Martinoptic
Bibliophist
Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.Martinoptic ought to be getting tired of karma fortunes by now.
 
Martinoptic's Avatar
 
Posts: 7,003
Karma: 7173892
Join Date: Dec 2021
Location: England
Device: none
Have you tried txt>docx>epub with appropriate headings in docx to generate TOC?
Martinoptic is offline   Reply With Quote
Advert
Old 04-28-2023, 06:33 AM   #3
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,969
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
That's not what I meant. I wanted to manually create the ToC, but since there isn't any proper line breaks with my method, it doesn't know where to put them.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Txt->EPUB Conversion Issue nrich61 Conversion 7 07-07-2011 06:03 PM
TXT to EPUB conversion issue rockeh Conversion 2 03-18-2011 10:50 AM
Preserving <br /> on epub -> txt conversion billingd Calibre 1 08-11-2010 06:24 AM
Conversion: EPUB to TXT Starson17 Calibre 11 05-29-2010 12:31 PM
Newbie Question re txt File Conversion GJN Calibre 7 09-04-2009 07:40 AM


All times are GMT -4. The time now is 03:53 AM.


MobileRead.com is a privately owned, operated and funded community.