History

Requested review changes

Suraj Yadav committed 2 years ago

Commit 775218e1 parent 49cb0772 files · +14 −19Browse files

Unified · Split

2 files
  1. docs/file-scrapers.md +4 −4
  2. lib/docs/scrapers/opengl.rb +10 −15
docs/file-scrapers.md+4−4
@@ -168,10 +168,10 @@ Clone https://github.com/KhronosGroup/OpenGL-Refpages.git · 167 unmodified lines
168168 ```sh
169169 DEVDOCS_ROOT=/path/to/devdocs
170170 git clone https://github.com/KhronosGroup/OpenGL-Refpages.git
171−mkdir $DEVDOCS_ROOT/docs/opengl~gl4
172−mkdir $DEVDOCS_ROOT/docs/opengl~gl2.1
173−cp -r OpenGL-Refpages/gl4/html/* "$DEVDOCS_ROOT/docs/opengl~gl4"
174−cp -r OpenGL-Refpages/gl2.1/xhtml/* "$DEVDOCS_ROOT/docs/opengl~gl2.1"
171+mkdir $DEVDOCS_ROOT/docs/opengl~4
172+mkdir $DEVDOCS_ROOT/docs/opengl~2.1
173+cp -r OpenGL-Refpages/gl4/html/* "$DEVDOCS_ROOT/docs/opengl~4"
174+cp -r OpenGL-Refpages/gl2.1/xhtml/* "$DEVDOCS_ROOT/docs/opengl~2.1"
175175 ```
176176
177177 ## OpenJDK
lib/docs/scrapers/opengl.rb+10−15
@@ -10,25 +10,20 @@ module Docs · 9 unmodified lines
1010 # indexflat.php is a copy of index.php
1111 options[:skip] = %w(indexflat.php)
1212
13− options[:attribution] = <<-HTML
14− Copyright 2017-2021 The Khronos Group, Inc.. This work is licensed
15− under a <a href="http://creativecommons.org/licenses/by/4.0/">Creative
16− Commons Attribution 4.0 International License</a>.
17− HTML
13+ options[:attribution] = ->(filter) {
14+ # copyright is the last section in these pages
15+ return filter.css('.refsect1:last-child').css('p').inner_text
16+ }
1817
19− version 'gl2.1' do
18+ version '2.1' do
2019 self.root_path = 'index.html'
21− self.release = 'gl2.1'
22− self.base_url = "https://registry.khronos.org/OpenGL-Refpages/#{self.version}/"
20+ self.release = '2.1'
21+ self.base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{self.version}/"
2322 end
24− version 'gl4' do
23+ version '4' do
2524 self.root_path = 'index.php'
26− self.release = 'gl4'
27− self.base_url = "https://registry.khronos.org/OpenGL-Refpages/#{self.version}/"
28− end
29−
30− def get_latest_version(opts)
31− return 'v1.0.0'
25+ self.release = '4'
26+ self.base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{self.version}/"
3227 end
3328 end
3429 end