Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 149 KiB |
@ -1,9 +1,7 @@
|
||||
module Docs
|
||||
class Pig
|
||||
class ApachePig
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
@doc = at_css('#content')
|
||||
|
||||
css('.pdflink').remove
|
||||
|
||||
css('a[name]').each do |node|
|
@ -0,0 +1,33 @@
|
||||
module Docs
|
||||
class ApachePig
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
at_css('h1').content
|
||||
end
|
||||
|
||||
def get_type
|
||||
at_css('h1').content
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
nodes = case slug
|
||||
when 'basic', 'cmds', 'func'
|
||||
css('h3')
|
||||
when 'cont'
|
||||
css('h2, #macros + div > h3')
|
||||
when 'test'
|
||||
css('h2, #diagnostic-ops + div > h3')
|
||||
when 'perf'
|
||||
css('h2, #optimization-rules + div > h3, #specialized-joins + div > h3')
|
||||
else
|
||||
css('h2')
|
||||
end
|
||||
|
||||
nodes.each_with_object [] do |node, entries|
|
||||
name = node.content.strip
|
||||
entries << [name, node['id']] unless name == 'Introduction'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,33 +0,0 @@
|
||||
module Docs
|
||||
class Pig
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
|
||||
def include_default_entry?
|
||||
false
|
||||
end
|
||||
|
||||
def get_type
|
||||
at_css('h1').content
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
case slug
|
||||
when 'basic', 'cmds', 'func'
|
||||
nodes = css('h3')
|
||||
when 'cont'
|
||||
nodes = css('h2, #macros + div > h3')
|
||||
when 'test'
|
||||
nodes = css('h2, #diagnostic-ops + div > h3')
|
||||
when 'perf'
|
||||
nodes = css('h2, #optimization-rules + div > h3, #specialized-joins + div > h3')
|
||||
else
|
||||
nodes = css('h2')
|
||||
end
|
||||
|
||||
nodes.each_with_object [] do |node, entries|
|
||||
entries << [node.content, node['id'], get_type]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,37 @@
|
||||
module Docs
|
||||
class ApachePig < UrlScraper
|
||||
self.name = 'Apache Pig'
|
||||
self.slug = 'apache_pig'
|
||||
self.type = 'apache_pig'
|
||||
self.links = {
|
||||
home: 'https://pig.apache.org/'
|
||||
}
|
||||
|
||||
html_filters.push 'apache_pig/clean_html', 'apache_pig/entries'
|
||||
|
||||
options[:container] = '#content'
|
||||
options[:skip] = %w(pig-index.html)
|
||||
options[:skip_patterns] = [/\Aapi/, /\Ajdiff/]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2007–2016 Apache Software Foundation<br>
|
||||
Licensed under the Apache Software License version 2.0.
|
||||
HTML
|
||||
|
||||
version '0.15' do
|
||||
self.release = '0.15.0'
|
||||
self.base_url = "https://pig.apache.org/docs/r#{release}/"
|
||||
end
|
||||
|
||||
version '0.14' do
|
||||
self.release = '0.14.0'
|
||||
self.base_url = "https://pig.apache.org/docs/r#{release}/"
|
||||
end
|
||||
|
||||
version '0.13' do
|
||||
self.release = '0.13.0'
|
||||
self.base_url = "https://pig.apache.org/docs/r#{release}/"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
@ -1,39 +0,0 @@
|
||||
module Docs
|
||||
class Pig < UrlScraper
|
||||
self.name = 'Pig'
|
||||
self.type = 'pig'
|
||||
self.links = {
|
||||
home: 'https://pig.apache.org/'
|
||||
}
|
||||
|
||||
html_filters.push 'pig/clean_html', 'pig/entries'
|
||||
|
||||
options[:skip] = %w( pig-index.html )
|
||||
|
||||
options[:skip_patterns] = [
|
||||
/\Aapi/,
|
||||
/\Ajdiff/
|
||||
]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2007–2016 Apache Software Foundation<br>
|
||||
Licensed under the Apache Software License version 2.0.
|
||||
HTML
|
||||
|
||||
version '0.15.0' do
|
||||
self.release = '0.15.0'
|
||||
self.base_url = "http://pig.apache.org/docs/r#{release}/"
|
||||
end
|
||||
|
||||
version '0.14.0' do
|
||||
self.release = '0.14.0'
|
||||
self.base_url = "http://pig.apache.org/docs/r#{release}/"
|
||||
end
|
||||
|
||||
version '0.13.0' do
|
||||
self.release = '0.13.0'
|
||||
self.base_url = "http://pig.apache.org/docs/r#{release}/"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 759 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 22 KiB |