Skip to content

Commit 2b8d9b6

Browse files
committed
Update OCaml documentation (5.2)
1 parent 6ccf04a commit 2b8d9b6

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

docs/file-scrapers.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,6 @@ curl https://numpy.org/doc/$VERSION/numpy-html.zip | \
157157
bsdtar --extract --file=- --directory=docs/numpy~$VERSION/
158158
```
159159

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-
171160
## OpenGL
172161

173162
```sh

lib/docs/filters/ocaml/clean_html.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ class Ocaml
33
class CleanHtmlFilter < Filter
44
def call
55

6+
css('#sidebar').remove
7+
68
css('pre').each do |node|
79
span = node.at_css('span[id]')
810
node['id'] = span['id'] if span

lib/docs/scrapers/ocaml.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Docs
2-
class Ocaml < FileScraper
2+
class Ocaml < UrlScraper
33
self.name = 'OCaml'
44
self.type = 'ocaml'
55
self.root_path = 'index.html'
@@ -16,15 +16,20 @@ class Ocaml < FileScraper
1616

1717
options[:skip_patterns] = [
1818
/\Acompilerlibref\//,
19-
/\Alibref\/type_/,
20-
/\Alibref\/Stdlib\.\w+\.html/,
19+
/\Aapi\/type_/,
20+
/\Aapi\/Stdlib\.\w+\.html/,
2121
]
2222

2323
options[:attribution] = <<-HTML
24-
&copy; 1995-2022 INRIA.
24+
&copy; 1995-2024 INRIA.
2525
HTML
2626

2727
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
2833
self.release = '5.0'
2934
self.base_url = "https://v2.ocaml.org/releases/#{self.release}/htmlman/"
3035
end

0 commit comments

Comments
 (0)