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 11module Docs
2- class Mkdocs < Scraper
2+ class Mkdocs < UrlScraper
33 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
418 end
519end
Original file line number Diff line number Diff line change 11module Docs
2- class RestFramework < UrlScraper
2+ class RestFramework < Mkdocs
33 self . name = 'Django REST Framework'
44 self . release = '3.9.2'
55 self . slug = 'rest_framework'
@@ -11,7 +11,7 @@ class RestFramework < UrlScraper
1111 code : 'https://github.com/encode/django-rest-framework'
1212 }
1313
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'
1515
1616 options [ :skip_patterns ] = [
1717 /\A topics\/ / ,
@@ -22,16 +22,5 @@ class RestFramework < UrlScraper
2222 Copyright 2011–present Encode OSS Ltd< br >
2323 Licensed under the BSD License.
2424 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
3625 end
3726end
You can’t perform that action at this time.
0 commit comments