Unified · Split
| @@ -157,17 +157,6 @@ curl https://numpy.org/doc/$VERSION/numpy-html.zip | \ · 156 unmodified lines | |||
| 157 | bsdtar --extract --file=- --directory=docs/numpy~$VERSION/ | 157 | bsdtar --extract --file=- --directory=docs/numpy~$VERSION/ |
| 158 | ``` | 158 | ``` |
| 159 | 159 | ||
| 160 | ## OCaml | ||
| 161 | |||
| 162 | Download from https://www.ocaml.org/docs/ the HTML reference: | ||
| 163 | https://v2.ocaml.org/releases/4.14/ocaml-4.14-refman-html.tar.gz | ||
| 164 | and extract it as `docs/ocaml`: | ||
| 165 | |||
| 166 | ```sh | ||
| 167 | curl https://v2.ocaml.org/releases/$VERSION/ocaml-$VERSION-refman-html.tar.gz | \ | ||
| 168 | tar xz --transform 's/htmlman/ocaml/' --directory docs/ | ||
| 169 | ``` | ||
| 170 | |||
| 171 | ## OpenGL | 160 | ## OpenGL |
| 172 | 161 | ||
| 173 | ```sh | 162 | ```sh |
| @@ -3,6 +3,8 @@ module Docs · 2 unmodified lines | |||
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | 5 | ||
| 6 | css('#sidebar').remove | ||
| 7 | |||
| 6 | css('pre').each do |node| | 8 | css('pre').each do |node| |
| 7 | span = node.at_css('span[id]') | 9 | span = node.at_css('span[id]') |
| 8 | node['id'] = span['id'] if span | 10 | node['id'] = span['id'] if span |
| @@ -1,5 +1,5 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Ocaml < FileScraper | 2 | class Ocaml < UrlScraper |
| 3 | self.name = 'OCaml' | 3 | self.name = 'OCaml' |
| 4 | self.type = 'ocaml' | 4 | self.type = 'ocaml' |
| 5 | self.root_path = 'index.html' | 5 | self.root_path = 'index.html' |
| @@ -16,15 +16,20 @@ module Docs · 10 unmodified lines | |||
| 16 | 16 | ||
| 17 | options[:skip_patterns] = [ | 17 | options[:skip_patterns] = [ |
| 18 | /\Acompilerlibref\//, | 18 | /\Acompilerlibref\//, |
| 19 | /\Alibref\/type_/, | 19 | /\Aapi\/type_/, |
| 20 | /\Alibref\/Stdlib\.\w+\.html/, | 20 | /\Aapi\/Stdlib\.\w+\.html/, |
| 21 | ] | 21 | ] |
| 22 | 22 | ||
| 23 | options[:attribution] = <<-HTML | 23 | options[:attribution] = <<-HTML |
| 24 | © 1995-2022 INRIA. | 24 | © 1995-2024 INRIA. |
| 25 | HTML | 25 | HTML |
| 26 | 26 | ||
| 27 | version '' do | 27 | version '' do |
| 28 | self.release = '5.2' | ||
| 29 | self.base_url = "https://ocaml.org/manual/#{self.release}/" | ||
| 30 | end | ||
| 31 | |||
| 32 | version '5.0' do | ||
| 28 | self.release = '5.0' | 33 | self.release = '5.0' |
| 29 | self.base_url = "https://v2.ocaml.org/releases/#{self.release}/htmlman/" | 34 | self.base_url = "https://v2.ocaml.org/releases/#{self.release}/htmlman/" |
| 30 | end | 35 | end |