asciidoctor-kindle 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d247792f28f1a7309807eef9de85f9222ab337a6
4
- data.tar.gz: 9ce35e28e4dbd484502e5bd351bf9e7aa0abf5ff
3
+ metadata.gz: abef29d1d8fdacfe51639e6b8eec14e66dd2db4f
4
+ data.tar.gz: 49b1a9158e7ef27b90aaad006350452ec549f72c
5
5
  SHA512:
6
- metadata.gz: b7ca402a67727e2ed7510c535b2fec1b4925407b8a0043afad918d675ca296f8602ccc4ed3e440a579306b20e5002e4d57c907090adc5ae0c6515821dc720e76
7
- data.tar.gz: 17d63da023d98685deafcc82656473cd1374c49dfa0f47667a8c45c63329e1ad8996a1f71574bf11a4c40125cba17f905ebbd994d8f582464398cbd52780743d
6
+ metadata.gz: 320b7bcaaba19e373adb9661955ebb6db13a48067c7f4c2dbea576223a826501be9b10744888c2e6c8a7a66fe0b2d1ba9534bfea47090156b54beaccd7bc080b
7
+ data.tar.gz: 6f993cc9ae6155bd516a301b016083783783bc5db53916f68300adcc77909402c7a72b4cf162022bec4586d40cd969a8813053a2437b6e067821c2becad18a86
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # asciidoctor-kindle
2
2
 
3
3
  [![Build Status](https://travis-ci.org/midnightSuyama/asciidoctor-kindle.svg?branch=master)](https://travis-ci.org/midnightSuyama/asciidoctor-kindle)
4
+ [![Gem Version](https://badge.fury.io/rb/asciidoctor-kindle.svg)](http://badge.fury.io/rb/asciidoctor-kindle)
4
5
 
5
6
  Asciidoctor extension for converting html to mobi
6
7
 
@@ -24,7 +25,7 @@ or
24
25
  ## Document Attributes
25
26
 
26
27
  * `kindle-uid` - unique-identifier in OPF
27
- * `kindle-description` - dc:description in OPF
28
+ * `kindle-publisher` - dc:publisher in OPF
28
29
  * `kindle-cover` - cover-image in OPF
29
30
 
30
31
  ## Development
@@ -1,23 +1,23 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'asciidoctor'
4
- require 'asciidoctor/cli'
5
- require 'kindlegen'
6
-
7
- options = Asciidoctor::Cli::Options.new
8
- options[:requires] = ['asciidoctor-kindle']
9
- options[:output_file] = 'kindle-content.html'
10
- options.parse! ARGV
11
-
12
- invoker = Asciidoctor::Cli::Invoker.new options
13
- GC.start
14
- invoker.invoke!
15
-
16
- if invoker.code == 0
17
- stdout, stderr, status = Kindlegen.run(options[:output_file], '-o', 'kindle-published.mobi')
18
- if status == 0
19
- puts stdout
20
- else
21
- $stderr.puts stderr
22
- end
23
- end
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'asciidoctor'
4
+ require 'asciidoctor/cli'
5
+ require 'kindlegen'
6
+
7
+ options = Asciidoctor::Cli::Options.new
8
+ options[:requires] = ['asciidoctor-kindle']
9
+ options[:output_file] = 'kindle-content.html'
10
+ options.parse! ARGV
11
+
12
+ invoker = Asciidoctor::Cli::Invoker.new options
13
+ GC.start
14
+ invoker.invoke!
15
+
16
+ if invoker.code == 0
17
+ stdout, stderr, status = Kindlegen.run('kindle-package.opf', '-o', 'kindle-published.mobi')
18
+ if status == 0
19
+ puts stdout
20
+ else
21
+ $stderr.puts stderr
22
+ end
23
+ end
@@ -36,7 +36,6 @@ class KindlePostprocessor < Extensions::Postprocessor
36
36
  uid = doc.attr('kindle-uid', 'asciidoctor-kindle')
37
37
  title = doc.attr('doctitle')
38
38
  creator = doc.attr('author')
39
- description = doc.attr('kindle-description')
40
39
  publisher = doc.attr('kindle-publisher', doc.attr('author'))
41
40
  date = doc.attr('docdate')
42
41
  language = doc.attr('lang', 'en')
@@ -45,14 +44,14 @@ class KindlePostprocessor < Extensions::Postprocessor
45
44
  cover_path = doc.attr('kindle-cover')
46
45
 
47
46
  str = %(<?xml version="1.0" encoding="utf-8"?>
48
- <package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="#{uid}">
47
+ <package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="BookId">
49
48
  <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
50
49
  <dc:title>#{title}</dc:title>
51
50
  <dc:creator>#{creator}</dc:creator>
52
- <dc:description>#{description}</dc:description>
53
51
  <dc:publisher>#{publisher}</dc:publisher>
54
52
  <dc:date>#{date}</dc:date>
55
53
  <dc:language>#{language}</dc:language>
54
+ <dc:identifier id="BookId">#{uid}</dc:identifier>
56
55
  </metadata>
57
56
  <manifest>
58
57
  <item id="content" media-type="text/html" href="#{content_path}" />
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Kindle
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-kindle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - midnightSuyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-25 00:00:00.000000000 Z
11
+ date: 2019-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake