.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "EBOOK 1p" .TH EBOOK 1p "2019-08-08" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" ebook \- create and manipulate e\-books from the command line .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& ebook COMMAND arg1 arg2 \-\-opt1 \-\-opt2 .Ve .PP See also \*(L"\s-1EXAMPLES\*(R"\s0. .SH "COMMANDS" .IX Header "COMMANDS" .ie n .SS """adddoc""" .el .SS "\f(CWadddoc\fP" .IX Subsection "adddoc" Adds a documents to both the book manifest and spine. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-opffile""" 4 .el .IP "\f(CW\-\-opffile\fR" 4 .IX Item "--opffile" .PD 0 .ie n .IP """\-\-opf""" 4 .el .IP "\f(CW\-\-opf\fR" 4 .IX Item "--opf" .PD The \s-1OPF\s0 file to modify. If not specified one will be searched for in the current directory. .ie n .IP """\-\-identifier""" 4 .el .IP "\f(CW\-\-identifier\fR" 4 .IX Item "--identifier" .PD 0 .ie n .IP """\-\-id""" 4 .el .IP "\f(CW\-\-id\fR" 4 .IX Item "--id" .PD The \s-1ID\s0 attribute to use for the added manifest item. This is required, and ebook will abort if it is not specified. .ie n .IP """\-\-mimetype""" 4 .el .IP "\f(CW\-\-mimetype\fR" 4 .IX Item "--mimetype" .PD 0 .ie n .IP """\-\-mtype""" 4 .el .IP "\f(CW\-\-mtype\fR" 4 .IX Item "--mtype" .PD The mime type string to use for the added manifest item. If not specified, it will be autodetected via File::Mimeinfo::Magic. This may not result in an optimal string. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 1 \& ebook adddoc \-\-opf mybook.opf \-\-id \*(Aqtext\-ch1\*(Aq chapter1.html .Ve .ie n .SS """additem""" .el .SS "\f(CWadditem\fP" .IX Subsection "additem" Add an item to the book manifest, but not the spine. .PP Note that the \*(L"fix\*(R" command will automatically insert manifest items for any local files referenced by existing manifest items. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-opffile""" 4 .el .IP "\f(CW\-\-opffile\fR" 4 .IX Item "--opffile" .PD 0 .ie n .IP """\-\-opf""" 4 .el .IP "\f(CW\-\-opf\fR" 4 .IX Item "--opf" .PD The \s-1OPF\s0 file to modify. If not specified one will be searched for in the current directory. .ie n .IP """\-\-identifier""" 4 .el .IP "\f(CW\-\-identifier\fR" 4 .IX Item "--identifier" .PD 0 .ie n .IP """\-\-id""" 4 .el .IP "\f(CW\-\-id\fR" 4 .IX Item "--id" .PD The \s-1ID\s0 attribute to use for the added manifest item. This is required, and ebook will abort if it is not specified. .ie n .IP """\-\-mimetype""" 4 .el .IP "\f(CW\-\-mimetype\fR" 4 .IX Item "--mimetype" .PD 0 .ie n .IP """\-\-mtype""" 4 .el .IP "\f(CW\-\-mtype\fR" 4 .IX Item "--mtype" .PD The mime type string to use for the added manifest item. If not specified, it will be autodetected via File::Mimeinfo::Magic. This may not result in an optimal string. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 1 \& ebook additem \-\-opf mybook.opf \-\-id \*(Aqillus\-ch1\*(Aq chapter1\-illus.jpg .Ve .ie n .SS """bisac""" .el .SS "\f(CWbisac\fP" .IX Subsection "bisac" Search for a \s-1BISAC\s0 code matching a case-insensitive regular expression. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """regexp""" 4 .el .IP "\f(CWregexp\fR" 4 .IX Item "regexp" The first argument is taken as a regular expression to use for the search. If this is either '.' or not specified, the entire list of valid codes is printed. .Sp This requires that the \s-1BISAC\s0 codes be downloaded ahead of time. (See \&\f(CW\*(C`dlbisac\*(C'\fR.) .ie n .SS """blank""" .el .SS "\f(CWblank\fP" .IX Subsection "blank" Create a blank e\-book structure. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-opffile filename.opf""" 4 .el .IP "\f(CW\-\-opffile filename.opf\fR" 4 .IX Item "--opffile filename.opf" .PD 0 .ie n .IP """\-\-opf filename.opf""" 4 .el .IP "\f(CW\-\-opf filename.opf\fR" 4 .IX Item "--opf filename.opf" .PD Use the specified \s-1OPF\s0 file. This can also be specified as the first non-option argument, which will override this option if it exists. If no file is specified, the program will abort with an error. =item \f(CW\*(C`\-\-author\*(C'\fR \*(L"Author Name\*(R" .Sp The author of the book. If not specified, defaults to \*(L"Unknown Author\*(R". .ie n .IP """\-\-title"" ""Title Name""" 4 .el .IP "\f(CW\-\-title\fR ``Title Name''" 4 .IX Item "--title Title Name" The title of the book. If not specified, defaults to \*(L"Unknown Title\*(R". .ie n .IP """\-\-dir directory""" 4 .el .IP "\f(CW\-\-dir directory\fR" 4 .IX Item "--dir directory" .PD 0 .ie n .IP """\-d directory""" 4 .el .IP "\f(CW\-d directory\fR" 4 .IX Item "-d directory" .PD Output the \s-1OPF\s0 file in this directory, creating it if necessary. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 2 \& ebook blank newfile.opf \-\-author "Me Myself" \-\-title "New File" \& ebook blank \-\-opffile newfile.opf \-\-author "Me Myself" \-\-title "New File" .Ve .PP Both of those commands have the same effect. .ie n .SS """config""" .el .SS "\f(CWconfig\fP" .IX Subsection "config" Make changes to the EBook::Tools configuration file. .PP The configuration file itself is located as either \&\f(CW\*(C`$ENV{HOME}/.ebooktools/config.ini\*(C'\fR or as \&\f(CW\*(C`$ENV{USERPROFILE}\eApplication Data\eEBook\-Tools\*(C'\fR, depending on platform and which directory is found first. See \&\*(L"\fBuserconfigdir()\fR\*(R" in EBook::Tools for details. .PP \fIArguments / Subcommands\fR .IX Subsection "Arguments / Subcommands" .PP Configuration is always handled in the format of: .PP .Vb 1 \& ebook config subcommand value .Ve .IP "\(bu" 4 \&\f(CW\*(C`default\*(C'\fR .Sp Replace any existing configuration file with a default template. This creates the file if it does not exist. This should be done once before any other configuration manipulation is done, unless a configuration file has been manually created ahead of time. .IP "\(bu" 4 \&\f(CW\*(C`debug\*(C'\fR .Sp Sets the default debugging level when no verbosity is specified. Note that verbosity can only be increased, not decreased, with the \f(CW\*(C`\-v\*(C'\fR option. .IP "\(bu" 4 \&\f(CW\*(C`tidysafety\*(C'\fR .Sp Sets the default safety level when tidy is used. Valid values are from 0\-4. See \*(L"unpack\*(R" for details on what each value means. .IP "\(bu" 4 \&\f(CW\*(C`mobipids\*(C'\fR .Sp A comma-separated list of Mobipocket PIDs to try to use to decrypt e\-books. This value is only used if the appropriate plug-in modules or helper applications are available, as \s-1DRM\s0 is not supported natively by EBook::Tools. Note that if the \s-1PID\s0 includes a $ character, the entire \s-1PID\s0 string has to be enclosed in single quotes. .PP \fIExamples\fR .IX Subsection "Examples" .PP .Vb 3 \& ebook config default \& ebook config debug 2 \& ebook config mobipids \*(Aq1234567890,2345678$90\*(Aq .Ve .ie n .SS """convert""" .el .SS "\f(CWconvert\fP" .IX Subsection "convert" Unpacks the ebook specified as the first argument, runs standard fixes on the contents, and repacks it into a new format in the output file specified as the second argument. Currently the only supported output format is epub, which is the format you will get irrespective of the extension you actually give the output file. .PP \fIOptions\fR .IX Subsection "Options" .Sp .RS 4 All options from \f(CW\*(C`unpack\*(C'\fR and \f(CW\*(C`fix\*(C'\fR are technically valid here as well, though of course some options are nonsensical in this context and will likely break the conversion (e.g. \-\-nosave). .RE .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 2 \& ebook convert MyBook.prc MyBook.epub \& ebook convert \-\-name MyBook.lit /home/myname/MyBook.epub .Ve .ie n .SS """dlbisac""" .el .SS "\f(CWdlbisac\fP" .IX Subsection "dlbisac" Downloads and caches the Book Industry Study Group \s-1BISAC\s0 codes into a local database. This will destroy the existing contents of that table if this has been done previously. .ie n .SS """downconvert""" .el .SS "\f(CWdownconvert\fP" .IX Subsection "downconvert" .ie n .SS """dc""" .el .SS "\f(CWdc\fP" .IX Subsection "dc" If the appropriate helpers or plugins are available, write a copy of the input file with the \s-1DRM\s0 restrictions removed. .PP \&\s-1NOTE:\s0 no actual DRM-removal code is present in this package. This is just presents a unified interface to other programs that have that capability. .PP \fIArguments\fR .IX Subsection "Arguments" .IP "\(bu" 4 \&\f(CW\*(C`infile\*(C'\fR .Sp The first non-option argument is taken to be the input file. If not specified, the program exits with an error. .IP "\(bu" 4 \&\f(CW\*(C`outfile\*(C'\fR .Sp The second non-option argument is taken to be the output file. If not specified, the program will use a name based on the input file, appending '\-nodrm' to the basename and keeping the extension. In the special case of Mobipocket files ending in '\-sm', the '\-sm' portion of the basename is simply removed, and nothing else is appended. .IP "\(bu" 4 \&\f(CW\*(C`key\*(C'\fR .Sp The third non-option argument is taken to be either the decryption key/PID, or in the case of Microsoft Reader (.lit) files, the \&\f(CW\*(C`keys.txt\*(C'\fR file containing the decryption keys. .Sp If not specified, this will be looked up from the configuration file. Convertlit keyfiles will be looked for in standard locations. If no key is found, the command aborts and exits with an error. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 2 \& ebook downconvert NewBook.lit NewBook\-readable.lit mykeys.txt \& ebook dc MyBook\-sm.prc .Ve .ie n .SS """fix""" .el .SS "\f(CWfix\fP" .IX Subsection "fix" Find and fix problems with an e\-book, including enforcing a standard specification and ensuring that all linked objects are present in the manifest. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-opffile filename.opf""" 4 .el .IP "\f(CW\-\-opffile filename.opf\fR" 4 .IX Item "--opffile filename.opf" .PD 0 .ie n .IP """\-\-opf filename.opf""" 4 .el .IP "\f(CW\-\-opf filename.opf\fR" 4 .IX Item "--opf filename.opf" .PD Use the specified \s-1OPF\s0 file. This can also be specified as the first non-option argument, which will override this option if it exists. If no file is specified, one will be searched for. .ie n .IP """\-\-oeb12""" 4 .el .IP "\f(CW\-\-oeb12\fR" 4 .IX Item "--oeb12" Force the \s-1OPF\s0 to conform to the \s-1OEB 1.2\s0 standard. This is the default. .ie n .IP """\-\-opf20""" 4 .el .IP "\f(CW\-\-opf20\fR" 4 .IX Item "--opf20" Force the \s-1OPF\s0 to conform to the \s-1OPF 2.0\s0 standard. If both this and \&\f(CW\*(C`\-\-oeb12\*(C'\fR are specified, the program will abort with an error. .ie n .IP """\-\-mobi""" 4 .el .IP "\f(CW\-\-mobi\fR" 4 .IX Item "--mobi" Correct Mobipocket-specific elements, creating an output element to force \s-1UTF\-8\s0 output if one does not yet exist. .ie n .IP """\-\-erotic"" or ""\-\-sex""" 4 .el .IP "\f(CW\-\-erotic\fR or \f(CW\-\-sex\fR" 4 .IX Item "--erotic or --sex" Enable special handling for erotic fiction (most notably special subject normalization rules). .ie n .IP """\-\-names""" 4 .el .IP "\f(CW\-\-names\fR" 4 .IX Item "--names" Normalize names to standard capitalization and format (primary name display is \*(L"First Middle Last\*(R", but file-as is \*(L"Last, First Middle\*(R". .Sp This is not done by default as it can damage unusual but correct names. .ie n .SS """genepub""" .el .SS "\f(CWgenepub\fP" .IX Subsection "genepub" Generate a .epub book from existing \s-1OPF\s0 data. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-input filename.opf""" 4 .el .IP "\f(CW\-\-input filename.opf\fR" 4 .IX Item "--input filename.opf" .PD 0 .ie n .IP """\-\-i filename.opf""" 4 .el .IP "\f(CW\-\-i filename.opf\fR" 4 .IX Item "--i filename.opf" .ie n .IP """\-\-opffile filename.opf""" 4 .el .IP "\f(CW\-\-opffile filename.opf\fR" 4 .IX Item "--opffile filename.opf" .ie n .IP """\-\-opf filename.opf""" 4 .el .IP "\f(CW\-\-opf filename.opf\fR" 4 .IX Item "--opf filename.opf" .PD Use the specified \s-1OPF\s0 file. If no file is specified, one will be searched for. .ie n .IP """\-\-output bookname.epub""" 4 .el .IP "\f(CW\-\-output bookname.epub\fR" 4 .IX Item "--output bookname.epub" .PD 0 .ie n .IP """\-o bookname.epub""" 4 .el .IP "\f(CW\-o bookname.epub\fR" 4 .IX Item "-o bookname.epub" .PD Use the specified name for the final output file. This can also be specified as the first non-option argument, which will override this option if it exists. If not specified, the book will have the same filename as the \s-1OPF\s0 file, with the extension changed to \f(CW\*(C`.epub\*(C'\fR. .ie n .IP """\-\-dir directory""" 4 .el .IP "\f(CW\-\-dir directory\fR" 4 .IX Item "--dir directory" .PD 0 .ie n .IP """\-d directory""" 4 .el .IP "\f(CW\-d directory\fR" 4 .IX Item "-d directory" .PD Output the final .epub book into the specified directory. The default is to use the current working directory. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 1 \& ebook genepub mybook.opf \-o my_special_book.epub \-d ../epubbooks .Ve .PP or in the simplest case: .PP .Vb 1 \& ebook genepub .Ve .ie n .SS """genimp""" .el .SS "\f(CWgenimp\fP" .IX Subsection "genimp" Generate a eBookwise .imp book from a .RES directory .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-input DIRNAME.RES""" 4 .el .IP "\f(CW\-\-input DIRNAME.RES\fR" 4 .IX Item "--input DIRNAME.RES" .PD 0 .ie n .IP """\-i DIRNAME.RES""" 4 .el .IP "\f(CW\-i DIRNAME.RES\fR" 4 .IX Item "-i DIRNAME.RES" .PD Specifies the resource directory to use for input. A valid resource directory will contain at least a \f(CW\*(C`RSRC.INF\*(C'\fR file, a \f(CW\*(C`DATA.FRK\*(C'\fR file, and several other files with four-capital-letter filenames. .Sp This can also be specified as the first non-option argument, which will override this option if it exists. If not specified, the current directory will be used. .ie n .IP """\-\-output bookname.epub""" 4 .el .IP "\f(CW\-\-output bookname.epub\fR" 4 .IX Item "--output bookname.epub" .PD 0 .ie n .IP """\-o bookname.epub""" 4 .el .IP "\f(CW\-o bookname.epub\fR" 4 .IX Item "-o bookname.epub" .PD Use the specified name for the final output file. If not specified, the book will have the same filename as the input, with the extension changed to \f(CW\*(C`.imp\*(C'\fR. .PP \fIExamples\fR .IX Subsection "Examples" .PP .Vb 2 \& ebook genimp MyUnpackedBook.RES MyBook.imp \& ebook genimp \-\-resdir ../MyUnpackedBook.RES \-f imp/MyBook.imp .Ve .ie n .SS """genmobi""" .el .SS "\f(CWgenmobi\fP" .IX Subsection "genmobi" Generate a Mobipocket .mobi/.prc book from \s-1OPF, HTML,\s0 or ePub input. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-input filename""" 4 .el .IP "\f(CW\-\-input filename\fR" 4 .IX Item "--input filename" .PD 0 .ie n .IP """\-\-i filename""" 4 .el .IP "\f(CW\-\-i filename\fR" 4 .IX Item "--i filename" .PD Use the specified file for input. Valid formats are \s-1OPF, HTML,\s0 and ePub. This can also be specified as the first non-option argument, which will override this option if it exists. If no file is specified, an \s-1OPF\s0 file in the current directory will be searched for. .ie n .IP """\-\-output bookname.prc""" 4 .el .IP "\f(CW\-\-output bookname.prc\fR" 4 .IX Item "--output bookname.prc" .PD 0 .ie n .IP """\-o bookname.prc""" 4 .el .IP "\f(CW\-o bookname.prc\fR" 4 .IX Item "-o bookname.prc" .PD Use the specified name for the final output file. If not specified, the book will have the same filename as the input file, with the extension changed to \f(CW\*(C`.mobi\*(C'\fR (this file is always created by \&\f(CW\*(C`mobigen\*(C'\fR, specifying a different filename only causes it to be renamed afterwards). .Sp This can also be specified as the second non-option argument, which will override this option if it exists. .ie n .IP """\-\-dir directory""" 4 .el .IP "\f(CW\-\-dir directory\fR" 4 .IX Item "--dir directory" .PD 0 .ie n .IP """\-d directory""" 4 .el .IP "\f(CW\-d directory\fR" 4 .IX Item "-d directory" .PD Output the final book into the specified directory. The default is to use the current working directory, which is where \f(CW\*(C`mobigen\*(C'\fR will always place it initially; if specified this only forces the file to be moved after generation. .ie n .IP """\-\-compression x""" 4 .el .IP "\f(CW\-\-compression x\fR" 4 .IX Item "--compression x" .PD 0 .ie n .IP """\-c x""" 4 .el .IP "\f(CW\-c x\fR" 4 .IX Item "-c x" .PD Use the specified compression level \f(CW\*(C`x\*(C'\fR, where 0 is no compression, 1 is PalmDoc compression, and 2 is \s-1HUFF/CDIC\s0 compression. If not specified, defaults to 1 (PalmDoc compression). .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 2 \& ebook genmobi mybook.opf \-o my_special_book.prc \-d ../mobibooks \& ebook genmobi mybook.html mybook.prc \-c2 .Ve .PP or in the simplest case: .PP .Vb 1 \& ebook genmobi .Ve .ie n .SS """genncx""" .el .SS "\f(CWgenncx\fP" .IX Subsection "genncx" Given an \s-1OPF\s0 file, creates a NCX-format table of contents from the package unique-identifier, the dc:title, dc:creator, and spine elements, and then add the \s-1NCX\s0 entry to the manifest if it is not already referenced. .PP The \s-1OPF\s0 file will be cleaned to \s-1OPF20\s0 format before this happens. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-opffile filename.opf""" 4 .el .IP "\f(CW\-\-opffile filename.opf\fR" 4 .IX Item "--opffile filename.opf" .PD 0 .ie n .IP """\-\-opf filename.opf""" 4 .el .IP "\f(CW\-\-opf filename.opf\fR" 4 .IX Item "--opf filename.opf" .PD Use the specified \s-1OPF\s0 file. This can also be specified as the first non-option argument, which will override this option if it exists. If no file is specified, one will be searched for. .ie n .SS """impmeta""" .el .SS "\f(CWimpmeta\fP" .IX Subsection "impmeta" Set specific metadata values in an \s-1ETI\s0 .imp file. .PP \fIOptions\fR .IX Subsection "Options" .IP "\(bu" 4 \&\f(CW\*(C`\-\-input filename.imp\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`\-i filename.imp\*(C'\fR .Sp Specify the input filename. This can also be specified as the first argument, in which case the \-i option will be ignored. .IP "\(bu" 4 \&\f(CW\*(C`\-\-output modified.imp\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`\-o modified.imp\*(C'\fR .Sp Specify the output filename. If not specified, the input file will be overwritten. .IP "\(bu" 4 \&\f(CW\*(C`\-\-identifier\*(C'\fR .Sp Specify the identifier metadata. .IP "\(bu" 4 \&\f(CW\*(C`\-\-category\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`\-\-cat\*(C'\fR .Sp Specify the category metadata. .IP "\(bu" 4 \&\f(CW\*(C`\-\-subcategory\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`\-\-subcat\*(C'\fR .Sp Specify the subcategory metadata. .IP "\(bu" 4 \&\f(CW\*(C`\-\-title\*(C'\fR .Sp Specify the title metadata. .IP "\(bu" 4 \&\f(CW\*(C`\-\-lastname\*(C'\fR .Sp Specify the author last name metadata. .IP "\(bu" 4 \&\f(CW\*(C`\-\-middlename\*(C'\fR .Sp Specify the author middle name metadata. .IP "\(bu" 4 \&\f(CW\*(C`\-\-firstname\*(C'\fR .Sp Specify the author first name metadata. Note that \s-1IMP\s0 files commonly place the full name in this component, and leave the middlename and lastname entries blank. .PP \fIExamples\fR .IX Subsection "Examples" .PP .Vb 2 \& ebook impmeta mybook.imp \-\-title \*(AqFixed Title\*(Aq \-\-lastname \*(AqJohn Q. Brandy\*(Aq \& ebook impmeta \-i mybook.imp \-o fixed.imp \-\-title \*(AqFixed Title\*(Aq .Ve .ie n .SS """setcover""" .el .SS "\f(CWsetcover\fP" .IX Subsection "setcover" Sets the cover image .PP Takes as a single argument the href of the file to use. .PP \fIOptions\fR .IX Subsection "Options" .IP "\(bu" 4 \&\f(CW\*(C`\-\-opffile\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`\-\-opf\*(C'\fR .Sp Specifies the \s-1OPF\s0 file to modify. If not specified, the script will attempt to find one .IP "\(bu" 4 \&\f(CW\*(C`\-\-identifier\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`\-\-id\*(C'\fR .Sp Specifies the \s-1ID\s0 to assign to the associated manifest item. .ie n .SS """setmeta""" .el .SS "\f(CWsetmeta\fP" .IX Subsection "setmeta" Set specific metadata values on an \s-1OPF\s0 file, creating a new entry if none exists. .PP Both the element to set and the value are specified as additional arguments, not as options. .PP The elements that can be set are currently: .IP "author" 4 .IX Item "author" .PD 0 .IP "date" 4 .IX Item "date" .IP "description" 4 .IX Item "description" .IP "publisher" 4 .IX Item "publisher" .IP "rights" 4 .IX Item "rights" .IP "series" 4 .IX Item "series" .IP "subject" 4 .IX Item "subject" .IP "title" 4 .IX Item "title" .IP "type" 4 .IX Item "type" .PD .PP The 'series' values can take an extra argument containing the series index position. .PP The 'subject' elements can be added multiple times (including in a single command-line, though \-\-id will only set the \s-1ID\s0 on the first one specified). Other entries will be overwritten. .PP The element argument can be shortened to the minimum number of letters necessary to uniquely identify it. .PP \fIOptions\fR .IX Subsection "Options" .IP "\(bu" 4 \&\f(CW\*(C`\-\-opffile\*(C'\fR =item * \f(CW\*(C`\-\-opf\*(C'\fR .Sp Specifies the \s-1OPF\s0 file to modify. If not specified, the script will attempt to find one in the current directory. .IP "\(bu" 4 \&\f(CW\*(C`\-\-delete\*(C'\fR .Sp Allows the deletion of subject and series metadata. Has no effect on other elements. .IP "\(bu" 4 \&\f(CW\*(C`\-\-fileas\*(C'\fR .Sp Specifies the 'file\-as' attribute when setting an author. Has no effect on other elements. .IP "\(bu" 4 \&\f(CW\*(C`\-\-identifier\*(C'\fR .IP "\(bu" 4 \&\f(CW\*(C`\-\-id\*(C'\fR .Sp Specifies the \s-1ID\s0 to assign to the element. .PP \fIExamples\fR .IX Subsection "Examples" .PP .Vb 4 \& ebook setmeta series \*(AqSome Other Series\*(Aq 03 \& ebook setmeta title \*(AqMy Great Title\*(Aq \& ebook setmeta t \*(AqMy Great Title\*(Aq \& ebook \-\-opf newfile.opf setmeta author \*(AqJohn Smith\*(Aq \-\-fileas \*(AqSmith, John\*(Aq \-\-id mainauthor .Ve .ie n .SS """splitmeta""" .el .SS "\f(CWsplitmeta\fP" .IX Subsection "splitmeta" Split the ... block out of a pseudo-HTML file that contains one. .ie n .SS """splitpre""" .el .SS "\f(CWsplitpre\fP" .IX Subsection "splitpre" Split
...
blocks out of an existing \s-1HTML\s0 file, wrapping each one found into a separate \s-1HTML\s0 file. .PP The first non-option argument is taken to be the input file. The second non-option argument is taken to be the basename of the output files. .ie n .SS """stripscript""" .el .SS "\f(CWstripscript\fP" .IX Subsection "stripscript" Strips blocks out of a \s-1HTML\s0 file. .PP The first non-option argument is taken to be the input file. The second non-option argument is taken to be the output file. If the latter is not specified, the input file will be overwritten. .PP \fIOptions\fR .IX Subsection "Options" .IP "\(bu" 4 \&\f(CW\*(C`\-\-noscript\*(C'\fR .Sp Strips blocks as well. .ie n .SS """tidyxhtml""" .el .SS "\f(CWtidyxhtml\fP" .IX Subsection "tidyxhtml" Run tidy on a \s-1HTML\s0 file to enforce valid \s-1XHTML\s0 output (required by the \&\s-1OPF 2.0\s0 specification). .ie n .SS """tidyxml""" .el .SS "\f(CWtidyxml\fP" .IX Subsection "tidyxml" Run tidy an a \s-1XML\s0 file (for neatness). .ie n .SS """unpack_ebook""" .el .SS "\f(CWunpack_ebook\fP" .IX Subsection "unpack_ebook" Unpacks an ebook into its component parts, creating an \s-1OPF\s0 for them if necessary. .PP \fIOptions\fR .IX Subsection "Options" .ie n .IP """\-\-input"" =item ""\-i""" 4 .el .IP "\f(CW\-\-input\fR =item \f(CW\-i\fR" 4 .IX Item "--input =item -i" The filename of the ebook to unpack. This can also be specified as the first non-option argument, in which case it will override the option if it exists. .ie n .IP """\-\-dir"" =item ""\-d""" 4 .el .IP "\f(CW\-\-dir\fR =item \f(CW\-d\fR" 4 .IX Item "--dir =item -d" The directory to unpack into, which will be created if it does not exist, defaulting to the filename with the extension removed. This can also be specified as the second non-option argument, in which case it will override the option if it exists. .ie n .IP """\-\-format""" 4 .el .IP "\f(CW\-\-format\fR" 4 .IX Item "--format" The unpacking routines should autodetect the type of book under normal conditions. If autodetection fails, a format can be forced here. See EBook::Tools::Unpack for a list of available formats. .ie n .IP """\-\-htmlconvert""" 4 .el .IP "\f(CW\-\-htmlconvert\fR" 4 .IX Item "--htmlconvert" Attempt to convert the extracted text to \s-1HTML.\s0 This is obviously only of value if the format doesn't use \s-1HTML\s0 normally. .ie n .IP """\-\-raw""" 4 .el .IP "\f(CW\-\-raw\fR" 4 .IX Item "--raw" This causes a lot of raw, unparsed, unmodified data to be dumped into the directory along with everything else. It's useful for debugging exactly what was in the file being unpacked, but not for much else. .ie n .IP """\-\-author""" 4 .el .IP "\f(CW\-\-author\fR" 4 .IX Item "--author" Set the primary author of the unpacked e\-book, overriding what is detected. Not all e\-book formats contain author metadata, and if none is found and this is not specified the primary author will be set to \&'Unknown Author'. .ie n .IP """\-\-title""" 4 .el .IP "\f(CW\-\-title\fR" 4 .IX Item "--title" Set the title of the unpacked e\-book, overriding what is detected. A title will always be detected in some form from the e\-book, but the exact text can be overridden here. .ie n .IP """\-\-opffile""" 4 .el .IP "\f(CW\-\-opffile\fR" 4 .IX Item "--opffile" .PD 0 .ie n .IP """\-\-opf""" 4 .el .IP "\f(CW\-\-opf\fR" 4 .IX Item "--opf" .PD The filename of the \s-1OPF\s0 metadata file that will be generated. If not specified, defaults to \f(CW\*(C`content.opf\*(C'\fR. .ie n .IP """\-\-tidy""" 4 .el .IP "\f(CW\-\-tidy\fR" 4 .IX Item "--tidy" Run tidy on any \s-1HTML\s0 output files to convert them to valid \s-1XHTML.\s0 Be warned that this can occasionally change the formatting, as Tidy isn't very forgiving on certain common tricks (such as empty
 elements
with style elements) that abuse the standard.
.ie n .IP """\-\-tidycmd""" 4
.el .IP "\f(CW\-\-tidycmd\fR" 4
.IX Item "--tidycmd"
The tidy executable name.  This has to be a fully qualified pathname
if tidy isn't on the path.  Defaults to 'tidy'.
.ie n .IP """\-\-tidysafety""" 4
.el .IP "\f(CW\-\-tidysafety\fR" 4
.IX Item "--tidysafety"
The safety level to use when running tidy (default is 1).  Potential
values are:
.ie n .IP """$tidysafety < 1"":" 4
.el .IP "\f(CW$tidysafety < 1\fR:" 4
.IX Item "$tidysafety < 1:"
No checks performed, no error files kept, works like a clean tidy \-m
.Sp
This setting is \s-1DANGEROUS\s0!
.ie n .IP """$tidysafety == 1"":" 4
.el .IP "\f(CW$tidysafety == 1\fR:" 4
.IX Item "$tidysafety == 1:"
Overwrites original file if there were no errors, but even if there
were warnings.  Keeps a log of errors, but not warnings.
.ie n .IP """$tidysafety == 2"":" 4
.el .IP "\f(CW$tidysafety == 2\fR:" 4
.IX Item "$tidysafety == 2:"
Overwrites original file if there were no errors, but even if there
were warnings.  Keeps a log of both errors and warnings.
.ie n .IP """$tidysafety == 3"":" 4
.el .IP "\f(CW$tidysafety == 3\fR:" 4
.IX Item "$tidysafety == 3:"
Overwrites original file only if there were no errors or warnings.
Keeps a log of both errors and warnings.
.ie n .IP "$tidysafety = 4>:" 4
.el .IP "\f(CW$tidysafety \fR= 4>:" 4
.IX Item "$tidysafety = 4>:"
Never overwrites original file.  Keeps a log of both errors and
warnings.
.PP
\fIExamples\fR
.IX Subsection "Examples"
.PP
.Vb 2
\& ebook unpack mybook.pdb My_Book \-\-author "By Me"
\& ebook unpack \-i mybook.pdb \-d My_Book \-\-author "By Me"
.Ve
.PP
Both of the above commands do the same thing
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.Vb 5
\& ebook splitmeta book.html mybook.opf
\& ebook tidyxhtml book.html
\& ebook tidyxml mybook.opf
\& ebook fix mybook.opf \-\-oeb12 \-\-mobi
\& ebook genepub
\&
\& ebook blank newbook.opf \-\-title "My Title" \-\-author "My Name"
\& ebook adddoc myfile.html
\& ebook fix newbook.opf \-\-opf20 \-v
\& ebook genepub
\&
\& ebook unpack mybook.pdb my_book
\& cd my_book
\& ebook addoc new_document.html
\& ebook fix
\& ebook genepub
.Ve
.SH "BUGS/TODO"
.IX Header "BUGS/TODO"
.IP "\(bu" 4
Need to implement a one-pass conversion from one format to
another.  This will wait until more formats are supported by the
underlying modules, however.
.IP "\(bu" 4
Documentation is incomplete
.IP "\(bu" 4
Not all configuration file options are actually used
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright 2008 Zed Pobre
.SH "LICENSE"
.IX Header "LICENSE"
Licensed to the public under the terms of the \s-1GNU GPL,\s0 version 2.