Skip to content

Commit 40763eb

Browse files
committed
new readme and rake task to generate books
1 parent 6311d80 commit 40763eb

File tree

6 files changed

+202
-9
lines changed

6 files changed

+202
-9
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
output
22
.DS_Store
3+
4+
# build artifacts
5+
progit.html
6+
progit.pdf
7+
progit.pdfmarks
8+
progit.epub
9+
progit-kf8.epub
10+
progit.mobi

Gemfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'rake'
4+
gem 'asciidoctor', '1.5.0'
5+
6+
gem 'json'
7+
gem 'awesome_print'
8+
9+
gem 'asciidoctor-epub3', '1.0.0.alpha.2'
10+
gem 'asciidoctor-pdf', '1.5.0.alpha.5'
11+
12+
gem 'coderay'
13+
gem 'pygments.rb'
14+
gem 'thread_safe'
15+
gem 'epubcheck'
16+
gem 'kindlegen'

Gemfile.lock

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
Ascii85 (1.0.2)
5+
afm (0.2.2)
6+
asciidoctor (1.5.0)
7+
asciidoctor-epub3 (1.0.0.alpha.2)
8+
asciidoctor (>= 1.5.0, < 1.6.0)
9+
gepub (~> 0.6.9.2)
10+
thread_safe (~> 0.3.4)
11+
asciidoctor-pdf (1.5.0.alpha.5)
12+
asciidoctor (~> 1.5.0)
13+
prawn (= 1.2.1)
14+
prawn-svg (= 0.16.0)
15+
prawn-table (= 0.1.1)
16+
prawn-templates (= 0.0.3)
17+
treetop (= 1.5.3)
18+
awesome_print (1.2.0)
19+
coderay (1.1.0)
20+
epubcheck (3.0.1)
21+
gepub (0.6.9.2)
22+
nokogiri (~> 1.6.1)
23+
rubyzip (>= 1.1.1)
24+
hashery (2.1.1)
25+
json (1.8.1)
26+
kindlegen (2.9.3)
27+
mini_portile (0.6.0)
28+
nokogiri (1.6.3.1)
29+
mini_portile (= 0.6.0)
30+
pdf-core (0.2.5)
31+
pdf-reader (1.3.3)
32+
Ascii85 (~> 1.0.0)
33+
afm (~> 0.2.0)
34+
hashery (~> 2.0)
35+
ruby-rc4
36+
ttfunk
37+
polyglot (0.3.5)
38+
posix-spawn (0.3.9)
39+
prawn (1.2.1)
40+
pdf-core (~> 0.2.5)
41+
ttfunk (~> 1.2.0)
42+
prawn-svg (0.16.0)
43+
prawn (>= 0.8.4)
44+
prawn-table (0.1.1)
45+
prawn-templates (0.0.3)
46+
pdf-reader (~> 1.3)
47+
prawn (>= 0.15.0)
48+
pygments.rb (0.6.0)
49+
posix-spawn (~> 0.3.6)
50+
yajl-ruby (~> 1.1.0)
51+
rake (10.3.2)
52+
ruby-rc4 (0.1.5)
53+
rubyzip (1.1.6)
54+
thread_safe (0.3.4)
55+
treetop (1.5.3)
56+
polyglot (~> 0.3)
57+
ttfunk (1.2.2)
58+
yajl-ruby (1.1.0)
59+
60+
PLATFORMS
61+
ruby
62+
63+
DEPENDENCIES
64+
asciidoctor (= 1.5.0)
65+
asciidoctor-epub3 (= 1.0.0.alpha.2)
66+
asciidoctor-pdf (= 1.5.0.alpha.5)
67+
awesome_print
68+
coderay
69+
epubcheck
70+
json
71+
kindlegen
72+
pygments.rb
73+
rake
74+
thread_safe

README.asc

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
11
= Pro Git, Second Edition
22

3-
Welcome to the second edition of the Pro Git book. Until release, this README will be notes on how to collaboratively write this book.
3+
Welcome to the second edition of the Pro Git book.
44

5-
First, each chapter will have to be converted from the Markdown of the first release to Asciidoc for the generation toolchain.
5+
You can find this book online at: http://git-scm.com/book
66

7-
We should put each topic we want to address in as an issue and close the issue when the text addressing it is complete. That way we can see what still needs to be done, who is assigned to what and have conversations around the topics before writing.
7+
Like the first edition, the second edition of Pro Git is open source under a Creative Commons license.
88

9-
We will use the Pull Request workflow to collaborate on the book. Referencing an existing issue or multiple issues from the PR is encouraged. Ideally the technical editor will sign off on each PR as well and should be opening their own as we go.
9+
A couple of things have changed since open sourcing the first edition. For one, we've moved from Markdown to the amazing Asciidoc format for the text of the book. We've also moved to using O'Reilly's https://atlas.oreilly.com[Atlas platform] for generating continuous builds of the book so all major formats are always available in every language.
1010

11-
I will start by putting in the outline of the current book as OUTLINE.asc and we can start by figuring out what we want the skeleton of the second edition to look like.
11+
We've also moved to keeping the translations in seperate repositories rather than subdirectories of the English repository. See the Translations section for more information.
1212

13-
== Git 2.0
13+
== Contributing
1414

15-
The book should be aimed at releasing close to Git 2.0 and all of the examples and defaults should be tuned to what Git 2.0 will act and look like.
15+
To contribute errata or new content to this repository, you will need to open up a Pull Request on GitHub. It is generally a good idea before doing anything major to open an issue and make sure your work will get accepted.
16+
17+
You will also need to sign a Contributor License Agreement so if we do a third edition of the book at some point, we won't have to get everyone's permission but instead will simply list you all in an attributions section.
18+
19+
There is a CLA bot that will ask you to e-sign an agreement if you send a Pull Request to this repository before that pull will be accepted. Sorry about that, one of the issues with having a dual-licensed work.
1620

1721
== How To Generate the Book
1822

19-
Right now you should be able to run `asciidoc book.asc` for the whole book, or `asciidoc chapterX.asc` for a single chapter. Eventually we will want to automate this and perhaps even have a build server (or use Atlas).
23+
There are two ways to generate e-book content from this source code.
24+
25+
The easiest way is simply to let us do it. A robot is standing by to look for new work on the main branch and automatically build it for everyone.
26+
27+
You can find the current builds on http://git-scm.com/book and more information about the builds available at https://progit.org
28+
29+
The other way to generate e-book files is to do so manually with Asciidoctor. If you run the following you _may_ actually get HTML, Epub, Mobi and PDF output files:
30+
31+
----
32+
$ bundle install
33+
$ bundle exec rake book:build
34+
Converting to HTML...
35+
-- HTML output at progit.html
36+
Converting to EPub...
37+
-- Epub output at progit.epub
38+
Converting to Mobi (kf8)...
39+
-- Mobi output at progit.mobi
40+
Converting to PDF...
41+
-- PDF output at progit.pdf
42+
----
43+
44+
This uses the `asciidoctor`, `asciidoctor-pdf` and `asciidoctor-epub` projects.
45+
46+
== Translations
47+
48+
Translations to other languages are highly encouraged but handled a little differently than the first edition. We now keep each translation in a seperate repository and automatically build the output files through Atlas. This was something that was really difficult in the last edition.
49+
50+
Since each translation is a different repository, we can also have different maintainers for each project. The Pro Git team simply pulls them in an builds them for the translation teams. Most translations repositories will be under the `progit` organization on GitHub, but some may be maintained as forks.
51+
52+
You can find out information on all the current translations and information on how to start your own at: http://progit.org/trans
2053

2154
== Figures
2255

23-
The images in this book were generated using Sketch 3, with the [included sketchbook file](progit.sketch).
56+
The images in this book were generated using [Sketch 3](http://bohemiancoding.com/sketch/), with the [included sketchbook file](diagram-source/progit.sketch).
57+
2458
To add a figure:
2559

2660
. Add a page to the sketchbook. Try to use the included symbols wherever possible.

Rakefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
namespace :book do
2+
desc 'prepare build'
3+
task :prebuild do
4+
Dir.glob("book/*/images/*").each do |image|
5+
FileUtils.copy(image, "images/" + File.basename(image))
6+
end
7+
end
8+
9+
desc 'build basic book formats'
10+
task :build do
11+
puts "Converting to HTML..."
12+
`bundle exec asciidoctor progit.asc`
13+
puts " -- HTML output at progit.html"
14+
15+
puts "Converting to EPub..."
16+
`bundle exec asciidoctor-epub3 progit.asc`
17+
puts " -- Epub output at progit.epub"
18+
19+
puts "Converting to Mobi (kf8)..."
20+
`bundle exec asciidoctor-epub3 -a ebook-format=kf8 progit.asc`
21+
puts " -- Mobi output at progit.mobi"
22+
23+
puts "Converting to PDF... (this one takes a while)"
24+
`bundle exec asciidoctor-pdf progit.asc 2>/dev/null`
25+
puts " -- PDF output at progit.pdf"
26+
end
27+
end

progit.asc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Pro Git
2+
=======
3+
:doctype: book
4+
:docinfo:
5+
:toc:
6+
:toclevels: 2
7+
:front-cover-image: image:images/cover.png[width=1050,height=1600]
8+
9+
include::book/01-introduction/1-introduction.asc[]
10+
11+
include::book/02-git-basics/1-git-basics.asc[]
12+
13+
include::book/03-git-branching/1-git-branching.asc[]
14+
15+
include::book/04-git-server/1-git-server.asc[]
16+
17+
include::book/05-distributed-git/1-distributed-git.asc[]
18+
19+
include::book/06-github/1-github.asc[]
20+
21+
include::book/07-git-tools/1-git-tools.asc[]
22+
23+
include::book/08-customizing-git/1-customizing-git.asc[]
24+
25+
include::book/09-git-and-other-scms/1-git-and-other-scms.asc[]
26+
27+
include::book/10-git-internals/1-git-internals.asc[]
28+
29+
include::book/A-git-in-other-environments/1-git-other-environments.asc[]
30+
31+
include::book/B-embedding-git/1-embedding-git.asc[]
32+
33+
include::book/C-git-commands/1-git-commands.asc[]
34+

0 commit comments

Comments
 (0)