2
2
3
3
module Docs
4
4
class Koa < Github
5
- self . base_url = 'https://github.com/koajs/koa/tree/master/docs'
6
- self . release = '2.15.0'
7
-
8
- self . root_path = 'api/index.md'
9
5
self . initial_paths = %w[
10
6
error-handling
11
7
faq
@@ -26,20 +22,47 @@ class Koa < Github
26
22
27
23
html_filters . push 'koa/clean_html' , 'koa/entries'
28
24
29
- options [ :skip ] = %w[ middleware .gif]
25
+ options [ :skip_patterns ] = [ / \ . gif/ ]
30
26
options [ :trailing_slash ] = false
31
27
options [ :container ] = '.markdown-body'
32
28
33
- options [ :fix_urls ] = -> ( url ) do
34
- url . sub! 'https://koajs.com/#error-handling' , Koa . base_url + '/error-handling.md'
35
- url
36
- end
29
+
37
30
38
31
options [ :attribution ] = <<-HTML
39
32
© 2020 Koa contributors< br >
40
33
Licensed under the MIT License.
41
34
HTML
42
35
36
+ version do
37
+ self . base_url = 'https://github.com/koajs/koa/blob/v3.0.0/docs'
38
+ self . root_path = 'api/index.md'
39
+ self . release = '3.0.0'
40
+ options [ :fix_urls ] = -> ( url ) do
41
+ url . sub! 'https://koajs.com/#error-handling' , self . base_url + '/error-handling.md'
42
+ url
43
+ end
44
+ end
45
+
46
+ version '2' do
47
+ self . base_url = 'https://github.com/koajs/koa/blob/v2.16.1/docs'
48
+ self . root_path = 'api/index.md'
49
+ self . release = '2.16.1'
50
+ options [ :fix_urls ] = -> ( url ) do
51
+ url . sub! 'https://koajs.com/#error-handling' , self . base_url + '/error-handling.md'
52
+ url
53
+ end
54
+ end
55
+
56
+ version '1' do
57
+ self . base_url = 'https://github.com/koajs/koa/blob/1.7.1/docs'
58
+ self . root_path = 'api/index.md'
59
+ self . release = '1.7.1'
60
+ options [ :fix_urls ] = -> ( url ) do
61
+ url . sub! 'https://koajs.com/#error-handling' , self . base_url + '/error-handling.md'
62
+ url
63
+ end
64
+ end
65
+
43
66
def get_latest_version ( opts )
44
67
get_npm_version ( 'koa' , opts )
45
68
end
0 commit comments