diff --git a/assets/images/icons.png b/assets/images/icons.png
index bdb65351..710937f6 100644
Binary files a/assets/images/icons.png and b/assets/images/icons.png differ
diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png
index adf79899..ff584af0 100644
Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee
index d2c261d2..df8c3419 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -138,6 +138,11 @@ credits = [
'1997-2013 The PHP Documentation Group',
'CC BY',
'http://creativecommons.org/licenses/by/3.0/'
+ ], [
+ 'Python',
+ '1990-2013 Python Software Foundation
Python is a trademark of the Python Software Foundation.',
+ 'PSFL',
+ 'http://docs.python.org/3/license.html'
], [
'Ruby',
'1993-2013 Yukihiro Matsumoto',
diff --git a/assets/javascripts/templates/pages/news_tmpl.coffee b/assets/javascripts/templates/pages/news_tmpl.coffee
index 278065d9..35f51801 100644
--- a/assets/javascripts/templates/pages/news_tmpl.coffee
+++ b/assets/javascripts/templates/pages/news_tmpl.coffee
@@ -24,7 +24,10 @@ newsItem = (date, news) ->
result
app.news = [
- [ 1384819200000, # November 19, 2013
+ [ 1385424000000, # November 26, 2013
+ """ New Python documentation """
+ ], [
+ 1384819200000, # November 19, 2013
""" New Ruby on Rails documentation """
], [
1384560000000, # November 16, 2013
@@ -35,7 +38,8 @@ app.news = [
], [
1381276800000, # October 9, 2013
""" DevDocs is now available as a Chrome web app. """
- ], [ 1379808000000, # September 22, 2013
+ ], [
+ 1379808000000, # September 22, 2013
""" New PHP documentation """
], [
1378425600000, # September 6, 2013
diff --git a/assets/javascripts/views/pages/sphinx.coffee b/assets/javascripts/views/pages/sphinx.coffee
new file mode 100644
index 00000000..cecc751c
--- /dev/null
+++ b/assets/javascripts/views/pages/sphinx.coffee
@@ -0,0 +1,6 @@
+#= require views/pages/base
+
+class app.views.SphinxPage extends app.views.BasePage
+ afterRender: ->
+ @highlightCode @findAll('pre.python'), 'python'
+ return
diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss
index f1c0641b..559d270c 100644
--- a/assets/stylesheets/application.css.scss
+++ b/assets/stylesheets/application.css.scss
@@ -38,5 +38,6 @@
'pages/php',
'pages/rdoc',
'pages/rfc',
+ 'pages/sphinx',
'pages/underscore',
'pages/yard';
diff --git a/assets/stylesheets/components/_content.scss b/assets/stylesheets/components/_content.scss
index a48ca6f2..d6cbb62f 100644
--- a/assets/stylesheets/components/_content.scss
+++ b/assets/stylesheets/components/_content.scss
@@ -153,7 +153,6 @@
%lined-heading {
white-space: nowrap;
overflow: hidden;
- overflow-wrap: normal;
word-wrap: normal;
&:after {
diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss
index bc2016f4..36f4e4de 100644
--- a/assets/stylesheets/global/_icons.scss
+++ b/assets/stylesheets/global/_icons.scss
@@ -4,7 +4,7 @@
width: 1rem;
height: 1rem;
background-image: image-url('icons.png');
- background-size: 5rem 6rem;
+ background-size: 5rem 7rem;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
@@ -41,3 +41,4 @@
._icon-php:before { background-position: -2rem -5rem; }
._icon-ruby:before { background-position: -3rem -5rem; }
._icon-rails:before { background-position: -4rem -5rem; }
+._icon-python:before { background-position: 0 -6rem; }
diff --git a/assets/stylesheets/pages/_sphinx.scss b/assets/stylesheets/pages/_sphinx.scss
new file mode 100644
index 00000000..44b9f1f3
--- /dev/null
+++ b/assets/stylesheets/pages/_sphinx.scss
@@ -0,0 +1,26 @@
+._sphinx {
+ h2, h3 { @extend %block-heading; }
+ dl:not(.docutils) > dt { @extend %block-label, %label-blue; }
+ dt + dt { margin-top: -.5em; }
+
+ .note, .admonition, .versionadded, .versionchanged, .deprecated-removed { @extend %note; }
+ .deprecated-removed { @extend %note-red; }
+ .versionmodified { font-weight: bold; }
+
+ p > code, li > code { @extend %label; }
+
+ .admonition-title {
+ float: left;
+ margin: 0 .5em 0 0;
+ font-weight: bold;
+
+ &:after { content: ':'; }
+ }
+
+ .admonition > dl {
+ clear: left;
+ margin: 0;
+ }
+
+ ul.simple { margin: 1em 0; }
+}
diff --git a/lib/docs/filters/python/clean_html.rb b/lib/docs/filters/python/clean_html.rb
new file mode 100644
index 00000000..c5ea0df4
--- /dev/null
+++ b/lib/docs/filters/python/clean_html.rb
@@ -0,0 +1,68 @@
+module Docs
+ class Python
+ class CleanHtmlFilter < Filter
+ def call
+ @doc = at_css '.body > .section'
+
+ # Clean inline code elements
+
+ css('tt.literal').each do |node|
+ node.before(node.children).remove
+ end
+
+ css('tt', 'span.pre').each do |node|
+ node.name = 'code'
+ node.remove_attribute 'class'
+ end
+
+ root_page? ? root : other
+
+ doc
+ end
+
+ def root
+ at_css('h1').content = 'Python'
+ css('> p').remove
+ end
+
+ def other
+ css('.headerlink', 'hr').remove
+
+ # Clean headings
+
+ at_css('h1').tap do |node|
+ node.content = node.content.sub!(/\A[\d\.]+/) { |str| @levelRegexp = /\A#{str}/; '' }
+ end
+
+ css('h2', 'h3', 'h4').each do |node|
+ node.css('a').each do |link|
+ link.before(link.children).remove
+ end
+ node.child.content = node.child.content.sub @levelRegexp, ''
+ end
+
+ css('dt').each do |node|
+ node.content = node.content
+ end
+
+ # Remove blockquotes
+ css('blockquote').each do |node|
+ node.before(node.children).remove
+ end
+
+ # Remove code highlighting
+ css('.highlight-python3').each do |node|
+ pre = node.at_css('pre')
+ pre.content = pre.content
+ pre['class'] = 'python'
+ node.replace(pre)
+ end
+
+ # Remove