File tree Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 1
1
module Docs
2
- class Mkdocs < Scraper
2
+ class Mkdocs < UrlScraper
3
3
self . abstract = true
4
+ self . type = 'mkdocs'
5
+
6
+ html_filters . push 'mkdocs/clean_html'
7
+
8
+ private
9
+
10
+ def handle_response ( response )
11
+ # Some scrapped urls don't have ending slash
12
+ # which leads to page duplication
13
+ if !response . url . path . ends_with? ( '/' ) && !response . url . path . ends_with? ( 'index.html' )
14
+ response . url . path << '/'
15
+ end
16
+ super
17
+ end
4
18
end
5
19
end
Original file line number Diff line number Diff line change 1
1
module Docs
2
- class RestFramework < UrlScraper
2
+ class RestFramework < Mkdocs
3
3
self . name = 'Django REST Framework'
4
4
self . release = '3.9.2'
5
5
self . slug = 'rest_framework'
@@ -11,7 +11,7 @@ class RestFramework < UrlScraper
11
11
code : 'https://github.com/encode/django-rest-framework'
12
12
}
13
13
14
- html_filters . push 'mkdocs/clean_html' , ' rest_framework/clean_html', 'rest_framework/entries'
14
+ html_filters . push 'rest_framework/clean_html' , 'rest_framework/entries'
15
15
16
16
options [ :skip_patterns ] = [
17
17
/\A topics\/ / ,
@@ -22,16 +22,5 @@ class RestFramework < UrlScraper
22
22
Copyright 2011–present Encode OSS Ltd< br >
23
23
Licensed under the BSD License.
24
24
HTML
25
-
26
- private
27
-
28
- def handle_response ( response )
29
- # Some scrapped urls don't have ending slash
30
- # which leads to page duplication
31
- if !response . url . path . ends_with? ( '/' ) && !response . url . path . ends_with? ( 'index.html' )
32
- response . url . path << '/'
33
- end
34
- super
35
- end
36
25
end
37
26
end
You can’t perform that action at this time.
0 commit comments