Add Git documentation

pull/29/head
Thibaut 11 years ago
parent 864188e24c
commit 0f08f25b42

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 31 KiB

@ -98,6 +98,11 @@ credits = [
'2013 Yehuda Katz, Tom Dale and Ember.js contributors',
'MIT',
'https://raw.github.com/emberjs/ember.js/master/LICENSE'
], [
'Git',
'2005-2013 Linus Torvalds and others',
'GPLv2',
'https://raw.github.com/git/git/master/COPYING'
], [
'HTTP',
'1999 The Internet Society',

@ -24,7 +24,10 @@ newsItem = (date, news) ->
result
app.news = [
[ 1385424000000, # November 26, 2013
[ 1386892800000, # December 13, 2013
""" New <a href="/git/">Git</a> documentation """
], [
1385424000000, # November 26, 2013
""" New <a href="/python/">Python</a> documentation """
], [
1384819200000, # November 19, 2013

@ -31,6 +31,7 @@
'pages/coffeescript',
'pages/ember',
'pages/jquery',
'pages/git',
'pages/less',
'pages/lodash',
'pages/mdn',

@ -42,3 +42,4 @@
._icon-ruby:before { background-position: -3rem -5rem; }
._icon-rails:before { background-position: -4rem -5rem; }
._icon-python:before { background-position: 0 -6rem; }
._icon-git:before { background-position: -1rem -6rem; }

@ -0,0 +1,7 @@
._git {
> h2 { @extend %block-heading; }
h3 { font-size: 1rem; }
> .callout, > h1 + .sectionbody { @extend %note, %note-green; }
code { @extend %label; }
em { font-style: normal; }
}

@ -0,0 +1,40 @@
module Docs
class Git
class CleanHtmlFilter < Filter
def call
root_page? ? root : other
doc
end
def root
at_css('h1').content = 'Git'
end
def other
css('h1 + h2', '#_git + div', '#_git').remove
css('> div', 'pre > tt', 'pre > em', 'div.paragraph').each do |node|
node.before(node.children).remove
end
css('> h1').each do |node|
node.content = node.content.sub(/\(\d\) Manual Page/, '')
end
unless at_css('> h2')
css('> h3').each do |node|
node.name = 'h2'
end
end
css('h2').each do |node|
node.content = node.content.capitalize
end
css('tt', 'p > em').each do |node|
node.name = 'code'
end
end
end
end
end

@ -0,0 +1,9 @@
module Docs
class Git
class EntriesFilter < Docs::EntriesFilter
def get_name
slug.sub '-', ' '
end
end
end
end

@ -0,0 +1,19 @@
module Docs
class Git < UrlScraper
self.type = 'git'
self.version = '1.8.5'
self.base_url = 'http://git-scm.com/docs'
self.initial_paths = %w(/git.html)
html_filters.push 'git/clean_html', 'git/entries'
options[:container] = ->(filter) { filter.root_page? ? '#main' : '.man-page' }
options[:follow_links] = ->(filter) { filter.root_page? }
options[:only_patterns] = [/\A\/git\-/]
options[:attribution] = <<-HTML
&copy; 2005&ndash;2013 Linus Torvalds and others<br>
Licensed under the GNU General Public License version 2.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

@ -0,0 +1 @@
http://git-scm.com/downloads/logos
Loading…
Cancel
Save