Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -117,6 +117,11 @@ credits = [ · 116 unmodified lines | ||
| 117 | 117 | '2014 Michael Bostock', |
| 118 | 118 | 'BSD', |
| 119 | 119 | 'https://raw.github.com/mbostock/d3/master/LICENSE' |
| 120 | + ], [ | |
| 121 | + 'Django', | |
| 122 | + 'Django Software Foundation and individual contributors', | |
| 123 | + 'BSD', | |
| 124 | + 'https://raw.githubusercontent.com/django/django/master/LICENSE' | |
| 120 | 125 | ], [ |
| 121 | 126 | 'Ember.js', |
| 122 | 127 | '2014 Yehuda Katz, Tom Dale and Ember.js contributors', |
| @@ -32,7 +32,10 @@ newsItem = (date, news) -> · 31 unmodified lines | ||
| 32 | 32 | result |
| 33 | 33 | |
| 34 | 34 | app.news = [ |
| 35 | − [ 1406419200000, # July 27, 2014 | |
| 35 | + [ 1407110400000, # August 4, 2014 | |
| 36 | + """ New <a href="/django/">Django</a> documentation """, | |
| 37 | + ], [ | |
| 38 | + 1406419200000, # July 27, 2014 | |
| 36 | 39 | """ New <a href="/markdown/">Markdown</a> documentation """, |
| 37 | 40 | ], [ |
| 38 | 41 | 1404518400000, # July 5, 2014 |
| @@ -3,4 +3,5 @@ · 2 unmodified lines | ||
| 3 | 3 | class app.views.SphinxPage extends app.views.BasePage |
| 4 | 4 | afterRender: -> |
| 5 | 5 | @highlightCode @findAll('pre.python'), 'python' |
| 6 | + @highlightCode @findAll('pre.markup'), 'markup' | |
| 6 | 7 | return |
| @@ -63,3 +63,4 @@ · 62 unmodified lines | ||
| 63 | 63 | ._icon-sinon:before { background-position: -4rem -9rem; } |
| 64 | 64 | ._icon-cordova:before { background-position: 0 -10rem; } |
| 65 | 65 | ._icon-markdown:before { background-position: -1rem -10rem; } |
| 66 | +._icon-django:before { background-position: -2rem -10rem; } | |
| @@ -0,0 +1,42 @@ | ||
| 1 | +module Docs | |
| 2 | + class Django | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + @doc = at_css('.yui-g') | |
| 6 | + | |
| 7 | + css('.section', 'a > em').each do |node| | |
| 8 | + node.before(node.children).remove | |
| 9 | + end | |
| 10 | + | |
| 11 | + css('tt', 'span.pre').each do |node| | |
| 12 | + node.name = 'code' | |
| 13 | + node.content = node.content | |
| 14 | + node.remove_attribute 'class' | |
| 15 | + end | |
| 16 | + | |
| 17 | + css('.headerlink').each do |node| | |
| 18 | + id = node['href'][1..-1] | |
| 19 | + node.parent['id'] ||= id | |
| 20 | + doc.at_css("span##{id}").try(:remove) | |
| 21 | + node.remove | |
| 22 | + end | |
| 23 | + | |
| 24 | + css('h1', 'h2', 'h3', 'dt').each do |node| | |
| 25 | + node.content = node.content | |
| 26 | + end | |
| 27 | + | |
| 28 | + css('div[class^="highlight-"]').each do |node| | |
| 29 | + node.name = 'pre' | |
| 30 | + node['class'] = case node['class'] | |
| 31 | + when 'highlight-python' then 'python' | |
| 32 | + when 'highlight-html+django' then 'markup' | |
| 33 | + else '' | |
| 34 | + end | |
| 35 | + node.content = node.at_css('pre').content | |
| 36 | + end | |
| 37 | + | |
| 38 | + doc | |
| 39 | + end | |
| 40 | + end | |
| 41 | + end | |
| 42 | +end | |
| @@ -0,0 +1,46 @@ | ||
| 1 | +module Docs | |
| 2 | + class Django | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').content.remove("\u{00b6}") | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + case subpath | |
| 10 | + when /\Atopics/ | |
| 11 | + 'Guides' | |
| 12 | + when /\Aintro/ | |
| 13 | + 'Guides: Intro' | |
| 14 | + when /\Ahowto/ | |
| 15 | + 'Guides: How-tos' | |
| 16 | + when /\Aref/ | |
| 17 | + 'API' | |
| 18 | + end | |
| 19 | + end | |
| 20 | + | |
| 21 | + def additional_entries | |
| 22 | + entries = [] | |
| 23 | + | |
| 24 | + css('dl.function', 'dl.class', 'dl.method', 'dl.attribute').each do |node| | |
| 25 | + next unless id = node.at_css('dt')['id'] | |
| 26 | + next unless name = id.dup.sub!('django.', '') | |
| 27 | + | |
| 28 | + path = name.split('.') | |
| 29 | + type = "django.#{path.first}" | |
| 30 | + type << ".#{path.second}" if %w(contrib db).include?(path.first) | |
| 31 | + | |
| 32 | + name.remove! 'contrib.' | |
| 33 | + name << '()' if node['class'].include?('method') || node['class'].include?('function') | |
| 34 | + | |
| 35 | + entries << [name, id, type] | |
| 36 | + end | |
| 37 | + | |
| 38 | + entries | |
| 39 | + end | |
| 40 | + | |
| 41 | + def include_default_entry? | |
| 42 | + at_css('#sidebar a[href="index"]') | |
| 43 | + end | |
| 44 | + end | |
| 45 | + end | |
| 46 | +end | |
| @@ -0,0 +1,10 @@ | ||
| 1 | +module Docs | |
| 2 | + class Django | |
| 3 | + class FixUrlsFilter < Filter | |
| 4 | + def call | |
| 5 | + html.gsub! %r{#{Regexp.escape(Django.base_url)}([^"']+?)\.html}, "#{Django.base_url}\\1/" | |
| 6 | + html | |
| 7 | + end | |
| 8 | + end | |
| 9 | + end | |
| 10 | +end | |
| @@ -0,0 +1,36 @@ | ||
| 1 | +module Docs | |
| 2 | + class Django < FileScraper | |
| 3 | + self.name = 'Django' | |
| 4 | + self.type = 'sphinx' | |
| 5 | + self.version = '1.6.6' | |
| 6 | + self.dir = '/Users/Thibaut/DevDocs/Docs/Django' | |
| 7 | + self.base_url = 'https://docs.djangoproject.com/en/1.6/' | |
| 8 | + self.root_path = 'index.html' | |
| 9 | + | |
| 10 | + html_filters.push 'django/entries', 'django/clean_html' | |
| 11 | + text_filters.push 'django/fix_urls' | |
| 12 | + | |
| 13 | + options[:container] = '#bd' | |
| 14 | + | |
| 15 | + options[:skip] = %w( | |
| 16 | + contents.html | |
| 17 | + genindex.html | |
| 18 | + py-modindex.html | |
| 19 | + glossary.html | |
| 20 | + search.html | |
| 21 | + intro/whatsnext.html) | |
| 22 | + | |
| 23 | + options[:skip_patterns] = [ | |
| 24 | + /\Afaq\//, | |
| 25 | + /\Ainternals\//, | |
| 26 | + /\Amisc\//, | |
| 27 | + /\Areleases\//, | |
| 28 | + /\A_/, | |
| 29 | + /flattened\-index\.html/] | |
| 30 | + | |
| 31 | + options[:attribution] = <<-HTML | |
| 32 | + © Django Software Foundation and individual contributors<br> | |
| 33 | + Licensed under the BSD License. | |
| 34 | + HTML | |
| 35 | + end | |
| 36 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://github.com/django/djangoproject.com/raw/master/static/favicon.ico | |