This commit is contained in:
Kovid Goyal 2014-07-05 08:05:25 +05:30
parent 22b08349ba
commit 14dc446536

38
manual/polish.rst Normal file
View File

@ -0,0 +1,38 @@
.. include:: global.rst
.. _polish_api:
API Documentation for the ebook editing tools
===============================================
The ebook editing tools consist of a
:class:`calibre.ebooks.oeb.polish.container.Container` object that represents a
book as a collection of HTML + resource files, and various tools that can be
used to perform operations on the container. All the tools are in the form of
module level functions in the various ``calibre.ebooks.oeb.polish.*`` modules.
.. module:: calibre.ebooks.oeb.polish.container
:synopsis: The container object used to represent a book as a collection of its constituent HTML files.
You obtain a container object for a book at a path like this::
from calibre.ebooks.oeb.polish.container import get_container
container = get_container('Path to book file', tweak_mode=True)
If you are writing a plugin for the ebook editor, you get the current container
for the book being edited like this::
from calibre.gui2.tweak_book import current_container
container = current_container()
if container is None:
# No book has been opened yet
The Container object
----------------------
.. autoclass:: Container
:members: