Creating a Library file w/Author, Title, Summary and tag info
Hi all,
My biggest complaint with my Sony reader is that there's no quick and easy way to view all my books and their meta info. What I was looking for was a fast glance kind of file that would be the equivalent of skimming over the backs of novels in a bookstore so my idea was to create a file with ALL my books, their summaries and their tags that would look like this:
Author - Title of Book
Summary of Book
*tags
This way, I can scroll through a whole listing of my library and see what I want to read next.
Here's what I did and hopefully it helps some of you:
1) Make sure you have all the appropriate summary info/metadata in your library
2) Run the "list" option from the command line interface and export to xml
3) Create an xslt stylesheet in any text editor (save this file as mystylesheet.xslt)
- Here's mine as an example:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="calibredb/record">
<h2 class = "chapter"><xsl:value-of select="authors"/> - <i><xsl:value-of select="title"/></i></h2>
<p><xsl:value-of select="comments"/></p>
<p><i><xsl:value-of select="tags"/></i></p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
4) Add the following line to the top of the xml file you created in step 2 (again, this can be done in any text editor):
<?xml-stylesheet type="text/xsl" href="file:///mydirectory/mystylesheet.xslt"?>
5) Open the xml file in any web browser and save it as an HTML file
6) Add the file to calibre and convert it to EPUB or whatever format your e-reader uses
NOTE: Don't forget to autogenerate the table of contents for ease of use!
7) Transfer the file to your e-reader and enjoy!
|