File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727._markdown ,
2828._mocha ,
2929._mongoose ,
30+ ._pig ,
3031._sinon ,
3132._typescript ,
3233._webpack {
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Pig
3+ class CleanHtmlFilter < Filter
4+ def call
5+ @doc = at_css ( '#content' )
6+
7+ css ( '.pdflink' ) . remove
8+
9+ css ( 'a[name]' ) . each do |node |
10+ node . next_element [ 'id' ] = node [ 'name' ]
11+ end
12+
13+ css ( 'h2' , 'h3' ) . each do |node |
14+ node . remove_attribute 'class'
15+ end
16+
17+ css ( 'table' ) . each do |node |
18+ node . remove_attribute 'cellspacing'
19+ node . remove_attribute 'cellpadding'
20+ end
21+
22+ doc
23+ end
24+ end
25+ end
26+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Pig
3+ class EntriesFilter < Docs ::EntriesFilter
4+
5+ def include_default_entry?
6+ false
7+ end
8+
9+ def get_type
10+ at_css ( 'h1' ) . content
11+ end
12+
13+ def additional_entries
14+ case slug
15+ when 'basic' , 'cmds' , 'func'
16+ nodes = css ( 'h3' )
17+ when 'cont'
18+ nodes = css ( 'h2, #macros + div > h3' )
19+ when 'test'
20+ nodes = css ( 'h2, #diagnostic-ops + div > h3' )
21+ when 'perf'
22+ nodes = css ( 'h2, #optimization-rules + div > h3, #specialized-joins + div > h3' )
23+ else
24+ nodes = css ( 'h2' )
25+ end
26+
27+ nodes . each_with_object [ ] do |node , entries |
28+ entries << [ node . content , node [ 'id' ] , get_type ]
29+ end
30+ end
31+ end
32+ end
33+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Pig < UrlScraper
3+ self . name = 'Pig'
4+ self . type = 'pig'
5+ self . links = {
6+ home : 'https://pig.apache.org/'
7+ }
8+
9+ html_filters . push 'pig/clean_html' , 'pig/entries'
10+
11+ options [ :skip ] = %w( pig-index.html )
12+
13+ options [ :skip_patterns ] = [
14+ /\A api/ ,
15+ /\A jdiff/
16+ ]
17+
18+ options [ :attribution ] = <<-HTML
19+ © 2007–2016 Apache Software Foundation< br >
20+ Licensed under the Apache Software License version 2.0.
21+ HTML
22+
23+ version '0.15.0' do
24+ self . release = '0.15.0'
25+ self . base_url = "http://pig.apache.org/docs/r#{ release } /"
26+ end
27+
28+ version '0.14.0' do
29+ self . release = '0.14.0'
30+ self . base_url = "http://pig.apache.org/docs/r#{ release } /"
31+ end
32+
33+ version '0.13.0' do
34+ self . release = '0.13.0'
35+ self . base_url = "http://pig.apache.org/docs/r#{ release } /"
36+ end
37+
38+ end
39+ end
You can’t perform that action at this time.
0 commit comments