From b562646c8d4fe2405087dd52053faefcaf719936 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 21 Aug 2008 16:29:37 -0700 Subject: [PATCH] IGN:... --- src/calibre/ebooks/epub/from_html.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/calibre/ebooks/epub/from_html.py b/src/calibre/ebooks/epub/from_html.py index 985f035129..2de87cc063 100644 --- a/src/calibre/ebooks/epub/from_html.py +++ b/src/calibre/ebooks/epub/from_html.py @@ -59,6 +59,11 @@ class HTMLProcessor(PreProcessor, LoggingInterface): self.detected_chapters = self.opts.chapter(self.root) def rewrite_links(self, olink): + ''' + Make all links in document relative so that they work in the EPUB container. + Also copies any resources (like image, stylesheets, scripts, etc.) into + the local tree. + ''' link = self.htmlfile.resolve(olink) if not link.path or not os.path.exists(link.path) or not os.path.isfile(link.path): return olink @@ -76,6 +81,10 @@ class HTMLProcessor(PreProcessor, LoggingInterface): def extract_css(self): + ''' + Remove all CSS information from the document and store in self.raw_css. + This includes tags. + ''' css = [] for link in self.root.xpath('//link'): if 'css' in link.get('type', 'text/css').lower():