riven 1.1.4 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/Gemfile.lock +2 -5
- data/README.md +20 -153
- data/bin/riven +17 -18
- data/doc/chapters/1-what-is-riven/1-scenario-a.md +12 -0
- data/doc/chapters/1-what-is-riven/2-scenario-b.md +8 -0
- data/doc/chapters/1-what-is-riven/3-what-is-riven-not.md +16 -0
- data/doc/chapters/1-what-is-riven/4-why-was-riven-created.md +35 -0
- data/doc/chapters/1-what-is-riven/5-how-can-i-support-riven.md +7 -0
- data/doc/chapters/1-what-is-riven/index.md +15 -0
- data/doc/chapters/2-setup/1-prerequisites.md +49 -0
- data/doc/chapters/2-setup/2-installation.md +17 -0
- data/doc/chapters/2-setup/index.md +6 -0
- data/doc/chapters/3-basics/1-single-file.md +19 -0
- data/doc/chapters/3-basics/2-multiple-files.md +65 -0
- data/doc/chapters/3-basics/3-structured-files.md +55 -0
- data/doc/chapters/3-basics/4-config-file.md +63 -0
- data/doc/chapters/3-basics/index.md +17 -0
- data/doc/chapters/4-advanced-usage/1-css.md +34 -0
- data/doc/chapters/4-advanced-usage/2-table-of-contents.md +11 -0
- data/doc/chapters/4-advanced-usage/3-cover.md +10 -0
- data/doc/chapters/4-advanced-usage/4-syntax-highlighting.md +23 -0
- data/doc/chapters/4-advanced-usage/index.md +10 -0
- data/doc/cover.md +37 -0
- data/doc/img/cover.png +0 -0
- data/doc/index.md +4 -0
- data/doc/riven.pdf +0 -0
- data/doc/riven.yml +10 -0
- data/doc/style.css +21 -0
- data/lib/riven/config.rb +122 -0
- data/lib/riven/html_generator.rb +4 -4
- data/lib/riven/markup_file.rb +1 -1
- data/lib/riven/opt_parser.rb +48 -33
- data/lib/riven/version.rb +1 -1
- data/lib/riven/wkhtmltopdf.rb +7 -7
- metadata +28 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1db4e60b13dcba67d9b6bd7fd7708f395a6d26c2
|
4
|
+
data.tar.gz: b285fa0211720e1c5ab51192cc2cf87843880fa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d9c706678b7e24eab37c4d24f038c7e6124dbcb652fc26d720abe12681fc92c0a5334ded8cb52cdd7542ba7251fcd762eb94155d2f48f2d7e610ae8ac27264b
|
7
|
+
data.tar.gz: be65f9e746417996f225a886ab531c99e4871d90f15f8f1bb8fd75c866b9b520541c22986f7db1391e6b42ae461e5f2edbec79753511e3c23a36a6fc60ea2cb7
|
data/.gitignore
CHANGED
@@ -17,7 +17,6 @@ build/
|
|
17
17
|
## Documentation cache and generated files:
|
18
18
|
/.yardoc/
|
19
19
|
/_yardoc/
|
20
|
-
/doc/
|
21
20
|
/rdoc/
|
22
21
|
|
23
22
|
## Environment normalisation:
|
@@ -32,3 +31,6 @@ build/
|
|
32
31
|
|
33
32
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
33
|
.rvmrc
|
34
|
+
|
35
|
+
# RubyMine
|
36
|
+
/.idea
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
riven (1.
|
4
|
+
riven (1.2.0)
|
5
5
|
coderay (~> 1.1)
|
6
6
|
redcarpet (~> 3.2)
|
7
7
|
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
coderay (1.1.0)
|
12
12
|
rake (10.4.2)
|
13
|
-
redcarpet (3.3
|
13
|
+
redcarpet (3.2.3)
|
14
14
|
|
15
15
|
PLATFORMS
|
16
16
|
ruby
|
@@ -19,6 +19,3 @@ DEPENDENCIES
|
|
19
19
|
bundler (~> 1.8)
|
20
20
|
rake (~> 10.4)
|
21
21
|
riven!
|
22
|
-
|
23
|
-
BUNDLED WITH
|
24
|
-
1.10.3
|
data/README.md
CHANGED
@@ -1,172 +1,39 @@
|
|
1
1
|
# Riven
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
Riven converts Markdown files into PDF documents! Write documentations, books, reports, everything with your
|
4
|
+
favorite text editor and publish them as PDF - It's that simple and even more powerful.
|
5
5
|
|
6
|
+
**Feature highlights:**
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
- Riven Extended Markdown featuring includes: Structure you work!
|
8
|
+
- Riven Extended Markdown (it's GitHub Flavored Markdown but with more features!)
|
9
|
+
- Include directives: Structure your document!
|
10
10
|
- Generates well readable, optimized, beautiful looking PDFs
|
11
11
|
- Style your PDF via CSS
|
12
12
|
- Define a special and nice looking cover page
|
13
13
|
- Auto generated table of contents
|
14
|
-
- Syntax Highlighting with GitHub
|
15
|
-
- Page numbers
|
14
|
+
- Syntax Highlighting with GitHub theme
|
15
|
+
- Page footer with page numbers
|
16
16
|
- Smart directory based file merging and output file naming
|
17
17
|
|
18
18
|
|
19
|
-
##
|
20
|
-
|
21
|
-
You need `wkhtmltopdf` in order to generate PDFs, since that's the PDF generator backend for riven. You should use the
|
22
|
-
QT patched version of `wkhtmltopdf` to get all the features of riven. You may also use the version without patched qt,
|
23
|
-
but that will disable the following features of riven: Page numbers, table of contents, covers.
|
24
|
-
|
25
|
-
- If you got Arch Linux, you can just install the packages `wkhtmltopdf-static`and `icu48` from the AUR.
|
26
|
-
|
27
|
-
- If you got another Linux Distribution (like Ubuntu) or OSX you have compile `wkhtmltopdf` from the sources. See http://natepinchot.com/2014/01/31/building-static-wkhtmltopdf/. This may take some time: On my i7, 16GB RAM, SSD
|
28
|
-
Notebook it took about 20 minutes.
|
29
|
-
|
30
|
-
- Otherwise, you should download `wkhtmltopdf` from the [official website](http://wkhtmltopdf.org/downloads.html).
|
31
|
-
|
32
|
-
After that, make sure you can execute the `wkhtmltopdf` command in your shell:
|
33
|
-
|
34
|
-
```bash
|
35
|
-
$ wkhtmltopdf -V
|
36
|
-
```
|
37
|
-
|
38
|
-
If it works, everything is nice and you may proceed with the next step. If not, please make sure, `wkhtmltopdf` is
|
39
|
-
correctly installed and the executable is within your `PATH`.
|
40
|
-
|
41
|
-
|
42
|
-
## Installation
|
43
|
-
|
44
|
-
Simple as usual:
|
45
|
-
|
46
|
-
```bash
|
47
|
-
$ gem install riven
|
48
|
-
```
|
49
|
-
|
50
|
-
|
51
|
-
## Usage
|
52
|
-
|
53
|
-
Riven is designed to create documents out of a bunch of markdown files. So it may take a single markdown file or a
|
54
|
-
directory with some markdown files inside. Consider that the files are merged in alphabetical order if you provide a
|
55
|
-
folder. Just take a look at the following examples.
|
56
|
-
|
57
|
-
|
58
|
-
### Single file to PDF
|
59
|
-
|
60
|
-
This will take your `example.md` and generate a `example.pdf` in the same directory:
|
61
|
-
|
62
|
-
```bash
|
63
|
-
$ riven example.md
|
64
|
-
```
|
65
|
-
|
66
|
-
|
67
|
-
### Multiple files
|
68
|
-
|
69
|
-
This will take your `example-1.md` and `example-2.md` and generate a `awesome.pdf` in the same directory:
|
70
|
-
|
71
|
-
```bash
|
72
|
-
$ riven -o awesome.pdf example-1.md example-2.pdf
|
73
|
-
```
|
74
|
-
|
75
|
-
|
76
|
-
### A directory
|
77
|
-
|
78
|
-
This will take your `documentation` directory with all it's files and generate a `documentation.pdf` (the name is
|
79
|
-
guessed from the directory name, but you may also specify a output file name via the `-o` param) in the same
|
80
|
-
directory:
|
81
|
-
|
82
|
-
```bash
|
83
|
-
$ ls
|
84
|
-
documentation/
|
85
|
-
|
86
|
-
$ ls documentation/
|
87
|
-
chapter-1-preface.md
|
88
|
-
chapter-2-general.md
|
89
|
-
chapter-3-admin-gui.md
|
90
|
-
chapter-4-commandline-interface.md
|
91
|
-
chapter-5-api.md
|
92
|
-
|
93
|
-
$ riven documentation/
|
94
|
-
|
95
|
-
$ ls
|
96
|
-
documentation.pdf
|
97
|
-
documentation/
|
98
|
-
```
|
99
|
-
|
100
|
-
|
101
|
-
### Structure via includes
|
102
|
-
|
103
|
-
You may also structure your document via includes. Just define a main file and you may define as many include directives
|
104
|
-
within that file and any other files (even in subdirectories) as you want.
|
105
|
-
|
106
|
-
**index.md**
|
107
|
-
|
108
|
-
```md
|
109
|
-
## Just a example
|
110
|
-
|
111
|
-
This is a include:
|
112
|
-
|
113
|
-
<<[ another_file.md ]
|
114
|
-
```
|
115
|
-
|
116
|
-
**another_file.md**
|
117
|
-
|
118
|
-
```md
|
119
|
-
More **content** in this file.
|
120
|
-
```
|
121
|
-
|
122
|
-
Generate the PDF via:
|
123
|
-
|
124
|
-
```bash
|
125
|
-
$ riven -o awesome.pdf index.md
|
126
|
-
```
|
127
|
-
|
128
|
-
|
129
|
-
## Additional Features
|
130
|
-
|
131
|
-
### Custom CSS
|
132
|
-
|
133
|
-
You may give riven an additional CSS file with the `-s` param:
|
134
|
-
|
135
|
-
```bash
|
136
|
-
$ riven -s doc.css documentation/
|
137
|
-
```
|
138
|
-
|
139
|
-
unfortunately this CSS doesn't affect the table of contents currently, sorry for that.
|
140
|
-
|
141
|
-
|
142
|
-
### Cover
|
143
|
-
|
144
|
-
You may give riven a cover MD file via the `-c` param, which will be prepended and not provided with a page number.
|
145
|
-
|
146
|
-
```bash
|
147
|
-
$ riven -c documentation/cover.md documentation/
|
148
|
-
```
|
149
|
-
|
19
|
+
## Example PDF
|
150
20
|
|
151
|
-
|
21
|
+
The Riven manual itself is generated by Riven.
|
22
|
+
**[See the result](https://github.com/phortx/riven/blob/master/doc/riven.pdf)**!
|
152
23
|
|
153
|
-
Syntax highlighting just works as usual:
|
154
24
|
|
155
|
-
|
156
|
-
```ruby
|
157
|
-
def foo
|
158
|
-
puts 'bar'
|
159
|
-
end
|
160
|
-
```
|
161
|
-
</pre>
|
25
|
+
## Documentation
|
162
26
|
|
163
|
-
|
27
|
+
Read the user manual of Riven:
|
164
28
|
|
29
|
+
- [Online Version on GitHub](https://github.com/phortx/riven/blob/master/doc/chapters/)
|
30
|
+
- [Chapter 1: What is Riven?](https://github.com/phortx/riven/blob/master/doc/chapters/1-what-is-riven/)
|
31
|
+
- [Chapter 2: Setup Riven](https://github.com/phortx/riven/blob/master/doc/chapters/2-setup/)
|
32
|
+
- [Chapter 3: Learn the basics](https://github.com/phortx/riven/blob/master/doc/chapters/3-basics/)
|
33
|
+
- [Chapter 4: Advanced topics](https://github.com/phortx/riven/blob/master/doc/chapters/4-advanced-usage/)
|
34
|
+
- [PDF Version](https://github.com/phortx/riven/blob/master/doc/riven.pdf)
|
165
35
|
|
166
|
-
### Table of Contents
|
167
36
|
|
168
|
-
|
37
|
+
## Contribute
|
169
38
|
|
170
|
-
|
171
|
-
$ riven -t "Contents" -c documentation/cover.md documentation/
|
172
|
-
```
|
39
|
+
Riven just started and there's a lot to do. Contributions are welcome! Feel free to send pull requests :)
|
data/bin/riven
CHANGED
@@ -13,35 +13,34 @@ Riven::Wkhtmltopdf.check_installation
|
|
13
13
|
|
14
14
|
|
15
15
|
## Step 2: Parse command line options
|
16
|
-
|
17
|
-
files = Riven::OptParser.files(options)
|
16
|
+
config = Riven::OptParser.get_config
|
18
17
|
|
19
18
|
|
20
19
|
## Step 3: Change dir if directory is given to ensure the image pathes work
|
21
|
-
unless
|
20
|
+
unless config.dir_given === false
|
22
21
|
working_dir = Dir.pwd
|
23
|
-
Dir.chdir
|
22
|
+
Dir.chdir config.dir_given
|
24
23
|
end
|
25
24
|
|
26
25
|
|
27
26
|
## Step 4: Generate HTML for cover
|
28
|
-
unless
|
29
|
-
cover_markup = Riven::MarkupFile.read_cover(
|
27
|
+
unless config.cover_file === ''
|
28
|
+
cover_markup = Riven::MarkupFile.read_cover(config.cover_file)
|
30
29
|
end
|
31
|
-
cover_generator = Riven::HTMLGenerator.new('_riven_cover_tmp_file.html', cover_markup || '',
|
30
|
+
cover_generator = Riven::HTMLGenerator.new('_riven_cover_tmp_file.html', cover_markup || '', config)
|
32
31
|
|
33
32
|
|
34
33
|
## Step 5: Generate HTML for main document
|
35
|
-
markup = Riven::MarkupFile.read_all(files,
|
36
|
-
generator = Riven::HTMLGenerator.new('_riven_tmp_file.html', markup,
|
34
|
+
markup = Riven::MarkupFile.read_all(config.files, config.cover_file)
|
35
|
+
generator = Riven::HTMLGenerator.new('_riven_tmp_file.html', markup, config)
|
37
36
|
|
38
37
|
|
39
38
|
## Step 6: Determine PDF file name
|
40
|
-
output_file =
|
39
|
+
output_file = config.pdf_output_file
|
41
40
|
|
42
41
|
if output_file.empty?
|
43
|
-
unless
|
44
|
-
output_file =
|
42
|
+
unless config.dir_given === false
|
43
|
+
output_file = config.dir_given + '.pdf'
|
45
44
|
else
|
46
45
|
puts "No output file name given. Please specify output file name via -o param."
|
47
46
|
generator.close!
|
@@ -50,12 +49,12 @@ if output_file.empty?
|
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
53
|
-
puts "Output file: #{output_file}" if
|
52
|
+
puts "Output file: #{output_file}" if config.dir_given
|
54
53
|
|
55
54
|
|
56
55
|
## Step 7: Generate the PDF file from HTML file
|
57
|
-
output = Riven::Wkhtmltopdf.generate_pdf(generator.html_file, cover_generator.html_file, output_file,
|
58
|
-
puts output if
|
56
|
+
output = Riven::Wkhtmltopdf.generate_pdf(generator.html_file, cover_generator.html_file, output_file, config)
|
57
|
+
puts output if config.verbose
|
59
58
|
|
60
59
|
|
61
60
|
## Step 8: Close the generators
|
@@ -64,13 +63,13 @@ cover_generator.close!
|
|
64
63
|
|
65
64
|
|
66
65
|
## Step 9: Dump the HTML code if requested
|
67
|
-
puts generator.html if
|
68
|
-
puts cover_generator.html if
|
66
|
+
puts generator.html if config.dump_html
|
67
|
+
puts cover_generator.html if config.dump_cover_html
|
69
68
|
|
70
69
|
|
71
70
|
## Step 10: If we changed the directory before, the PDF file is now located in the wrong directory,
|
72
71
|
## so wie have to move it
|
73
|
-
unless
|
72
|
+
unless config.dir_given === false
|
74
73
|
require 'fileutils'
|
75
74
|
FileUtils.mv output_file, working_dir + '/' + output_file
|
76
75
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
## 1.1. Scenario A: You want to write a book
|
2
|
+
|
3
|
+
You are a bit familiar with Linux or OSX. Maybe you even know what markdown is, but it's okay if you don't know markdown.
|
4
|
+
And you want to write a book for some reason. Maybe a subject book, maybe a novel or maybe some fanfiction for whatever
|
5
|
+
you like. But you have no idea of LaTeX and you don't want to write it in LibreOffice or some other kind of office
|
6
|
+
suite for some reason. Maybe because you want to have full control over all formatings and you love a text editor like
|
7
|
+
atom, sublime editor or vim. You also know HTML and CSS maybe, but you don't want to use it since it's to much code to
|
8
|
+
write and you have to test to it too often in you browser while writing.
|
9
|
+
|
10
|
+
What you want is just a very simple and lean tool chain which let's you write a very minimalistic markup in your
|
11
|
+
favorite text editor and compiles everything in a beautiful, readable and stylish PDF (and mobi, epub etc in the
|
12
|
+
future). And if something doesn't fit your requirements, you just change it via CSS or configuration.
|
@@ -0,0 +1,8 @@
|
|
1
|
+
## 1.2. Scenario B: Your a coder and want to document your software
|
2
|
+
|
3
|
+
You have a software project, you're familiar with Linux or OSX, HTML, CSS, Markdown and others. And you want to document
|
4
|
+
your software in a plain text readable format. But you also want a very simple and lean tool chain which compiles
|
5
|
+
everything in a beautiful, readable and stylish PDF (and mobi, epub etc in the future). And if something doesn't fit
|
6
|
+
your requirements, you just change it via CSS or configuration. Also you want to use your favorite text editor like atom, sublime editor or vim but don't want to write the documentation in HTML and CSS since it's to much code to write and you
|
7
|
+
have to test to it too often in you browser while writing. And you don't want to write it in LibreOffice or some other
|
8
|
+
kind of office suite for some reason. For example because you're working in a team and you're using some kind of version control system like git. Therefore a plain text format is much more beneficial then a binary blob.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
## 1.3. What is Riven not?
|
2
|
+
|
3
|
+
Now you may have a clue what Riven is. But it's maybe even more important to understand what riven actually is **not**.
|
4
|
+
Well Riven is neither a editor like atom nor a typesetting system like TeX nor a markup language like markdown or
|
5
|
+
reStructuredText nor a office suite nor a web based service like [Lit Lift](http://www.litlift.com/) or
|
6
|
+
[Fast Pencil](http://www.fastpencil.com/). It's just a command line tool which transforms markdown files into PDF
|
7
|
+
documents (and HTML, mobi, ePub etc in the future). So it's more comparable with the
|
8
|
+
[sphinx documentation generator](http://sphinx-doc.org/).
|
9
|
+
|
10
|
+
Also Riven doesn't run on windows machines. Sorry for that.
|
11
|
+
|
12
|
+
Additionally Riven lacks some features you may know from sphinx. For example HTML site generation is not there (yet!)
|
13
|
+
and Riven is (yet!) not able to generate man pages, ePub and mobi formats. But those features are planned and will be
|
14
|
+
added in the future. Also Riven intentionally doesn't generate chapter numeration like you may know from sphinx. You
|
15
|
+
have to do it on your own (and you can just omit it if you don't like it or even mix it up). But maybe there will be an
|
16
|
+
option in the future which makes Riven to auto generate chapter numbers for you.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
## 1.4. Why was Riven created?
|
2
|
+
|
3
|
+
I've two hobbies. Ok I got more hobbies, but only two of them are relevant for Riven.
|
4
|
+
|
5
|
+
One is programming. I code a lot. Additionally it's my job so I code even more. And a good programmer documents
|
6
|
+
his software. In my company we're working on a high innovative CMS with a very versatile framework which allows us to
|
7
|
+
implement nearly every kind of project. We had to document that framework in some way for the other developers who
|
8
|
+
would use it and implement the customer projects based on the CMS. One requirement to the documentation was portability.
|
9
|
+
It should be readable on the PC, on Tablets and it should be printable. As we started to write the documentation, we
|
10
|
+
used OpenOffice and saved it as a ODT file which is basically a ZIP-File with some XML within. In order words: We had a
|
11
|
+
big binary file in our git repository. It doesn't took a long time until we had merge conflicts due the fact that up to
|
12
|
+
three people have been working on the document at the same time. And merging a big binary blob doesn't make fun. So I
|
13
|
+
wanted to switch to another tool chain to write the documentation. The obvious suggest was HTML of course. But to write
|
14
|
+
HTML is much work, we didn't want to do that. We know HTML, since we're web developers, but we wanted a solution which
|
15
|
+
would be more lean and allows a faster workflow without much testing. Of course we could have used our CMS, but we
|
16
|
+
wanted to have the documentation in our git repository. However we wanted to use plain text to write your documentation
|
17
|
+
and we wanted a PDF as a result. Unfortunately there wasn't any good comparable tool that time.
|
18
|
+
|
19
|
+
My second hobby is Pen and Paper. Dungeons and Dragons, you know (Cthulu, Aborea and Pathfinder to be exact). And I was
|
20
|
+
writing a campaign. I was writing that campaign in markdown, because I love my editor and I wanted to use git to manage
|
21
|
+
everything since GitLab renders markdown nicely. Now I needed a build chain to produce a PDF in order to have one
|
22
|
+
document which can be printed or sent via mail.
|
23
|
+
|
24
|
+
For these both use cases I hacked the initial proof of concept version of a md2pdf ruby script, which worked pretty
|
25
|
+
well. But I wanted some additional features like styling of the PDF via CSS, a cover page, syntax highlighting and some
|
26
|
+
other stuff. So the script started to grow to a bigger project. After some time I've renamed it to riven, since, well, it
|
27
|
+
sounds cool. And yes it's reference to the Myst series.
|
28
|
+
|
29
|
+
In order to keep even big documents structured and clear, riven 1.1.0 introduced the *include* syntax, which allows
|
30
|
+
a better split up of the content over many files, subdirectories and allows an easier refactoring of the chapters.
|
31
|
+
|
32
|
+
Riven solved both use cases very well. I'm using riven to write both large Pen and Paper campaings and some small
|
33
|
+
documents. Either quick or within weeks of hard work. Both cases produce a nice PDF. Today the CMS framework
|
34
|
+
documentation of my company includes over 200 PDF pages generated out of 9500 lines of markdown, which are changed on a
|
35
|
+
weekly basis and Riven does a nice job.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
## 1.5. How can I support Riven?
|
2
|
+
|
3
|
+
Riven is a MIT licensed Open Source project hosted on GitHub. Just vist https://github.com/phortx/riven. You'll find
|
4
|
+
the issues section there containing all bugs and feature requests. Also you can fork the project to send pull requests.
|
5
|
+
Feel free to contribute code, documentation or bugfixes!
|
6
|
+
|
7
|
+
If you find any bugs, please open a new issue in the issue tracker and I'll try to fix it.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# 1. What is Riven?
|
2
|
+
|
3
|
+
In one sentence: Riven is a command line tool, which converts a bunch of markdown files into a PDF file.
|
4
|
+
|
5
|
+
**The question is: Why would you do that?**
|
6
|
+
|
7
|
+
There are several scenarios where the usage of a tool like Riven would make a lot of sense for you. Let's take a look
|
8
|
+
at some of them:
|
9
|
+
|
10
|
+
<<[ 1-scenario-a.md ]
|
11
|
+
<<[ 2-scenario-b.md ]
|
12
|
+
|
13
|
+
<<[ 3-what-is-riven-not.md ]
|
14
|
+
<<[ 4-why-was-riven-created.md ]
|
15
|
+
<<[ 5-how-can-i-support-riven.md ]
|
@@ -0,0 +1,49 @@
|
|
1
|
+
## 2.1. Prerequisites
|
2
|
+
|
3
|
+
Riven comes with some dependencies, which you have to statisfy before you can start to use it. But no panic it's not
|
4
|
+
that hard.
|
5
|
+
|
6
|
+
First of all you'll need [wkhtmltopdf](https://github.com/wkhtmltopdf/wkhtmltopdf/) in order to generate PDFs, since
|
7
|
+
that's the PDF generator backend of Riven. And you should use the QT patched version of `wkhtmltopdf` to get all the
|
8
|
+
features of riven. You may also use the version without patched qt, but that will disable the following features of
|
9
|
+
riven: Page numbers, table of contents and covers.
|
10
|
+
|
11
|
+
All right, Let's go ...
|
12
|
+
|
13
|
+
- If you got Arch Linux, you can just install the packages `wkhtmltopdf-static`and `icu48` from the AUR and you're done.
|
14
|
+
Pretty easy, isn't it?
|
15
|
+
|
16
|
+
- If you got another Linux Distribution (like Ubuntu) or OSX you have to compile `wkhtmltopdf` from the sources. See
|
17
|
+
http://natepinchot.com/2014/01/31/building-static-wkhtmltopdf/ for details. This may take some time: On my i7 it takes
|
18
|
+
about 20 minutes.
|
19
|
+
|
20
|
+
- Otherwise, you can download `wkhtmltopdf` from the [official website](http://wkhtmltopdf.org/downloads.html).
|
21
|
+
|
22
|
+
I know, that part is somewhat uncomfortable and this will change in the future. Either wkhtmltopdf will be automatically
|
23
|
+
installed with the gem or riven comes with a Docker container. However, the installation will be easier in the future.
|
24
|
+
|
25
|
+
After wkhtmltopdf is compiled, make sure you can execute the `wkhtmltopdf` command in your shell:
|
26
|
+
|
27
|
+
```bash
|
28
|
+
$ wkhtmltopdf -V
|
29
|
+
```
|
30
|
+
|
31
|
+
If it works, everything is nice and you may proceed with the next step. If not, please make sure, `wkhtmltopdf` is
|
32
|
+
correctly installed and the executable is within your `PATH`.
|
33
|
+
|
34
|
+
In the second step, we need ruby. I recommend you to use [RVM](https://rvm.io) to install Ruby. It's pretty simple:
|
35
|
+
|
36
|
+
```bash
|
37
|
+
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
38
|
+
$ \curl -sSL https://get.rvm.io | bash -s stable
|
39
|
+
$ rvm install 2.2.3
|
40
|
+
$ rvm --default use 2.2.3
|
41
|
+
```
|
42
|
+
|
43
|
+
After that you should be able to use ruby:
|
44
|
+
|
45
|
+
```bash
|
46
|
+
$ ruby -v
|
47
|
+
```
|
48
|
+
|
49
|
+
If so, we're ready to install Riven in the next chapter!
|