View Single Post
Old 10-07-2011, 04:53 AM   #42
Noughty
Addict
Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.Noughty is cognizant of many things which escape those who dream only by night.
 
Posts: 352
Karma: 103850
Join Date: Apr 2011
Device: Kindle NT
Quote:
Originally Posted by Katelyn View Post
Here is part of a walk-through I posted at a fanfic site I use all the time. I've gotten many responses that it was easy to follow and better yet, it works! Feel free to PM me if you have any questions.

--------------------------------
In order to convert a collection of HTML files in a specific order, you have to create a table of contents file. That is, an HTML file that contains links to all the other files in the desired order. Such a file looks like:

<html>
<body>
<h3>Table of Contents</h3>
<p style="text-indent:0pt">
<a href="./samplepage1.html">Part One</a><br/>
<a href="./samplepage2.html">Part Two</a><br/>
<a href="./samplepage3.html">Part Three</a><br/>
<a href="./samplepage4.html">Part Four</a><br/>
<a href="./samplepage5.html">Part Five</a><br/>
</p>
</body>
</html>

2. Copy the text above and paste it into Notepad. Save this file as book.txt in the same folder as the downloaded HTML files. Keep this file open for now.

3. Open the folder where the HTML files were saved and locate the files. Copy the first file name, (e.g.,newbook1.html). Go back to the Notpad file file you just created and replace the first line of HTML.

EXAMPLE:
You are changing this <a href="./samplepage1.html">Part One</a><br/>
To (for example) <a href="./newbook1.html">Part One</a><br/>


As you can see, only part of the file name needs to change since the rest of the code remains the same. It saves a lot of typing if you just change the file name up to the page number, e.g., copy newbook and paste it before the pages number on each line - samplepage1.html, samplepage2.html, etc.. Obviously, you have to be sure the naming convention is consistent for each page.

In case this confuses you, here is what I would use to create a single book from As You Wish (10 HTML pages long)

<html>
<body>
<h1>Table of Contents</h1>
<p style="text-indent:0pt">
<a href="./kimpritekel_asyouwish1.html">Part 1</a><br>
<a href="./kimpritekel_asyouwish2.html">Part 2</a><br>
<a href="./kimpritekel_asyouwish3.html">Part 3</a><br>
<a href="./kimpritekel_asyouwish4.html">Part 4</a><br>
<a href="./kimpritekel_asyouwish5.html">Part 5</a><br>
<a href="./kimpritekel_asyouwish6.html">Part 6</a><br>
<a href="./kimpritekel_asyouwish7.html">Part 7</a><br>
<a href="./kimpritekel_asyouwish8.html">Part 8</a><br>
<a href="./kimpritekel_asyouwish9.html">Part 9</a><br>
<a href="./kimpritekel_asyouwish10.html">Part 10</a><br>
</p>
</body>
</html>

3. Once these changes are completed, save the Notepad file with the name of the story into the SAME FOLDER as the downloaded files. Locate this saved file and change the .TXT extension to .HTML. You will get a pop-up warning that changing the extension may make the file unusable. Answer YES you want to change it.

Now, you’ll want to check the file to confirm the formatting is correct. (If you followed the steps above, it should work!)

4. Double click the newly created HTML file and it will open in a Web page. You should see something line this -

Table of Contents
Part 1
Part 2
Part 3
etc.

Only “Table of Contents” should be plain text and Part 1, Part 2, etc. will be hyperlinks. If the hyperlinks don't work, check and edit your formatting. Just change the .HTML back to .TXT and open the file again. Check the specific line of code that looks suspect for any errors. It can be as simple as the first HTML page was named 01 and you forgot to add the 0 (samplepage01.html VS samplepage1.html)

Once you think the file is ready, remember to have it in HTML format before moving it to Calibre.

5. Open Calibre and connect your reading device to your PC via a USB cable. It will be recognized by Calibre and will become visible in the Library window.

6. Add the HTML file (drag or use the Add button). When the file is added to Calibre, it is converted into a zipped file.

You can now convert the file to the format of your choice.
Thank you for such detail instructions as even I managed to fix html files in correct order
Noughty is offline   Reply With Quote