From fa4986e6c897f8c32208308aa488f455ee3337de Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Nov 2010 19:05:13 -0700 Subject: [PATCH 1/3] Improve Revista Muy Intersante --- resources/recipes/revista_muy.recipe | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/recipes/revista_muy.recipe b/resources/recipes/revista_muy.recipe index b101fe97ce..c4516f718d 100644 --- a/resources/recipes/revista_muy.recipe +++ b/resources/recipes/revista_muy.recipe @@ -13,6 +13,8 @@ class RevistaMuyInteresante(BasicNewsRecipe): no_stylesheets = True remove_javascript = True + conversion_options = {'linearize_tables': True} + extra_css = ' .txt_articulo{ font-family: sans-serif; font-size: medium; text-align: justify } .contentheading{font-family: serif; font-size: large; font-weight: bold; color: #000000; text-align: center}' @@ -39,11 +41,12 @@ class RevistaMuyInteresante(BasicNewsRecipe): keep_only_tags = [dict(name='div', attrs={'class':['article']}),dict(name='td', attrs={'class':['txt_articulo']})] remove_tags = [ - dict(name=['object','link','script','ul']) + dict(name=['object','link','script','ul','iframe','ins']) ,dict(name='div', attrs={'id':['comment']}) ,dict(name='td', attrs={'class':['buttonheading']}) - ,dict(name='div', attrs={'class':['tags_articles']}) + ,dict(name='div', attrs={'class':['tags_articles','bajo_title']}) ,dict(name='table', attrs={'class':['pagenav']}) + ,dict(name='form', attrs={'class':['voteform']}) ] remove_tags_after = dict(name='div', attrs={'class':'tags_articles'}) @@ -115,3 +118,5 @@ class RevistaMuyInteresante(BasicNewsRecipe): if link_item: cover_url = "http://www.muyinteresante.es"+link_item['src'] return cover_url + + From 3a7da561cc69594b4a61306241e1ca330a17fbc6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Nov 2010 19:31:12 -0700 Subject: [PATCH 2/3] Fix regression taht broke RTF conversion on some linux systems --- src/calibre/ebooks/rtf/input.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/rtf/input.py b/src/calibre/ebooks/rtf/input.py index 75c839eb83..57903a6711 100644 --- a/src/calibre/ebooks/rtf/input.py +++ b/src/calibre/ebooks/rtf/input.py @@ -292,7 +292,8 @@ class RTFInput(InputFormatPlugin): # Replace newlines inserted by the 'empty_paragraphs' option in rtf2xml with html blank lines if not getattr(self.options, 'remove_paragraph_spacing', False): res = re.sub('\s*', '', res) - res = re.sub('(?<=\n)\n{2}', u'

\u00a0

\n', res) + res = re.sub('(?<=\n)\n{2}', + u'

\u00a0

\n'.encode('utf-8'), res) if self.options.preprocess_html: preprocessor = PreProcessor(self.options, log=getattr(self, 'log', None)) res = preprocessor(res) From 3cea3ec006db7d81449a7ea3cfec7bf7b07d8253 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Nov 2010 19:33:05 -0700 Subject: [PATCH 3/3] ... --- src/calibre/manual/customize.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/manual/customize.rst b/src/calibre/manual/customize.rst index 5272a88f53..0d6f75b9cf 100644 --- a/src/calibre/manual/customize.rst +++ b/src/calibre/manual/customize.rst @@ -129,11 +129,11 @@ Here's a simple Hello World plugin for the |app| GUI. It will cause a box to pop info_dialog(self.gui, 'Hello World!', 'Hellooo World!', show=True) - return HelloWorld(gui, None) + return HelloWorld(gui, self.site_customization) You can also have it show up in the toolbars/context menu by going to Preferences->Toolbars and adding this plugin to the locations you want it to be in. -While this plugin is utterly useless, note that all calibre GUI actions like adding/saving/removing/viewing/etc. are implemented as plugins, so there is no limit to what you can acheive. The key thing to remember is that the plugin has access to the full |app| GUI via ``self.gui``. +While this plugin is utterly useless, note that all calibre GUI actions like adding/saving/removing/viewing/etc. are implemented as plugins, so there is no limit to what you can achieve. The key thing to remember is that the plugin has access to the full |app| GUI via ``self.gui``. The Plugin base class