mirror of https://github.com/freeCodeCamp/devdocs
parent
ef799d1114
commit
49cb0778f2
@ -0,0 +1,22 @@
|
||||
module Docs
|
||||
class Opengl
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
# Rmeove table from function definitions
|
||||
css('.funcprototype-table').each do |node|
|
||||
node.css('td').each do |data|
|
||||
data.replace(data.children)
|
||||
end
|
||||
node.css('tr').each do |row|
|
||||
row.replace(row.children)
|
||||
end
|
||||
node.wrap('<div>')
|
||||
node.parent['id'] = node.css('.fsfunc').text
|
||||
node.replace(node.children)
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,24 @@
|
||||
module Docs
|
||||
class Opengl
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
slug.chomp('.xhtml').chomp('.xml')
|
||||
end
|
||||
|
||||
# gl4 also has documentation of GLSL, this string is present under Version Support
|
||||
def get_type
|
||||
return 'GLSL' if html.include?('OpenGL Shading Language Version')
|
||||
'OpenGL'
|
||||
end
|
||||
|
||||
# functions like glUniform1f, glUniform2f, glUniform... have the same documentation
|
||||
def additional_entries
|
||||
entries = []
|
||||
css('.fsfunc').each do |function|
|
||||
entries << [ function.text, function.text ]
|
||||
end
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,34 @@
|
||||
module Docs
|
||||
class Opengl < FileScraper
|
||||
self.type = 'simple'
|
||||
self.root_path = 'index.php'
|
||||
self.links = {
|
||||
home: 'https://registry.khronos.org/OpenGL-Refpages/'
|
||||
}
|
||||
html_filters.push 'opengl/entries', 'opengl/clean_html'
|
||||
|
||||
# indexflat.php is a copy of index.php
|
||||
options[:skip] = %w(indexflat.php)
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
Copyright 2017-2021 The Khronos Group, Inc.. This work is licensed
|
||||
under a <a href="http://creativecommons.org/licenses/by/4.0/">Creative
|
||||
Commons Attribution 4.0 International License</a>.
|
||||
HTML
|
||||
|
||||
version 'gl2.1' do
|
||||
self.root_path = 'index.html'
|
||||
self.release = 'gl2.1'
|
||||
self.base_url = "https://registry.khronos.org/OpenGL-Refpages/#{self.version}/"
|
||||
end
|
||||
version 'gl4' do
|
||||
self.root_path = 'index.php'
|
||||
self.release = 'gl4'
|
||||
self.base_url = "https://registry.khronos.org/OpenGL-Refpages/#{self.version}/"
|
||||
end
|
||||
|
||||
def get_latest_version(opts)
|
||||
return 'v1.0.0'
|
||||
end
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 416 B |
After Width: | Height: | Size: 559 B |
@ -0,0 +1 @@
|
||||
https://www.khronos.org/legal/trademarks/
|
Loading…
Reference in new issue