3 ###APPAUTHOR: xiaoranzzz
4 ###APPDATE: Sat Jun 5 00:08:28 2010
8 ###APPEXAMPLE: epub_blank
12 #ENV variable MUST be defined somewhere,
13 #FOR perl to search modules from,
15 use lib
$ENV{XR_PERL_MODULE_DIR
};
17 use MyPlace
::Script
::Usage qw
/help_required help_even_empty/;
18 exit 0 if(help_required
($0,@ARGV));
19 #exit 0 if(help_even_empty($0,@ARGV));
25 mkdir $_ or die("$!\n");
26 print STDERR
"directory created $_ \n";
31 print STDERR
"Creating $file ...";
33 print STDERR
" [Ignored] File exist.\n";
36 open FO
,">:utf8",$file or die("$!\n");
39 print STDERR
" [OK]\n";
45 print STDERR
"change to \"$dir\"\n";
46 chdir $dir or die("$!\n");
50 make_directory
("META-INF");
52 "META-INF/container.xml",
54 <?xml version="1.0" encoding="UTF-8" ?>
55 <container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
57 <rootfile full-path="OPS/content.opf" media-type="application/oebps-package+xml"/>
65 "application/epub+zip",
68 make_directory
("OPS");
72 use POSIX qw
/strftime/;
73 my $date=strftime
"%Y-%m-%d",localtime;
78 <?xml version="1.0" encoding="UTF-8" ?>
79 <package version="2.0" unique-identifier="PrimaryID" xmlns="http://www.idpf.org/2007/opf">
80 <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
81 <dc:title>NO TITLE</dc:title>
84 "<dc:identifier id=\"PrimaryID\" opf:scheme=\"URN\">urn:uuid:$opf_uuid</dc:identifier>\n"
86 "<dc:date opf:event=\"original-publication\">$date</dc:date>\n"
89 <dc:language>en</dc:language>
90 <dc:creator opf:role="aut" opf:file-as="NO CREATOR">NO CREATOR</dc:creator>
91 <dc:publisher>NO PUBLISHER</dc:publisher>
92 <dc:description>NO DESCRIPTION</dc:description>
93 <dc:coverage>NO COVERAGE</dc:coverage>
94 <dc:source>NO SOURCE</dc:source>
95 <dc:rights>NO RIGHTS</dc:rights>
96 <dc:subject>NO SUBJECT</dc:subject>
97 <dc:subject>NO SUBJECT</dc:subject>
98 <meta name="cover" content="images-cover"/>
102 <!-- Content Documents -->
105 media-type="application/xhtml+xml"/>
106 <item id="images-cover"
107 href="images/cover.jpg"
108 media-type="image/jpeg"/>
111 media-type="text/css"/>
114 media-type="application/x-dtbncx+xml"/>
118 <itemref idref="cover" linear="yes"/>
122 <reference type="cover" title="Cover" href="cover.xhtml"/>
129 my $ncx_uuid = `uuid`;
134 <?xml version="1.0" encoding="UTF-8"?>
137 "-//NISO//DTD ncx 2005-1//EN"
138 "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
140 <ncx version="2005-1"
142 xmlns="http://www.daisy.org/z3986/2005/ncx/">
145 <!-- The following four metadata items are required for all
146 NCX documents
, including those conforming to the relaxed
147 constraints of OPS
2.0 -->
150 "<meta name=\"dtb:uid\" content=\"$ncx_uuid\"/>\n"
153 <meta name="dtb:depth" content="1"/>
154 <meta name="dtb:totalPageCount" content="0"/>
155 <meta name="dtb:maxPageNumber" content="0"/>
158 <text>NO TITLE</text>
161 <text>NO AUTHOR</text>
164 <navPoint class="cover" id="cover" playOrder="1">
165 <navLabel><text>Cover</text></navLabel>
166 <content src="cover.xhtml"/>
176 <?xml version="1.0" encoding="UTF-8" ?>
177 <!DOCTYPE html PUBLIC
178 "-//W3C//DTD XHTML 1.1//EN"
179 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
180 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
183 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/>
186 <div style="text-align: center; page-break-after: always;">
187 <img src="images/cover.jpg" alt="Cover" style="height: 100%; max-width: 100%;" />
194 make_directory
("OPS/images");
195 make_directory
("OPS/css");