mirror of https://github.com/freeCodeCamp/devdocs
parent
864188e24c
commit
0f08f25b42
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 31 KiB |
@ -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
|
||||
© 2005–2013 Linus Torvalds and others<br>
|
||||
Licensed under the GNU General Public License version 2.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 354 B |
After Width: | Height: | Size: 571 B |
@ -0,0 +1 @@
|
||||
http://git-scm.com/downloads/logos
|
Loading…
Reference in new issue