class EpubBuilder(StandaloneHTMLBuilder): (source)
Known subclasses: sphinx.builders.epub3.Epub3Builder
Builder that outputs epub files. It creates the metainfo files container.opf, toc.ncx, mimetype, and META-INF/container.xml. Afterwards, all necessary files are zipped to an epub file.
Method | add |
Add visible link targets for external links |
Method | build |
Write the metainfo file META-INF/container.xml. |
Method | build |
Write the metainfo file content.opf It contains bibliographic data, a file list and the spine (the reading order). |
Method | build |
Write the epub file. |
Method | build |
Write the metainfo file mimetype. |
Method | build |
Create the toc navigation structure. |
Method | build |
Write the metainfo file toc.ncx. |
Method | check |
Undocumented |
Method | content |
Create a dictionary with all metadata for the content.opf file properly escaped. |
Method | copy |
Undocumented |
Method | copy |
Copy image files to destination directory. This overwritten method can use Pillow to convert image files. |
Method | copy |
Copy images using Pillow, the Python Imaging Library. The method tries to read and write the files with Pillow, converting the format and resizing the image if necessary/possible. |
Method | create |
Undocumented |
Method | fix |
Return a href/id attribute with colons replaced by hyphens. |
Method | fix |
Fix href attributes for genindex pages. |
Method | fix |
Replace colons with hyphens in href and id attributes. |
Method | get |
Collect section titles, their depth in the toc and the refuri. |
Method | get |
Undocumented |
Method | get |
Get the total table of contents, containing the root_doc and pre and post files not managed by sphinx. |
Method | handle |
Create a rendered page. |
Method | init |
Load necessary templates and perform initialization. The default implementation does nothing. |
Method | is |
Does the filename extension indicate a vector graphic format? |
Method | make |
Return a unique id for name. |
Method | new |
Create a new entry in the toc from the node at given level. |
Method | toc |
Add the root_doc, pre and post files to a list of refnodes. |
Method | toc |
Create a dictionary with all metadata for the toc.ncx file properly escaped. |
Method | write |
Write one document file. |
Class Variable | add |
Undocumented |
Class Variable | allow |
Undocumented |
Class Variable | copysource |
Undocumented |
Class Variable | doctype |
Undocumented |
Class Variable | download |
Undocumented |
Class Variable | embedded |
Undocumented |
Class Variable | html |
Undocumented |
Class Variable | search |
Undocumented |
Class Variable | supported |
Undocumented |
Class Variable | supported |
Undocumented |
Class Variable | template |
Undocumented |
Instance Variable | files |
Undocumented |
Instance Variable | id |
Undocumented |
Instance Variable | ignored |
Undocumented |
Instance Variable | link |
Undocumented |
Instance Variable | out |
Undocumented |
Instance Variable | playorder |
Undocumented |
Instance Variable | refnodes |
Undocumented |
Instance Variable | tocid |
Undocumented |
Instance Variable | use |
Undocumented |
Inherited from StandaloneHTMLBuilder
:
Method | __init__ |
Undocumented |
Method | add |
Undocumented |
Method | add |
Undocumented |
Method | add |
Undocumented |
Method | cleanup |
Cleanup any resources. |
Method | copy |
copy html_extra_path files. |
Method | copy |
Undocumented |
Method | copy |
Undocumented |
Method | copy |
Undocumented |
Method | copy |
Undocumented |
Method | copy |
Copy a JavaScript file for stemmer. |
Method | copy |
Undocumented |
Method | copy |
Copy a JavaScript file for translations. |
Method | create |
create a style file for pygments. |
Method | dump |
Undocumented |
Method | dump |
Undocumented |
Method | finish |
Finish the building process. |
Method | gen |
Undocumented |
Method | gen |
Undocumented |
Method | gen |
Undocumented |
Method | get |
Return list of paths for assets (ex. templates, CSS, etc.). |
Method | get |
Collect items for the template context of a page. |
Method | get |
Return an iterable of output files that are outdated, or a string describing what an update build will build. |
Method | get |
Undocumented |
Method | get |
Return the target URI for a document name. |
Method | handle |
Undocumented |
Method | index |
Undocumented |
Method | init |
Undocumented |
Method | init |
Undocumented |
Method | init |
Undocumented |
Method | init |
Undocumented |
Method | load |
Undocumented |
Method | post |
Pick the best candidate for an image and link down-scaled images to their high res version. |
Method | prepare |
A place where you can add logic before :meth:`write_doc` is run |
Method | render |
Utility: Render a lone doctree node. |
Method | update |
Undocumented |
Method | write |
Undocumented |
Method | write |
Handle parts of write_doc that must be called in the main process if parallel build is active. |
Method | write |
Undocumented |
Method | write |
Undocumented |
Class Variable | allow |
Undocumented |
Class Variable | epilog |
Undocumented |
Class Variable | format |
Undocumented |
Class Variable | indexer |
Undocumented |
Class Variable | name |
Undocumented |
Class Variable | searchindex |
Undocumented |
Class Variable | supported |
Undocumented |
Instance Variable | build |
Undocumented |
Instance Variable | css |
Undocumented |
Instance Variable | current |
Undocumented |
Instance Variable | dark |
Undocumented |
Instance Variable | dlpath |
Undocumented |
Instance Variable | docsettings |
Undocumented |
Instance Variable | docwriter |
Undocumented |
Instance Variable | domain |
Undocumented |
Instance Variable | fignumbers |
Undocumented |
Instance Variable | globalcontext |
Undocumented |
Instance Variable | highlighter |
Undocumented |
Instance Variable | imagedir |
Undocumented |
Instance Variable | imgpath |
Undocumented |
Instance Variable | indexer |
Undocumented |
Instance Variable | last |
Undocumented |
Instance Variable | relations |
Undocumented |
Instance Variable | script |
Undocumented |
Instance Variable | secnumbers |
Undocumented |
Instance Variable | theme |
Undocumented |
Instance Variable | theme |
Undocumented |
Property | default |
Undocumented |
Property | math |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Instance Variable | _css |
Undocumented |
Instance Variable | _publisher |
Undocumented |
Instance Variable | _script |
Undocumented |
Inherited from Builder
(via StandaloneHTMLBuilder
):
Method | build |
Main build method. |
Method | build |
Build all source files. |
Method | build |
Only rebuild as much as needed for changes in the *filenames*. |
Method | build |
Only rebuild what was changed or added since last build. |
Method | compile |
Undocumented |
Method | compile |
Undocumented |
Method | compile |
Undocumented |
Method | compile |
Undocumented |
Method | create |
Return the template bridge configured. |
Method | create |
Return an instance of translator. |
Method | get |
Return a builder specific option. |
Method | get |
Return a relative URI between two source filenames. |
Method | get |
Return a class of translator. |
Method | read |
(Re-)read all files new or changed since last update. |
Method | read |
Parse a file and add/update inventory entries for the doctree. |
Method | set |
Store BuildEnvironment object. |
Method | write |
Undocumented |
Method | write |
Write the doctree to a file. |
Class Variable | use |
Undocumented |
Class Variable | versioning |
Undocumented |
Class Variable | versioning |
Undocumented |
Instance Variable | app |
Undocumented |
Instance Variable | confdir |
Undocumented |
Instance Variable | config |
Undocumented |
Instance Variable | doctreedir |
Undocumented |
Instance Variable | env |
Undocumented |
Instance Variable | events |
Undocumented |
Instance Variable | finish |
Undocumented |
Instance Variable | images |
Undocumented |
Instance Variable | outdir |
Undocumented |
Instance Variable | parallel |
Undocumented |
Instance Variable | srcdir |
Undocumented |
Instance Variable | tags |
Undocumented |
Instance Variable | templates |
Undocumented |
Method | _read |
Undocumented |
Method | _read |
Undocumented |
Method | _write |
Undocumented |
Method | _write |
Undocumented |
Add visible link targets for external links
Parameters | |
tree:nodes.document | Undocumented |
showstr | Undocumented |
Write the metainfo file content.opf It contains bibliographic data, a file list and the spine (the reading order).
Write the epub file. It is a zip file with the mimetype file stored uncompressed as the first entry.
Copy image files to destination directory. This overwritten method can use Pillow to convert image files.
Copy images using Pillow, the Python Imaging Library. The method tries to read and write the files with Pillow, converting the format and resizing the image if necessary/possible.
Replace colons with hyphens in href and id attributes. Some readers crash because they interpret the part as a transport protocol specification.
Parameters | |
tree:nodes.document | Undocumented |
Get the total table of contents, containing the root_doc and pre and post files not managed by sphinx.
Write one document file. This method is overwritten in order to fix fragment identifiers and to add visible external links.
Parameters | |
docname:str | Undocumented |
doctree:nodes.document | Undocumented |