opengl.rb 862 B

1234567891011121314151617181920212223242526272829
  1. module Docs
  2. class Opengl < FileScraper
  3. self.type = 'simple'
  4. self.root_path = 'index.php'
  5. self.links = {
  6. home: 'https://registry.khronos.org/OpenGL-Refpages/'
  7. }
  8. html_filters.push 'opengl/entries', 'opengl/clean_html'
  9. # indexflat.php is a copy of index.php
  10. options[:skip] = %w(indexflat.php)
  11. options[:attribution] = ->(filter) {
  12. # copyright is the last section in these pages
  13. return filter.css('.refsect1:last-child').css('p').inner_text
  14. }
  15. version '2.1' do
  16. self.root_path = 'index.html'
  17. self.release = '2.1'
  18. self.base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{self.version}/"
  19. end
  20. version '4' do
  21. self.root_path = 'index.php'
  22. self.release = '4'
  23. self.base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{self.version}/"
  24. end
  25. end
  26. end