riven 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -8
  3. data/bin/riven +14 -2
  4. data/lib/riven/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 008047306f4c2ab59f87def70a4c693ced369317
4
- data.tar.gz: eaeda48e4729dfa31a9f2b1ec5099f56287822b3
3
+ metadata.gz: aa05e90381bb0b9fd7adb2882e108d05e495f52d
4
+ data.tar.gz: 28a6520e004ff62293249f6dd208dff89120f373
5
5
  SHA512:
6
- metadata.gz: eac5f24347db72f2733e8f689e25cf3f18e8e8cd17aedbbe4bfd4bf6d287430c450e88632872e21a2c45a3a99a45f9fbd453b00f23a06c8434fcbc1e3140de5f
7
- data.tar.gz: c8c9ce87013335fa09028e2f52feabf11a9112d54557f5afcbfa391342c72f5309bfe61a7c0d4ac83147556f07b2ca078e3c4b7e0f2dd3c2e8b27a081b738c54
6
+ metadata.gz: b802c9d1d5e85df1da3481da05424a7330bc3d1eced0e8727b00613fb0aeef4a2f500db81090aaf74c8a4245f538ab3e01d9c6d27f186154514b38d9a4390b9c
7
+ data.tar.gz: a2892d3acef47f7503bbbe0a0b0142fead50f820869fd99f00446871bcce51e537dd26e6176910054dee179c789738b07504951832377ce952b2f5d41cece743
data/README.md CHANGED
@@ -6,13 +6,12 @@ Converts GitHub Flavored Markdown files to PDFs! Feature highlights:
6
6
  - Syntax Highlighting with GitHub like theme
7
7
  - Smart page breaks
8
8
  - Smart directory based file merging
9
+ - Smart output file naming
9
10
  - Page numbers (see *Prerequisites* section)
10
11
  - ~~Custom CSS~~ (not finised yet, sorry)
11
12
  - Covers (see *Prerequisites* section)
12
13
  - Table of Contents (see *Prerequisites* section)
13
14
 
14
- The gem is still under development, but it already works. In the current version the output PDF file name will always be `test.pdf`. This will change soon.
15
-
16
15
 
17
16
  ## Prerequisites
18
17
 
@@ -67,7 +66,7 @@ $ riven -o awesome.pdf example-1.md example-2.pdf
67
66
 
68
67
  ### A directory
69
68
 
70
- This will take your `documentation` directory with all it's files and generate a `doc.pdf` in the same directory:
69
+ This will take your `documentation` directory with all it's files and generate a `documentation.pdf` (the name is guessed from the directory name, but you may also specify a output file name via the `-o` param) in the same directory:
71
70
 
72
71
  ```bash
73
72
  $ ls
@@ -80,10 +79,10 @@ chapter-3-admin-gui.md
80
79
  chapter-4-commandline-interface.md
81
80
  chapter-5-api.md
82
81
 
83
- $ riven -o doc.pdf documentation/
82
+ $ riven documentation/
84
83
 
85
84
  $ ls
86
- doc.pdf
85
+ documentation.pdf
87
86
  documentation/
88
87
  ```
89
88
 
@@ -95,7 +94,7 @@ documentation/
95
94
  You may give riven an additional CSS file with the `-s` param:
96
95
 
97
96
  ```bash
98
- $ riven -s doc.css -o doc.pdf documentation/
97
+ $ riven -s doc.css documentation/
99
98
  ```
100
99
 
101
100
 
@@ -104,7 +103,7 @@ $ riven -s doc.css -o doc.pdf documentation/
104
103
  You may give riven a cover MD file via the `-c` param, which will be prepended and not provided with a page number.
105
104
 
106
105
  ```bash
107
- $ riven -c documentation/cover.md -o doc.pdf documentation/
106
+ $ riven -c documentation/cover.md documentation/
108
107
  ```
109
108
 
110
109
 
@@ -128,5 +127,5 @@ The syntax highlightning is powered by [coderay](https://github.com/rubychan/cod
128
127
  For an automatic generated table of contents after the cover, just add the `-t` param and provide a headline for the table of contents:
129
128
 
130
129
  ```bash
131
- $ riven -t "Contents" -c documentation/cover.md -o doc.pdf documentation/
130
+ $ riven -t "Contents" -c documentation/cover.md documentation/
132
131
  ```
data/bin/riven CHANGED
@@ -37,8 +37,20 @@ generator = Riven::HTMLGenerator.new('_riven_tmp_file.html', markup)
37
37
 
38
38
 
39
39
  ## Step 6: Determine PDF file name
40
- # TODO auto generate output file name or take it from the options
41
- output_file = 'test.pdf'
40
+ output_file = options[:output_file]
41
+
42
+ if output_file.empty?
43
+ unless options[:dir_given] === false
44
+ output_file = options[:dir_given] + '.pdf'
45
+ else
46
+ puts "No output file name given. Please specify output file name via -o param."
47
+ generator.close!
48
+ cover_generator.close!
49
+ exit
50
+ end
51
+ end
52
+
53
+ puts "Output file: #{output_file}" if options[:verbose]
42
54
 
43
55
 
44
56
  ## Step 7: Generate the PDF file from HTML file
data/lib/riven/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Riven
2
- VERSION = '0.1.3'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Kammerl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-18 00:00:00.000000000 Z
11
+ date: 2015-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler