|06-28-2010, 12:09 PM||#1|
Join Date: Jun 2010
Device: Moto Droid
How do i generate TOC from a plain txt file that has no markup, or HTML, but only:
blahblahblah.Or should I just figure out a sed regex to add <h1> or whatever tags before I run it thru Calibre?
|06-28-2010, 12:54 PM||#2|
Join Date: Sep 2009
Device: Sony PRS-350, Kobo Glo/AuraHD/Aura6"/AuraH2O/GloHD
Edit your .TXT file's headings using markdown like so:-
# My Book Title # My Book's Author ///Table of Contents/// ## CHAPTER 1 ... blah blah blah ... ## CHAPTER 2 ... blah blah blah ...
The ///Table of Contents/// line should be placed where you want the internal TOC to be.
When you're done editing, convert the TXT file, but make sure you check the [Convert] - [TXT Input] - "Process using markdown" box.
You can read more about markdown here
|06-29-2010, 03:25 PM||#4|
Join Date: Jun 2010
However, I did find out the hard way that Markdown considers indenting to mean "wrap this in <code> tags"
I had been using tabs in my text file to mark paragraphs. When I used the markdown method to create a TOC, the entire book turned into monospaced non-broken lines.
Removing the tabs and adding blank lines between the paragraphs fixed the problem.
|07-09-2010, 02:43 AM||#5|
Join Date: Jul 2010
Device: PW2, Nexus7
This is not really a problem because Markdown is designed to work that way. It's described in the Markdown reference under [Code Blocks]. Starting a line with at least 4 spaces or 1 tab triggers a code block.
Incidentally, ending a line with 2 spaces triggers a hard line break, which can be useful.
Markdown is an excellent pre-processor for generating ebooks from plain text.
|07-15-2010, 07:16 PM||#6|
Join Date: May 2010
Location: LA, CA
Device: Kindle DX, Kindle 3 (Keyboard), Nexus 7 (2013)
|Thread Tools||Search this Thread|
|Thread||Thread Starter||Forum||Replies||Last Post|
|TOC question for JBL||Pranananda||Ectaco jetBook||1||06-22-2010 07:55 AM|
|6.0 TOC question||Amalthia||Calibre||3||07-30-2009 12:45 PM|
|New to Calibre... TOC question||ruchti||Calibre||10||06-08-2009 05:53 PM|
|BD TOC Question||Novasea||Workshop||5||10-27-2008 11:38 AM|
|toc question||zelda_pinwheel||IMP||4||01-18-2008 10:49 AM|