Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
287 views
in Technique[技术] by (71.8m points)

instapaper - Kindle periodical format

Not much can be found on the subject of creating eBooks in kindle/mobipocket. Much less is to be found about periodical format - i.e. the format in which Newspapers are published on Amazon. Yet the instapaper.com can do that and now are local www.idnes.cz do that also. How the hack can they do that?

(Periodical format of azw. is probably some extenstion of mobipocket format - but I'm looking for exact way to create such publication - with sections and articles exactly as for example The New York Times have)

question from:https://stackoverflow.com/questions/5379565/kindle-periodical-format

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have been struggling with this as well - I hope someone else will come along to explain everything! I've been generating a daily edition of the Guardian for the Kindle, and haven't found any documentation about how to do this properly as a periodical.

However, I'll explain what I understand about this so far - we can now generate files that work on the Kindle as periodicals using kindlegen from a .opf and .ncx file. However, the results aren't quite perfect yet, namely in that I don't know how to add a masthead to the sections and articles page. Update: thanks to the tip from Marco in the comments, this works now, at least with Kindlegen 1.1 - later versions may not work. I've updated the example files below to include a masthead image.

  • Documentation for the .opf and .ncx files can be found here but these only explain how to generate books, not periodicals.

  • Presumably you can get documentation from Amazon via registering with them to publish a newspaper, but that has to be approved by them, and in my case in my case I don't meet the terms and conditions. (While I'm allowed to use the data from the Guardian API, I don't own it.)

  • Calibre generates documents in periodical format, but by directly generating the .mobi / .azw file rather than going through a .opf and .ncx. I believe that was done by reverse engineering the binary format. Calibre is open source, so you could use that code to generate a periodical.

  • There is a hint in the Calibre source code that your top level navPoint should have class="periodical" and indeed that seems to cause kindlegen to make a book that's presented as a periodical.

  • As well as discovering that previous breakthrough, oldmanuk worked out how to get the author names and summaries into the article list, which boils down to adding these elements under each article's navPoint:

          <mbp:meta name="description">A summary of this article here</mbp:meta>
          <mbp:meta name="author">The list of authors here</mbp:meta>
    

In case this is of use, I've put a pair of example files here:

... and the source code for the project is here:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...