Skip to content

Commit 2b3aa7e

Browse files
committed
Merge branch 'asciidoctor'
2 parents 568ad87 + fb9d394 commit 2b3aa7e

36 files changed

+4968
-3893
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
*.synctex.gz
88
*.toc
99
_minted-api-on-rails
10+
build

Gemfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6+
7+
# gem "rails"
8+
9+
gem 'asciidoctor', '~> 1.5'
10+
11+
gem "asciidoctor-pdf", "~> 1.5.alpha.16"
12+
13+
gem "concurrent-ruby", "~> 1.1"
14+
15+
gem "rouge", "~> 3.3"
16+
17+
gem "asciidoctor-epub3", "~> 1.5.alpha.8"

Gemfile.lock

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
Ascii85 (1.0.3)
5+
addressable (2.5.2)
6+
public_suffix (>= 2.0.2, < 4.0)
7+
afm (0.2.2)
8+
asciidoctor (1.5.8)
9+
asciidoctor-epub3 (1.5.0.alpha.8)
10+
asciidoctor (~> 1.5.0)
11+
gepub (~> 0.6.9.2)
12+
thread_safe (~> 0.3.6)
13+
asciidoctor-pdf (1.5.0.alpha.16)
14+
asciidoctor (>= 1.5.0)
15+
prawn (>= 1.3.0, < 2.3.0)
16+
prawn-icon (= 1.3.0)
17+
prawn-svg (>= 0.21.0, < 0.28.0)
18+
prawn-table (= 0.2.2)
19+
prawn-templates (>= 0.0.3, <= 0.1.1)
20+
safe_yaml (~> 1.0.4)
21+
thread_safe (~> 0.3.6)
22+
treetop (= 1.5.3)
23+
concurrent-ruby (1.1.4)
24+
css_parser (1.6.0)
25+
addressable
26+
gepub (0.6.9.2)
27+
nokogiri (~> 1.6.1)
28+
rubyzip (>= 1.1.1)
29+
hashery (2.1.2)
30+
mini_portile2 (2.1.0)
31+
nokogiri (1.6.8.1)
32+
mini_portile2 (~> 2.1.0)
33+
pdf-core (0.7.0)
34+
pdf-reader (2.2.0)
35+
Ascii85 (~> 1.0.0)
36+
afm (~> 0.2.1)
37+
hashery (~> 2.0)
38+
ruby-rc4
39+
ttfunk
40+
polyglot (0.3.5)
41+
prawn (2.2.2)
42+
pdf-core (~> 0.7.0)
43+
ttfunk (~> 1.5)
44+
prawn-icon (1.3.0)
45+
prawn (>= 1.1.0, < 3.0.0)
46+
prawn-svg (0.27.1)
47+
css_parser (~> 1.3)
48+
prawn (>= 0.11.1, < 3)
49+
prawn-table (0.2.2)
50+
prawn (>= 1.3.0, < 3.0.0)
51+
prawn-templates (0.1.1)
52+
pdf-reader (~> 2.0)
53+
prawn (~> 2.2)
54+
public_suffix (3.0.3)
55+
rouge (3.3.0)
56+
ruby-rc4 (0.1.5)
57+
rubyzip (1.2.2)
58+
safe_yaml (1.0.4)
59+
thread_safe (0.3.6)
60+
treetop (1.5.3)
61+
polyglot (~> 0.3)
62+
ttfunk (1.5.1)
63+
64+
PLATFORMS
65+
ruby
66+
67+
DEPENDENCIES
68+
asciidoctor (~> 1.5)
69+
asciidoctor-epub3 (~> 1.5.alpha.8)
70+
asciidoctor-pdf (~> 1.5.alpha.16)
71+
concurrent-ruby (~> 1.1)
72+
rouge (~> 3.3)
73+
74+
BUNDLED WITH
75+
1.17.2

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,28 @@ Update & translations of the fantastic [API on Rails (EN)](http://apionrails.ica
66

77
<noscript><a href="https://liberapay.com/alexandre_rousseau/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
88

9-
## Export as PDF, epub, HTML, etc..
9+
Update & translation of the [API on Rails (EN)](http://apionrails.icalialabs.com/book) book. This book is written using [Asciidoctor](https://asciidoctor.org).
1010

11-
You should install and use [pandoc](http://pandoc.org/). Clone the project & this is simply as this:
11+
## Build book
1212

1313
~~~bash
14-
$ cd fr
15-
$ pandoc *.md -o api-on-rail-fr.pdf
14+
$ git clone https://github.com/madeindjs/api_on_rails/
15+
$ cd api_on_rails
16+
$ bundle install
17+
$ rake build:pdf:fr
1618
~~~
1719

20+
You can see all build available with `rake -T`
21+
22+
~~~bash
23+
$ rake -T
24+
rake build:epub3:en # Build an english EPUB version
25+
rake build:epub3:fr # Build a french EPUB version
26+
rake build:mobi:en # Build an english EPUB version
27+
rake build:mobi:fr # Build a french EPUB version
28+
rake build:pdf:en # Build an english PDF version / Build an english HTML version
29+
rake build:pdf:fr # Build a french PDF version / Build a french HTML version
30+
~~~
1831

1932
## License
2033

Rakefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
LANGS = %w[en fr].freeze
2+
3+
def parse_lang(args)
4+
lang = args[:lang]
5+
unless LANGS.include?(lang)
6+
msg = format('Lang not availaible. Select on of theses langs: %s', LANGS.join(', '))
7+
raise ArgumentError, msg
8+
end
9+
10+
lang
11+
end
12+
13+
namespace :build do
14+
desc 'Build a PDF version'
15+
task :pdf, [:lang] do |_task, args|
16+
`asciidoctor-pdf #{parse_lang(args)}/api_on_rails.adoc --destination-dir build`
17+
puts 'Book build on build/api_on_rails.pdf'
18+
end
19+
20+
desc 'Build an HTML version'
21+
task :html, [:lang] do |_task, args|
22+
`asciidoctor #{parse_lang(args)}/api_on_rails.adoc --destination-dir build`
23+
puts 'Book build on build/api_on_rails.html'
24+
end
25+
26+
desc 'Build an EPUB version'
27+
task :epub, [:lang] do |_task, args|
28+
`asciidoctor-epub3 #{parse_lang(args)}/api_on_rails.adoc --destination-dir build`
29+
puts 'Book build on build/api_on_rails.epub'
30+
end
31+
32+
desc 'Build a MOBI version'
33+
task :mobi, [:lang] do |_task, args|
34+
`asciidoctor-epub3 #{parse_lang(args)}/api_on_rails.adoc --destination-dir build`
35+
puts 'Book build on build/api_on_rails.mobi'
36+
end
37+
end

build/.gitkeep

Whitespace-only changes.

en/00_before.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
== Foreword
2+
3+
"API on Rails 5" is based on http://apionrails.icalialabs.com/book/[``APIs on Rails: Building REST APIs with Rails'']. It was initially published in 2014 by https://twitter.com/kurenn[Abraham Kuri] under the licenses http://opensource.org/licenses/MIT[MIT] and http://people.freebsd.org/~phk/[Beerware].
4+
5+
Since the original work was not maintained, I wanted to update this excellent work and contribute to the Francophone community by translating it myself. This update is also available in the Molière language.
6+
7+
== About the author
8+
9+
https://twitter.com/kurenn[Abraham Kuri] is a Rails developer with 5 years of experience (probably more now). His experience includes working as a freelancer in software product development and more recently in collaboration within the open source community. A graduate in computer science from ITESM, he founded two companies in Mexico (http://icalialabs.com/[Icalia Labs] and http://codeandomexico.org/[Codeando Mexico]).
10+
11+
On my side, my name is http://rousseau-alexandre.fr[Alexandre Rousseau] and I am a Rails developer with more than 4 years of experience (at the time of writing). I am currently a partner in a company (https://isignif.fr[iSignif]) where I build and maintain a SAAS product using Rails. I also contribute to the Ruby community by producing and maintain some gems that you can consult onhttps://rubygems.org/profiles/madeindjs[my Rubygems.org profile]. Most of my projects are on Github so don’t http://github.com/madeindjs/[hesitate to follow me].
12+
13+
All the source code of this book is available in[Markdown] format (https://fr.wikipedia.org/wiki/Markdown) onhttps://github.com/madeindjs/api_on_rails[Github]. So don’t hesitate to[forker] (https://github.com/madeindjs/api_on_rails/fork) the project if you want to improve it or fix a mistake that I didn’t notice.
14+
15+
== Copyright and license
16+
17+
This book is provided on http://opensource.org/licenses/MIT[MIT license]. All the book’s source code is available on https://fr.wikipedia.org/wiki/Markdown[Markdown] format on https://github.com/madeindjs/api_on_rails[Github]
18+
19+
.MIT license
20+
****
21+
Copyright 2019 Alexandre Rousseau
22+
23+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
24+
25+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
26+
27+
THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28+
****
29+
30+
"API on Rails 5" by https://github.com/madeindjs/api_on_rails[Alexandre Rousseau] is shared according to http://creativecommons.org/licenses/by-sa/4.0/[Creative Commons Attribution - Attribution-ShareAlike 4.0 International]. Built upon this book http://apionrails.icalialabs.com/book/.

en/00_before.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)