From a6a2359025daca2813545e8fa1ffa656b01c7fb7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 7 Nov 2014 21:23:41 +0530 Subject: [PATCH] Edit Book: Make the CSS used for styling the generated inline ToC user customizable via http://manual.calibre-ebook.com/customize.html#overriding-icons-templates-et-cetera --- resources/templates/inline_toc_styles.css | 5 +++++ src/calibre/ebooks/oeb/polish/toc.py | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 resources/templates/inline_toc_styles.css diff --git a/resources/templates/inline_toc_styles.css b/resources/templates/inline_toc_styles.css new file mode 100644 index 0000000000..0319f6e88d --- /dev/null +++ b/resources/templates/inline_toc_styles.css @@ -0,0 +1,5 @@ +li { list-style-type: none; padding-left: 2em; margin-left: 0} + +a { text-decoration: none } + +a:hover { color: red } diff --git a/src/calibre/ebooks/oeb/polish/toc.py b/src/calibre/ebooks/oeb/polish/toc.py index 0a5744f64b..da90ccad88 100644 --- a/src/calibre/ebooks/oeb/polish/toc.py +++ b/src/calibre/ebooks/oeb/polish/toc.py @@ -540,10 +540,7 @@ def create_inline_toc(container, title=None): html = E.html( E.head( E.title(title), - E.style(''' - li { list-style-type: none; padding-left: 2em; margin-left: 0} - a { text-decoration: none } - a:hover { color: red }''', type='text/css'), + E.style(P('templates/inline_toc_styles.css', data=True), type='text/css'), ), E.body( E.h2(title),