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 11[
2+ [
3+ " 2024-07-28" ,
4+ " New documentation: <a href=\" /opengl/\" >OpenGL</a>"
5+ ],
26 [
37 " 2024-06-12" ,
48 " 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
22 class Opengl
33 class CleanHtmlFilter < Filter
44 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
610 css ( '.funcprototype-table' ) . each do |node |
711 node . css ( 'td' ) . each do |data |
812 data . replace ( data . children )
@@ -15,6 +19,12 @@ def call
1519 node . replace ( node . children )
1620 end
1721
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+
1828 doc
1929 end
2030 end
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ def get_type
1515 def additional_entries
1616 entries = [ ]
1717 css ( '.fsfunc' ) . each do |function |
18+ next if function . text == name
1819 entries << [ function . text , function . text ]
1920 end
2021 entries
Original file line number Diff line number Diff line change 11module Docs
22 class Opengl < FileScraper
33 self . type = 'simple'
4+ self . name = 'OpenGL'
45 self . root_path = 'index.php'
56 self . links = {
67 home : 'https://registry.khronos.org/OpenGL-Refpages/'
@@ -12,18 +13,19 @@ class Opengl < FileScraper
1213
1314 options [ :attribution ] = -> ( filter ) {
1415 # 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
1617 }
1718
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
2319 version '4' do
2420 self . root_path = 'index.php'
2521 self . release = '4'
2622 self . base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{ self . version } /"
2723 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
2830 end
2931end
You can’t perform that action at this time.
0 commit comments