Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 07-05-2019, 02:35 AM   #1
tage fredheim
Member
tage fredheim began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2019
Device: edge
--extra-css not working

I have added a path to my extra.css:

"--extra-css=os.path.join(Xslt.xslt_dir, self.uid, 'extra.css')",

When I paste this css into the GUI the css has the intendent effect, but when adding it in the command line it has no effect.

I get some error indications in the Python log file:
Spoiler:


[28.8044s] Conversion options changed from defaults:

[28.8044s] docx_page_margin_bottom: 42.0

[28.8044s] language: u' (nb) '

[28.8044s] toc_threshold: 0

[28.8044s] font_size_mapping: u'13,13,13,13,13,13,13,13'

[28.8044s] base_font_size: 13

[28.8044s] docx_page_margin_top: 42.0

[28.8044s] extra_css: u"os.path.join(Xslt.xslt_dir, self.uid, 'extra.css')"

[28.8044s] docx_page_margin_right: 56.0

[28.8044s] docx_page_size: u'a4'

[28.8044s] docx_page_margin_left: 70.0

[28.8044s] embed_font_family: u'Verdana'

[28.8044s] no_chapters_in_toc: True

[28.8044s] 1% Konverterer inndata til HTML...

[28.8045s] InputFormatPlugin: HTML Input running

[28.8045s] on /tmp/tmpcguaglp6/EPUB/861011.xhtml

[28.8045s] Building file list...

[28.8045s] Normalizing filename cases

[28.8045s] Rewriting HTML links

[28.8045s] 34% Running transforms on e-book...

[28.8045s] Merging user specified metadata...

[28.8045s] Detecting structure...

[28.8045s] Auto generated TOC with 0 entries.

[28.8045s] Flattening CSS and remapping font sizes...

[28.8045s] Embedding font: Verdana

[28.8045s] Property: Unknown Property name. [1:42: panose-1]

[28.8045s] Property: Unknown Property name. [1:49: panose-1]

[28.8045s] Property: Unknown Property name. [1:47: panose-1]

[28.8045s] Property: Unknown Property name. [1:54: panose-1]

[28.8045s] CSSStyleRule: No start { of style declaration found: u"os.path.join(Xslt.xslt_dir, self.uid, 'extra.css')" [1:51: ]

[28.8045s] Selector: Unexpected CHAR. [1:8: .]

[28.8045s] Unexpected token (FUNCTION, join(, 1, 9)

[28.8045s] Selector: Unexpected IDENT. [1:14: Xslt]

[28.8045s] Selector: Single selector only. [1:27: ,]

[28.8045s] Selector: Single selector only. [1:37: ,]

[28.8045s] Selector: Unexpected STRING. [1:39: 'extra.css']

[28.8045s] Selector: Unexpected CHAR. [1:50: )]

[28.8045s] SelectorList: Invalid Selector: os.path.join(Xslt.xslt_dir, self.uid, 'extra.css')

[28.8045s] CSSStyleRule: No style declaration or "}" found: u"os.path.join(Xslt.xslt_dir, self.uid, 'extra.css')"

[28.8045s] Source base font size is 12.00000pt

[28.8045s] Removing fake margins...

[28.8045s] Cleaning up manifest...

Last edited by theducks; 07-05-2019 at 08:57 AM. Reason: add spoiler tags
tage fredheim is offline   Reply With Quote
Old 07-05-2019, 10:27 AM   #2
tage fredheim
Member
tage fredheim began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2019
Device: edge
The extra.css attached

Attached is the extra.css

Attached Files
File Type: txt extra-css.txt (34.7 KB, 114 views)
tage fredheim is offline   Reply With Quote
Advert
Old 07-05-2019, 10:51 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,006
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As is noted in the documentation for the --extra-css option it has to either be actual CSS or the path to an extra css file. Not a python expression.
kovidgoyal is offline   Reply With Quote
Old 07-06-2019, 02:59 AM   #4
tage fredheim
Member
tage fredheim began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2019
Device: edge
What about python variables

I also extract the Language metadata from the epub-file to put it into the docx via a Python variable:

"--language="+language,

is that not allowed either?
tage fredheim is offline   Reply With Quote
Old 07-06-2019, 08:20 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,006
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No there are no python variables allowed. language metadata will be preserved from the input to the output automatically
kovidgoyal is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pagestyle.css extra / integrated in stylesheet.css / or not at all? chaot Workshop 14 02-24-2017 11:10 PM
--extra-css argument ignored paipa Conversion 10 09-05-2014 10:50 AM
Extra CSS and class renaming fenuks Recipes 4 01-26-2014 05:24 AM
css pseudo elements and adjacent combinators in extra css? ldolse Calibre 2 12-21-2010 05:09 PM
a few extra css questions marbs Recipes 12 11-20-2010 10:15 AM


All times are GMT -4. The time now is 05:56 PM.


MobileRead.com is a privately owned, operated and funded community.