History

Update GCC documentation (7.1.0)

Thibaut Courouble committed 9 years ago

Commit ecd0c341 parent 32a16c92 files · +45 −6Browse files

Unified · Split

2 files
  1. lib/docs/filters/gnu/clean_html.rb +23 −2
  2. lib/docs/scrapers/gnu/gcc.rb +22 −4
lib/docs/filters/gnu/clean_html.rb+23−2
@@ -11,9 +11,10 @@ module Docs · 10 unmodified lines
11 11
12 css('.node > a[name]').each do |node|12 css('.node > a[name]').each do |node|
13 node.parent.next_element['id'] = node['name']13 node.parent.next_element['id'] = node['name']
14 node.remove
14 end15 end
15 16
16 css('a[name]').each do |node|17 css('a[name]:not(:empty)').each do |node|
17 node['id'] = node['name']18 node['id'] = node['name']
18 end19 end
19 20
@@ -26,12 +27,32 @@ module Docs · 6 unmodified lines
26 node.inner_html = node.inner_html.strip_heredoc.strip27 node.inner_html = node.inner_html.strip_heredoc.strip
27 end28 end
28 29
29 css('dt > em', 'acronym', 'dfn', 'cite', 'h1 code').each do |node|30 css('dt > em', 'acronym', 'dfn', 'cite', 'h1 code', 'th > pre').each do |node|
30 node.before(node.children).remove31 node.before(node.children).remove
31 end32 end
32 33
34 css('.footnote h1').each do |node|
35 node.name = 'div'
36 end
37
38 css('div.header').each do |node|
39 node.name = 'p'
40 end
41
42 css('th[valign]', 'td[valign]').remove_attr('valign')
43 css('th[align]', 'td[align]').remove_attr('valign')
44
33 css('.node', 'br', 'hr').remove45 css('.node', 'br', 'hr').remove
34 46
47 css('a[name]:empty').each do |node|
48 (node.next_element || node.parent)['id'] = node['name']
49 node.remove
50 end
51
52 css('.header + h1').each do |node|
53 node.previous_element.remove
54 end
55
35 doc56 doc
36 end57 end
37 end58 end
lib/docs/scrapers/gnu/gcc.rb+22−4
@@ -8,7 +8,7 @@ module Docs · 7 unmodified lines
8 8
9 html_filters.push 'title'9 html_filters.push 'title'
10 10
11 options[:root_title] = 'Using the GNU Compiler Collection (GCC)'11 options[:root_title] = false
12 options[:title] = false12 options[:title] = false
13 13
14 options[:replace_paths] = {14 options[:replace_paths] = {
@@ -46,10 +46,26 @@ module Docs · 31 unmodified lines
46 'Wtrigraphs.html' => 'Invocation.html'46 'Wtrigraphs.html' => 'Invocation.html'
47 }47 }
48 48
49 version '7' do
50 self.release = '7.1.0'
51 self.dir = '/Users/Thibaut/DevDocs/Docs/gcc7'
52 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
53 end
54
55 version '7 CPP' do
56 self.release = '7.1.0'
57 self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp7'
58 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
59
60 options[:replace_paths] = CPP_PATHS
61 end
62
49 version '6' do63 version '6' do
50 self.release = '6.3.0'64 self.release = '6.3.0'
51 self.dir = '/Users/Thibaut/DevDocs/Docs/gcc6'65 self.dir = '/Users/Thibaut/DevDocs/Docs/gcc6'
52 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"66 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
67
68 options[:root_title] = 'Using the GNU Compiler Collection (GCC)'
53 end69 end
54 70
55 version '6 CPP' do71 version '6 CPP' do
@@ -57,13 +73,15 @@ module Docs · 1 unmodified line
57 self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp6'73 self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp6'
58 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"74 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
59 75
60 options[:root_title] = false
61 options[:replace_paths] = CPP_PATHS76 options[:replace_paths] = CPP_PATHS
62 end77 end
78
63 version '5' do79 version '5' do
64 self.release = '5.4.0'80 self.release = '5.4.0'
65 self.dir = '/Users/Thibaut/DevDocs/Docs/gcc5'81 self.dir = '/Users/Thibaut/DevDocs/Docs/gcc5'
66 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"82 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
83
84 options[:root_title] = 'Using the GNU Compiler Collection (GCC)'
67 end85 end
68 86
69 version '5 CPP' do87 version '5 CPP' do
@@ -71,7 +89,6 @@ module Docs · 1 unmodified line
71 self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp5'89 self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp5'
72 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"90 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
73 91
74 options[:root_title] = false
75 options[:replace_paths] = CPP_PATHS92 options[:replace_paths] = CPP_PATHS
76 end93 end
77 94
@@ -79,6 +96,8 @@ module Docs · 1 unmodified line
79 self.release = '4.9.3'96 self.release = '4.9.3'
80 self.dir = '/Users/Thibaut/DevDocs/Docs/gcc4'97 self.dir = '/Users/Thibaut/DevDocs/Docs/gcc4'
81 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"98 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
99
100 options[:root_title] = 'Using the GNU Compiler Collection (GCC)'
82 end101 end
83 102
84 version '4 CPP' do103 version '4 CPP' do
@@ -86,7 +105,6 @@ module Docs · 1 unmodified line
86 self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp4'105 self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp4'
87 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"106 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
88 107
89 options[:root_title] = false
90 options[:replace_paths] = CPP_PATHS108 options[:replace_paths] = CPP_PATHS
91 end109 end
92 end110 end

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t