File tree Expand file tree Collapse file tree 8 files changed +106
-0
lines changed Expand file tree Collapse file tree 8 files changed +106
-0
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 @@ -161,6 +161,19 @@ curl https://v2.ocaml.org/releases/$VERSION/ocaml-$VERSION-refman-html.tar.gz |
161161tar xz --transform ' s/htmlman/ocaml/' --directory docs/
162162```
163163
164+ ## Opengl
165+
166+ Clone https://github.com/KhronosGroup/OpenGL-Refpages.git
167+
168+ ``` sh
169+ DEVDOCS_ROOT=/path/to/devdocs
170+ git clone https://github.com/KhronosGroup/OpenGL-Refpages.git
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"
175+ ```
176+
164177## OpenJDK
165178Search 'Openjdk' in https://www.debian.org/distrib/packages , find the ` openjdk-$VERSION-doc ` package,
166179download it, extract it with ` dpkg -x $PACKAGE ./ ` and move ` ./usr/share/doc/openjdk-16-jre-headless/api/ `
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Opengl
3+ class CleanHtmlFilter < Filter
4+ def call
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
10+ css ( '.funcprototype-table' ) . each do |node |
11+ node . css ( 'td' ) . each do |data |
12+ data . replace ( data . children )
13+ end
14+ node . css ( 'tr' ) . each do |row |
15+ row . replace ( row . children )
16+ end
17+ node . wrap ( '<div>' )
18+ node . parent [ 'id' ] = node . css ( '.fsfunc' ) . text
19+ node . replace ( node . children )
20+ end
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+
28+ doc
29+ end
30+ end
31+ end
32+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Opengl
3+ class EntriesFilter < Docs ::EntriesFilter
4+ def get_name
5+ slug . chomp ( '.xhtml' ) . chomp ( '.xml' )
6+ end
7+
8+ # gl4 also has documentation of GLSL, this string is present under Version Support
9+ def get_type
10+ return 'GLSL' if html . include? ( 'OpenGL Shading Language Version' )
11+ 'OpenGL'
12+ end
13+
14+ # functions like glUniform1f, glUniform2f, glUniform... have the same documentation
15+ def additional_entries
16+ entries = [ ]
17+ css ( '.fsfunc' ) . each do |function |
18+ next if function . text == name
19+ entries << [ function . text , function . text ]
20+ end
21+ entries
22+ end
23+ end
24+ end
25+ end
Original file line number Diff line number Diff line change 1+ module Docs
2+ class Opengl < FileScraper
3+ self . type = 'simple'
4+ self . name = 'OpenGL'
5+ self . root_path = 'index.php'
6+ self . links = {
7+ home : 'https://registry.khronos.org/OpenGL-Refpages/'
8+ }
9+ html_filters . push 'opengl/entries' , 'opengl/clean_html'
10+
11+ # indexflat.php is a copy of index.php
12+ options [ :skip ] = %w( indexflat.php )
13+
14+ options [ :attribution ] = -> ( filter ) {
15+ # copyright is the last section in these pages
16+ return filter . css ( 'h2:contains("Copyright") ~ p' ) . inner_text
17+ }
18+
19+ version '4' do
20+ self . root_path = 'index.php'
21+ self . release = '4'
22+ self . base_url = "https://registry.khronos.org/OpenGL-Refpages/gl#{ self . version } /"
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
30+ end
31+ end
Original file line number Diff line number Diff line change 1+ https://www.khronos.org/legal/trademarks/
You can’t perform that action at this time.
0 commit comments