History

Fix minor issues in Django scraper

Fixes #426.

Thibaut Courouble committed 10 years ago

Commit 2826b541 parent 77ea68b3 files · +5 −3Browse files

Unified · Split

3 files
  1. assets/stylesheets/pages/_sphinx.scss +1 −1
  2. lib/docs/filters/django/clean_html.rb +3 −1
  3. lib/docs/filters/django/fix_urls.rb +1 −1
assets/stylesheets/pages/_sphinx.scss+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525
2626 ul.simple { margin: 1em 0; }
2727
28− dt > a.external { float: right; }
28+ h2 > a, h3 > a, dt > a { float: right; }
2929 }
3030
3131 ._sphinx {
lib/docs/filters/django/clean_html.rb+3−1
@@ -22,13 +22,15 @@ module Docs · 21 unmodified lines
2222 end
2323
2424 css('h1', 'h2', 'h3', 'dt').each do |node|
25+ links = node.css('a').remove
2526 node.content = node.content
27+ node << links
2628 end
2729
2830 css('div[class^="highlight-"]').each do |node|
2931 node.name = 'pre'
3032 node['class'] = node['data-language'] = case node['class']
31− when 'highlight-python' then 'python'
33+ when 'highlight-python', 'highlight-default' then 'python'
3234 when 'highlight-html+django' then 'markup'
3335 else ''
3436 end
lib/docs/filters/django/fix_urls.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Django
33 class FixUrlsFilter < Filter
44 def call
5− html.gsub! %r{#{Regexp.escape(Django.base_url)}([^"']+?)\.html}, "#{Django.base_url}\\1/"
5+ html.gsub! %r{#{Regexp.escape(context[:base_url].to_s)}([^"']+?)\.html}, "#{context[:base_url]}\\1/"
66 html
77 end
88 end