riven 0.2.3 → 1.0.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: b1d117bb28849bf853e60b1179ebaf189c71b557
4
- data.tar.gz: 17a3563e18c4ee0530447ee9f134933a3c144679
3
+ metadata.gz: 9026432e44de597f708d32e6a6f9078c74979887
4
+ data.tar.gz: ca3317794a93a2b38cf230b019038cb8dbb29973
5
5
  SHA512:
6
- metadata.gz: 455d2973ba8b3581740aba2936cd634d5bc296c8f95262d756d184a92ae5747126183ed45e5428e9d2ed1df1b559212ab6b937e615802e782e3e36ddafb767c8
7
- data.tar.gz: ace7ce6e9e1d986f8eb5f42f96f9f20babff94e6b75efbeba2854ab341895436c8c45bdfd9b7c413b34276108f6be1962127fe29a31cb2918ab7e05d56e177ec
6
+ metadata.gz: cfd8f5f09553ec152557d7b75bffbee260cd97690ec10c3be63d739c04c362a094dec5bec57cace7b4d19c3bedfccfb7548cd95c53ccd8ad0cfefe89775f3b0a
7
+ data.tar.gz: 74e4d622e11d3fc0455cf921763522b80ac1755dd7642adc14652d960f816a3a63cc4ea1dfd88d8ed65c909e9b490b9b41ad4bd1231832bb2ee76f29bdd929a4
data/README.md CHANGED
@@ -8,7 +8,7 @@ Converts GitHub Flavored Markdown files to PDFs! Feature highlights:
8
8
  - Smart directory based file merging
9
9
  - Smart output file naming
10
10
  - Page numbers (see *Prerequisites* section)
11
- - ~~Custom CSS~~ (not finised yet, sorry)
11
+ - Custom CSS
12
12
  - Covers (see *Prerequisites* section)
13
13
  - Table of Contents (see *Prerequisites* section)
14
14
 
@@ -97,6 +97,8 @@ You may give riven an additional CSS file with the `-s` param:
97
97
  $ riven -s doc.css documentation/
98
98
  ```
99
99
 
100
+ unfortunately this CSS doesn't affect the table of contents currently, sorry for that.
101
+
100
102
 
101
103
  ### Cover
102
104
 
data/bin/riven CHANGED
@@ -28,12 +28,12 @@ end
28
28
  unless options[:cover_file] === ''
29
29
  cover_markup = Riven::MarkupFile.read_cover(options[:cover_file])
30
30
  end
31
- cover_generator = Riven::HTMLGenerator.new('_riven_cover_tmp_file.html', cover_markup || '')
31
+ cover_generator = Riven::HTMLGenerator.new('_riven_cover_tmp_file.html', cover_markup || '', options)
32
32
 
33
33
 
34
34
  ## Step 5: Generate HTML for main document
35
35
  markup = Riven::MarkupFile.read_all(files, options[:cover_file])
36
- generator = Riven::HTMLGenerator.new('_riven_tmp_file.html', markup)
36
+ generator = Riven::HTMLGenerator.new('_riven_tmp_file.html', markup, options)
37
37
 
38
38
 
39
39
  ## Step 6: Determine PDF file name
@@ -7,10 +7,11 @@ module Riven
7
7
  class HTMLGenerator
8
8
  attr_accessor :html, :html_file
9
9
 
10
- public def initialize(tmp_file, markup)
10
+ public def initialize(tmp_file, markup, options)
11
11
  @html_file = Riven::HTMLFile.new(tmp_file)
12
12
 
13
13
  @markup = markup
14
+ @options = options
14
15
 
15
16
  @html = generate_html
16
17
  @html_file.write(@html)
@@ -19,6 +20,11 @@ module Riven
19
20
  public def generate_html
20
21
  css = File.read(File.expand_path(File.dirname(__FILE__)) + '/../../css/style.css')
21
22
 
23
+ unless @options[:css_file].empty?
24
+ css << "\n\n"
25
+ css << File.read(@options[:css_file])
26
+ end
27
+
22
28
  html = '<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
23
29
  html << '<style type="text/css">' + css + '</style></head><body>'
24
30
  html << markup_to_html(@markup)
@@ -52,7 +52,7 @@ module Riven
52
52
  end
53
53
 
54
54
  opts.on("-s FILE", "--css=FILE", "Path to the custom CSS file") do |css_file|
55
- options[:css_file] = css_file
55
+ options[:css_file] = File.expand_path(css_file)
56
56
  end
57
57
 
58
58
  opts.on("-c FILE", "--cover=FILE", "Path to the cover MD file") do |cover_file|
data/lib/riven/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Riven
2
- VERSION = '0.2.3'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Kammerl