Showing the changes to lib/docs (4 of 8 files). Show all
Unified · Split
| @@ -1,14 +1,14 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class RestFramework | 2 | class DjangoRestFramework |
| 3 | class CleanHtmlFilter < Docs::Filter | 3 | class CleanHtmlFilter < Docs::Filter |
| 4 | def call | 4 | def call |
| 5 | css('hr').remove | 5 | css('hr').remove |
| 6 | |||
| 7 | css('.badges').remove | 6 | css('.badges').remove |
| 8 | 7 | ||
| 9 | css('pre').attr('data-language', 'python') | 8 | css('pre').attr('data-language', 'python') |
| 10 | 9 | ||
| 11 | css('h1').attr('style', nil) | 10 | css('h1').remove_attribute('style') |
| 11 | css('.promo a').remove_attribute('style') | ||
| 12 | 12 | ||
| 13 | # Translate source files links to DevDocs links | 13 | # Translate source files links to DevDocs links |
| 14 | links = Nokogiri::XML::Node.new('p', doc) | 14 | links = Nokogiri::XML::Node.new('p', doc) |
| @@ -20,6 +20,7 @@ module Docs · 5 unmodified lines | |||
| 20 | node['class'] = '_links-link' | 20 | node['class'] = '_links-link' |
| 21 | links.add_child(node) | 21 | links.add_child(node) |
| 22 | end | 22 | end |
| 23 | |||
| 23 | doc.add_child(links) | 24 | doc.add_child(links) |
| 24 | 25 | ||
| 25 | doc | 26 | doc |
| @@ -1,7 +1,6 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class RestFramework | 2 | class DjangoRestFramework |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | |||
| 5 | def get_name | 4 | def get_name |
| 6 | name = css('h1').first.content | 5 | name = css('h1').first.content |
| 7 | name.slice! 'Tutorial ' | 6 | name.slice! 'Tutorial ' |
| @@ -46,7 +45,7 @@ module Docs · 38 unmodified lines | |||
| 46 | next | 45 | next |
| 47 | end | 46 | end |
| 48 | entries << [node.content, node['id'], local_type] | 47 | entries << [node.content, node['id'], local_type] |
| 49 | elsif accepted_headers.include? node.content | 48 | elsif accepted_headers.include? node.content |
| 50 | in_category = true | 49 | in_category = true |
| 51 | elsif endings.any? { |word| node.content.ends_with?(word) } | 50 | elsif endings.any? { |word| node.content.ends_with?(word) } |
| 52 | entries << [node.content, node['id'], local_type] | 51 | entries << [node.content, node['id'], local_type] |
| @@ -1,8 +1,8 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class RestFramework < Mkdocs | 2 | class DjangoRestFramework < Mkdocs |
| 3 | self.name = 'Django REST Framework' | 3 | self.name = 'Django REST Framework' |
| 4 | self.release = '3.9.2' | 4 | self.release = '3.9.3' |
| 5 | self.slug = 'rest_framework' | 5 | self.slug = 'django_rest_framework' |
| 6 | self.base_url = 'https://www.django-rest-framework.org/' | 6 | self.base_url = 'https://www.django-rest-framework.org/' |
| 7 | self.root_path = 'index.html' | 7 | self.root_path = 'index.html' |
| 8 | self.links = { | 8 | self.links = { |
| @@ -10,7 +10,7 @@ module Docs · 1 unmodified line | |||
| 10 | code: 'https://github.com/encode/django-rest-framework' | 10 | code: 'https://github.com/encode/django-rest-framework' |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | html_filters.push 'rest_framework/clean_html', 'rest_framework/entries' | 13 | html_filters.push 'django_rest_framework/clean_html', 'django_rest_framework/entries' |
| 14 | 14 | ||
| 15 | options[:skip_patterns] = [ | 15 | options[:skip_patterns] = [ |
| 16 | /\Atopics\//, | 16 | /\Atopics\//, |
| @@ -18,8 +18,12 @@ module Docs · 1 unmodified line | |||
| 18 | ] | 18 | ] |
| 19 | 19 | ||
| 20 | options[:attribution] = <<-HTML | 20 | options[:attribution] = <<-HTML |
| 21 | Copyright 2011–present Encode OSS Ltd<br> | 21 | Copyright 2011–present Encode OSS Ltd.<br> |
| 22 | Licensed under the BSD License. | 22 | Licensed under the BSD License. |
| 23 | HTML | 23 | HTML |
| 24 | |||
| 25 | def get_latest_version(opts) | ||
| 26 | get_latest_github_release('encode', 'django-rest-framework', opts) | ||
| 27 | end | ||
| 24 | end | 28 | end |
| 25 | end | 29 | end |
File renamed without changes.