lib/softcover/builders/epub.rb in softcover-0.8.9 vs lib/softcover/builders/epub.rb in softcover-0.9.0

- old
+ new

@@ -175,24 +175,16 @@ source.at_css('div#book').children.to_xhtml end # Returns the PhantomJS executable (if available). def phantomjs - filename = `which phantomjs`.chomp - message = "Install PhantomJS (http://phantomjs.org/)" - @phantomjs ||= executable(filename, message) + @phantomjs ||= executable(dependency_filename(:phantomjs)) end # Returns the Inkscape executable (if available). def inkscape - filename = `which inkscape`.chomp - if filename.empty? - filename = '/Applications/Inkscape.app/Contents/Resources/bin/' + - 'inkscape' - end - message = "Install Inkscape (http://inkscape.org/)" - @inkscape ||= executable(filename, message) + @inkscape ||= executable(dependency_filename(:inkscape)) end # Strip attributes that are invalid in EPUB documents. def strip_attributes(doc) attrs = %w[data-tralics-id data-label data-number data-chapter @@ -340,10 +332,11 @@ <item id="page-template.xpgt" href="styles/page-template.xpgt" media-type="application/vnd.adobe-page-template+xml"/> <item id="pygments.css" href="styles/pygments.css" media-type="text/css"/> <item id="softcover.css" href="styles/softcover.css" media-type="text/css"/> <item id="epub.css" href="styles/epub.css" media-type="text/css"/> <item id="custom.css" href="styles/custom.css" media-type="text/css"/> + <item id="custom_epub.css" href="styles/custom_epub.css" media-type="text/css"/> <item id="cover" href="cover.html" media-type="application/xhtml+xml"/> #{man_ch.join("\n")} #{images.join("\n")} </manifest> <spine toc="ncx"> @@ -399,11 +392,11 @@ </ncx> ) end def chapter_name(n) - n == 0 ? "Frontmatter" : "Chapter #{n}" + n == 0 ? language_labels["frontmatter"] : chapter_label(n) end # Returns the nav HTML content. def nav_html title = manifest.title @@ -438,9 +431,10 @@ <title>#{title}</title> <link rel="stylesheet" href="styles/pygments.css" type="text/css" /> <link rel="stylesheet" href="styles/softcover.css" type="text/css" /> <link rel="stylesheet" href="styles/epub.css" type="text/css" /> <link rel="stylesheet" href="styles/custom.css" type="text/css"/> + <link rel="stylesheet" href="styles/custom_epub.css" type="text/css"/> <link rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="styles/page-template.xpgt" /> </head> <body> #{content} \ No newline at end of file