History

Merge pull request #1070 from simon04/gcc

Jasper van Merle committed 7 years ago

Commit ec252ca2 parents d715d67 cad4cb42 files · +40 −3Browse files

Unified · Split

2 files
  1. lib/docs/filters/gcc/clean_html.rb +13 −0
  2. lib/docs/scrapers/gnu/gcc.rb +27 −3
lib/docs/filters/gcc/clean_html.rb+13−0
@@ -0,0 +1,13 @@
1module Docs
2 class Gcc
3 class CleanHtmlFilter < Filter
4 def call
5 css('pre').each do |node|
6 node['data-language'] = 'cpp'
7 end
8
9 doc
10 end
11 end
12 end
13end
lib/docs/scrapers/gnu/gcc.rb+27−3
@@ -6,7 +6,7 @@ module Docs · 5 unmodified lines
6 home: 'https://gcc.gnu.org/'6 home: 'https://gcc.gnu.org/'
7 }7 }
8 8
9 html_filters.push 'title'9 html_filters.push 'gcc/clean_html', 'title'
10 10
11 options[:root_title] = false11 options[:root_title] = false
12 options[:title] = false12 options[:title] = false
@@ -46,13 +46,37 @@ module Docs · 33 unmodified lines
46 'Wtrigraphs.html' => 'Invocation.html'46 'Wtrigraphs.html' => 'Invocation.html'
47 }47 }
48 48
49 version '9' do
50 self.release = '9.2.0'
51 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
52 end
53
54 version '9 CPP' do
55 self.release = '9.2.0'
56 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
57
58 options[:replace_paths] = CPP_PATHS
59 end
60
61 version '8' do
62 self.release = '8.3.0'
63 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
64 end
65
66 version '8 CPP' do
67 self.release = '8.3.0'
68 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
69
70 options[:replace_paths] = CPP_PATHS
71 end
72
49 version '7' do73 version '7' do
50 self.release = '7.3.0'74 self.release = '7.4.0'
51 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"75 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
52 end76 end
53 77
54 version '7 CPP' do78 version '7 CPP' do
55 self.release = '7.3.0'79 self.release = '7.4.0'
56 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"80 self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
57 81
58 options[:replace_paths] = CPP_PATHS82 options[:replace_paths] = CPP_PATHS