File tree Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Expand file tree Collapse file tree 4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 1
1
[
2
+ [
3
+ " 2024-07-28" ,
4
+ " New documentation: <a href=\" /opengl/\" >OpenGL</a>"
5
+ ],
2
6
[
3
7
" 2024-06-12" ,
4
8
" New documentations: <a href=\" /nextjs/\" >Next.js</a>, <a href=\" /click/\" >click</a>"
Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ module Docs
2
2
class Opengl
3
3
class CleanHtmlFilter < Filter
4
4
def call
5
- # Rmeove table from function definitions
5
+ return '<h1>OpenGL</h1>' if root_page?
6
+
7
+ @doc = at_css ( '.refentry' ) if at_css ( '.refentry' )
8
+
9
+ # Remove table from function definitions
6
10
css ( '.funcprototype-table' ) . each do |node |
7
11
node . css ( 'td' ) . each do |data |
8
12
data . replace ( data . children )
@@ -15,6 +19,12 @@ def call
15
19
node . replace ( node . children )
16
20
end
17
21
22
+ css ( 'a' ) . remove_attribute ( 'target' )
23
+
24
+ # needed for scraper's options[:attribution]
25
+ copyright = at_css ( 'h2:contains("Copyright")' )
26
+ copyright . parent [ 'style' ] = 'display: none' if copyright
27
+
18
28
doc
19
29
end
20
30
end
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ def get_type
15
15
def additional_entries
16
16
entries = [ ]
17
17
css ( '.fsfunc' ) . each do |function |
18
+ next if function . text == name
18
19
entries << [ function . text , function . text ]
19
20
end
20
21
entries
Original file line number Diff line number Diff line change 1
1
module Docs
2
2
class Opengl < FileScraper
3
3
self . type = 'simple'
4
+ self . name = 'OpenGL'
4
5
self . root_path = 'index.php'
5
6
self . links = {
6
7
home : 'https://registry.khronos.org/OpenGL-Refpages/'
@@ -12,18 +13,19 @@ class Opengl < FileScraper
12
13
13
14
options [ :attribution ] = -> ( filter ) {
14
15
# copyright is the last section in these pages
15
- return filter . css ( '.refsect1:last-child' ) . css ( ' p') . inner_text
16
+ return filter . css ( 'h2:contains("Copyright") ~ p' ) . inner_text
16
17
}
17
18
18
- version '2.1' do
19
- self . root_path = 'index.html'
20
- self . release = '2.1'
21
- self . base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{ self . version } /"
22
- end
23
19
version '4' do
24
20
self . root_path = 'index.php'
25
21
self . release = '4'
26
22
self . base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{ self . version } /"
27
23
end
24
+
25
+ version '2.1' do
26
+ self . root_path = 'index.html'
27
+ self . release = '2.1'
28
+ self . base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{ self . version } /"
29
+ end
28
30
end
29
31
end
You can’t perform that action at this time.
0 commit comments