-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
gtk.rb
116 lines (100 loc) · 3.62 KB
/
gtk.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
module Docs
class Gtk < UrlScraper
self.name = 'GTK'
self.slug = 'gtk'
self.type = 'gtk'
self.root_path = 'index.html'
self.links = {
home: 'https://www.gtk.org/',
code: 'https://gitlab.gnome.org/GNOME/gtk/'
}
html_filters.push 'gtk/entries', 'gtk/clean_html', 'title'
options[:container] = '.content'
# These are all "index"-ish pages with no valuable content
GTK3_SKIP = %w(
gtk.html
gtk-resources.html gtk-question-index.html
gtkobjects.html
Application.html Builder.html WindowWidgets.html LayoutContainers.html
DisplayWidgets.html ButtonWidgets.html NumericEntry.html
TextWidgetObjects.html TreeWidgetObjects.html MenusAndCombos.html
SelectorWidgets.html Ornaments.html ScrollingWidgets.html Printing.html
ShortcutsOverview.html MiscObjects.html AbstractObjects.html
PlugSocket.html RecentDocuments.html ApplicationChoosing.html
Gestures.html DeprecatedObjects.html
gtkbase.html
theming.html
migrating.html
ch26s02.html ch28s02.html
pt06.html
platform-support.html
glossary.html
annotation-glossary.html
)
GTK3_SKIP_PATTERNS = [
/migrating/, /checklist/, /ch30/, /ch32/, /api-index-/
]
# These are all "index"-ish pages with no valuable content
GTK4_SKIP = %w(
gtk.html
gtk-resources.html gtk-question-index.html ch02s02.html
concepts.html
gtkobjects.html
Lists.html Trees.html Application.html Builder.html WindowWidgets.html
LayoutContainers.html LayoutManagers.html DisplayWidgets.html
MediaSupport.html ButtonWidgets.html NumericEntry.html
MenusAndCombos.html SelectorWidgets.html DrawingWidgets.html
Ornaments.html ScrollingWidgets.html Printing.html
ShortcutsOverview.html MiscObjects.html AbstractObjects.html
RecentDocuments.html ApplicationChoosing.html Gestures.html ch36.html
ch37.html
gtkbase.html
theming.html
migrating.html
ch41s02.html ch41s03.html
pt07.html
platform-support.html
api-index-full.html
annotation-glossary.html
)
GTK4_SKIP_PATTERNS = [
/migrating/, /ch03/, /ch09/, /ch10/
]
options[:attribution] = <<-HTML
© 2005–2020 The GNOME Project<br>
Licensed under the GNU Lesser General Public License version 2.1 or later.
HTML
version '4.0' do
self.release = '4.0.0'
self.base_url = "https://developer-old.gnome.org/gtk4/#{self.version}/"
options[:root_title] = 'GTK 4 Reference Manual'
options[:skip] = GTK4_SKIP
options[:skip_patterns] = GTK4_SKIP_PATTERNS
end
version '3.24' do
self.release = '3.24.24'
self.base_url = "https://developer.gnome.org/gtk3/#{self.version}/"
options[:root_title] = 'GTK+ 3 Reference Manual'
options[:skip] = GTK3_SKIP
options[:skip_patterns] = GTK3_SKIP_PATTERNS
end
version '3.22' do
self.release = '3.22.3'
self.base_url = "https://developer.gnome.org/gtk3/#{self.version}/"
options[:root_title] = 'GTK+ 3 Reference Manual'
options[:skip] = GTK3_SKIP
options[:skip_patterns] = GTK3_SKIP_PATTERNS
end
version '3.20' do
self.release = '3.20.4'
self.base_url = "https://developer.gnome.org/gtk3/#{self.version}/"
options[:root_title] = 'GTK+ 3 Reference Manual'
options[:skip] = GTK3_SKIP
options[:skip_patterns] = GTK3_SKIP_PATTERNS
end
def get_latest_version(opts)
tags = get_gitlab_tags('gitlab.gnome.org', 'GNOME', 'gtk', opts)
tags[0]['name']
end
end
end