Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-12-2017, 01:08 PM   #16
mfm-ca
Enthusiast
mfm-ca began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Apr 2017
Device: PC
Quote:
Originally Posted by kovidgoyal View Post
If it is in a separate file, it is even simpler -- probably needs only a single line. Look around line 250 in container.py (the same file that has create_skeleton)
I've managed to change the source to get the desired setting in the DOCX output, but based on your comment, I wonder if what I did was unnecessary or, worse, erroneous. I ended up with one line modified in from_html.py, and four lines added and two lines modified in container.py.

I should note that I am not proficient in Python or OO methodologies. I am old-school (and old!) when it comes to programming and scripting. But I do have a knack for reading unfamiliar code or coding languages and figuring it out, at least well enough to be dangerous.
mfm-ca is offline   Reply With Quote
Old 04-12-2017, 10:04 PM   #17
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: 33,470
Karma: 10205098
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As long as it does what you want, the number of lines of code it takes is entirely irrelevant.
kovidgoyal is offline   Reply With Quote
Old 07-12-2018, 08:30 AM   #18
tafr
Junior Member
tafr began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jul 2018
Device: edge
I need to incorporate a template called WordbokBlind.dot into the conversion to docx. What is the full path to the conversion.py and what code is to be added and where should the .dot file be placed?

The container.py flle I am looking at is placed in the usr/lib/calibre/calibre/ebooks/docx/writer

and contains these first lines:

#!/usr/bin/python2.7
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)

__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
tafr is offline   Reply With Quote
Old 07-12-2018, 08:36 AM   #19
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: 33,470
Karma: 10205098
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Once again, there is no support for templates of any kind in calibre docx conversions. If you want to modify the docx generated by calibre, you have to modify the source code.
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert EPUB to DOCX [Change Default Margins] Lassox Conversion 3 04-12-2017 10:03 PM
Change filename template in Calibre's library 8140david Library Management 3 09-25-2016 11:39 AM
How to change the "inline TOC" template? Phssthpok Editor 15 12-06-2014 11:09 AM
MOBI -> EPUB: Change cover template? Rev. Bob Conversion 3 03-22-2013 09:51 PM
DOCX Input and DOCX Metadata Reader SauliusP. Development 5 06-15-2012 02:17 AM


All times are GMT -4. The time now is 02:03 PM.


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