diff options
| author | Marat Radchenko <marat@slonopotamus.org> | 2020-02-19 00:50:22 +0300 |
|---|---|---|
| committer | Marat Radchenko <marat@slonopotamus.org> | 2020-02-19 00:52:20 +0300 |
| commit | 76dc5a62369ee0f32757de7a741b40a00a7254d8 (patch) | |
| tree | 7324f3b9209a0092168ba3ccc74ad5d826dbb9cc /lib | |
| parent | dbc49ec1a67c359d60190d8b9c235b4a0d307d9b (diff) | |
fix logging to work through logger
fix front matter files to be actually added to spine (and test that)
fix image data not being included into epub
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/asciidoctor-epub3/converter.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/asciidoctor-epub3/converter.rb b/lib/asciidoctor-epub3/converter.rb index 0221ac3..d1ea8e5 100644 --- a/lib/asciidoctor-epub3/converter.rb +++ b/lib/asciidoctor-epub3/converter.rb @@ -1185,14 +1185,14 @@ body > svg { fmglob = 'front-matter.*\.html' fm_path = File.join workdir, fmdir unless Dir.exist? fm_path - warn %(Directory specified by 'epub3-frontmattderdir' doesn't exist! Ignoring ...) + logger.warn %(#{File.basename doc.attr('docfile')}: directory specified by 'epub3-frontmattderdir' doesn't exist! Ignoring ...) return [] end fms = Dir.entries(fm_path).delete_if {|x| !x.match fmglob }.sort.map {|y| File.join fm_path, y } if fms && !fms.empty? fms else - warn %(Directory specified by 'epub3-frontmattderdir' contains no suitable files! Ignoring ...) + logger.warn %(#{File.basename doc.attr('docfile')}: directory specified by 'epub3-frontmattderdir' contains no suitable files! Ignoring ...) [] end elsif File.exist? File.join workdir, 'front-matter.html' @@ -1210,11 +1210,11 @@ body > svg { front_matter_content = ::File.read front_matter front_matter_file = File.basename front_matter, '.html' - item = @book.add_item "#{front_matter_file}.xhtml", content: (postprocess_xhtml front_matter_content) + item = @book.add_ordered_item "#{front_matter_file}.xhtml", content: (postprocess_xhtml front_matter_content) item.add_property 'svg' if SvgImgSniffRx =~ front_matter_content front_matter_content.scan ImgSrcScanRx do - @book.add_item $1 + @book.add_item $1, content: File.join(File.dirname(front_matter), $1) end end |
