From 36d6a109dcc659e62dfb1c493af49bf0d1af112e Mon Sep 17 00:00:00 2001 From: Thibaut Date: Tue, 26 Nov 2013 13:41:18 +0100 Subject: [PATCH] Add Python documentation --- assets/images/icons.png | Bin 11057 -> 11672 bytes assets/images/icons@2x.png | Bin 29046 -> 30802 bytes .../templates/pages/about_tmpl.coffee | 5 ++ .../templates/pages/news_tmpl.coffee | 8 +- assets/javascripts/views/pages/sphinx.coffee | 6 ++ assets/stylesheets/application.css.scss | 1 + assets/stylesheets/components/_content.scss | 1 - assets/stylesheets/global/_icons.scss | 3 +- assets/stylesheets/pages/_sphinx.scss | 26 ++++++ lib/docs/filters/python/clean_html.rb | 68 +++++++++++++++ lib/docs/filters/python/entries.rb | 82 ++++++++++++++++++ lib/docs/scrapers/python.rb | 27 ++++++ public/icons/docs/python/16.png | Bin 0 -> 547 bytes public/icons/docs/python/16@2x.png | Bin 0 -> 1316 bytes public/icons/docs/python/SOURCE | 1 + 15 files changed, 224 insertions(+), 4 deletions(-) create mode 100644 assets/javascripts/views/pages/sphinx.coffee create mode 100644 assets/stylesheets/pages/_sphinx.scss create mode 100644 lib/docs/filters/python/clean_html.rb create mode 100644 lib/docs/filters/python/entries.rb create mode 100644 lib/docs/scrapers/python.rb create mode 100644 public/icons/docs/python/16.png create mode 100644 public/icons/docs/python/16@2x.png create mode 100644 public/icons/docs/python/SOURCE diff --git a/assets/images/icons.png b/assets/images/icons.png index bdb65351003ab43e1259e53b8c0ae58374555cc0..710937f6f6cf3ec4c09278cb561ef5ff350ec1f1 100644 GIT binary patch delta 1927 zcmV;22YC3gR+w9m7Y=X;1^@s6iM{um001ptu_Y8Hf9;)lP*VpU$DdpwoC%kBAe0Is zcR&R}!YN0qU95Jjx=?FZS`}RtanyQ1#Yja9c;G@n&V;K_IRq6!7^e1c(XzYHMTM;> ztgy;XyLQ(tdGEWw#6oFDXgk&E?2zxwck+^Xe|_frJCb>MZx~87-YOawVBE+5TJf|1 zj)nAde?IF;lkClzVTL3SPQ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8o zPc`nRwCDkQe;=;3Hac!}w=p+*I;c%iJ1Th`Vo~xO4N_;OS>{BnQfEg2&Ab8y3(%GM zfM((eiQD=-A06_apnWho1r7@A9~tOypm)nwbiDX7EDJ^_7z%Pe>Y}L4$$JSke{2sN zi-oO;OXFIXfYpkRQnBtx3eu0Rsis~p>~31qeqH*|08XB9C*4mqu2bQ9@vGHKFudyx z=9jEz(Enr*bAabeDrxqWi=DAg!evUR-j{I69vP1mD*1R%;X<0#BJz!=`|_PL^f+s7 zK>O<($Fpx@34ffPjwV{d4KeYse?-Nic78NkRxiVm4XaR_mU0JRTubr}7T!d~wk9WV z9&y~S=bLJrSs}R9qH@Exkv_OE--on&$r+=_6($J>6%^oJi3@g0crb|hXqF05rr?uY znG+6bM7OR7`Ytv^F2?2FPjIqe?_B{7noQ`*cnwX95@3y6L_x;kaQaGof4D9U6)~}Q z0LC0jX`2Wyrgh2iyo!5&of%OKJb>lKr zO|h6u<;v7ch0HOfgz3{L9jCo%d3y**mD+Xqs?IMe$5)5k8KLOjT>`=|EVOa4&sXSq z?XT-CIFyzKTT&95k`iI1e=r-uqLA+wN;vn5M-A{n*TPnnaF0zRg<0u_W`Ph^i3l|k zCm5+J$Px?&NlPB~8%b@*0w!0Z9r|ByXXWPhWbPA-f7Mlfs@>&2it`pX zx1mOIzX9GB%FMmg SBk%wK002ovPDHLk0$_r^rh7mD diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png index adf79899d25b3efb33df7d83710736d62530e5c6..ff584af060bd1fde442e8ab0c2172e802cc20bc6 100644 GIT binary patch delta 9535 zcmV-FCBWMD;sMg|0gx9C;0Oi)004xSZ9xD4cp0%JR8xP)*LePY{LWtIWDg{&t3LyL0^8lnbl`3&B7|gL4Jd}P9 zQ*9`IL^T|%4{x_}=$z(zlxkf`EPXp(`7_RG&7XgvbS~(14%+iqOAs>H2t;Z6m2605 zV6v-ppCIdw2|@y}ahD7Oj?ML&%nYepX7>z62BB;ROslFM>RkIeoeO3F(k$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9;ZjX`oT+wevwu&2C4kFp-LTTu3tx11M8x1x`2QX3{71pa z;pBMzQ7~*U3Wg3rE`{D~xAp^0S@zz@rYnDKdL{WFqqnyryr&2E93IW__XqH=el&+n zPtYaZNO&Z}RDvjaVnJkA2`#1Rw&e=wOo)!|olLPFmm<{UsOaEggaR&7Prz*ws>nBp z)wxImZ7$J3N0Ce+JcDw*d}ASsO+~0Omtc>jA-*BkJ7#T)Mq4xd2Bn4A3#^`OItTC#M+5l=Qo7A{p+u|{p)YIL%PeZO!r??#eAI|v!t*~qWkM- zPb=z{26L4Aak+j2xJ+jsF4NwdBlx&%M<(AtldG}J*nxn`_X2N6cv zh>~jEjx^M~9%-m`AzG?=I?_<%P?S`oA<|I2HbSail3=PW%Qn}ID(Ybn_KmyM(k6fV zw`C4uLnVMKCyEYdo(S#bfu-iQSVG!pZihrO2gI5?AchoWZjVR{JH&tXaN^f| zHxKBCqQO*jc>5sF!=FFWncLeJGAAZKlK(@>C$U3MY|i<@?tA8#+e!s5$6xz+Hsyh& zP3Aflv6hDOVqP&Whh|j3=){~ bHN^h|QG*g^!MJ^`00000NkvXXu0mjfQ=0UH 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 border attribute + css('table[border]').each do |node| + node.remove_attribute 'border' + end + end + end + end +end diff --git a/lib/docs/filters/python/entries.rb b/lib/docs/filters/python/entries.rb new file mode 100644 index 00000000..b2054b41 --- /dev/null +++ b/lib/docs/filters/python/entries.rb @@ -0,0 +1,82 @@ +module Docs + class Python + class EntriesFilter < Docs::EntriesFilter + REPLACE_TYPES = { + 'Cryptographic' => 'Cryptography', + 'Custom Interpreters' => 'Interpreters', + 'Data Compression & Archiving' => 'Data Compression', + 'Generic Operating System' => 'Operating System', + 'Graphical User Interfaces with Tk' => 'Tk', + 'Internet Data Handling' => 'Internet Data', + 'Internet Protocols & Support' => 'Internet', + 'Interprocess Communication & Networking' => 'Networking', + 'Program Frameworks' => 'Frameworks', + 'Structured Markup Processing Tools' => 'Structured Markup' } + + def get_name + name = at_css('h1').content + name.sub! %r{\A[\d\.]+ }, '' # remove list number + name.sub! %r{ \u{2014}.+\z}, '' # remove text after em dash + name + end + + def get_type + return 'Logging' if slug.start_with? 'library/logging' + + type = at_css('.related a[accesskey="U"]').content + + if type == 'The Python Standard Library' + type = at_css('h1').content + elsif type.start_with? '19' + type = 'Internet Data Handling' + end + + type.sub! %r{\A\d+\.\s+}, '' # remove list number + type.sub! "\u{00b6}", '' # remove paragraph character + type.sub! ' and ', ' & ' + [' Services', ' Modules', ' Specific', 'Python '].each { |str| type.sub! str, '' } + + REPLACE_TYPES[type] || type + end + + def include_default_entry? + name !~ /[A-Z]/ && !skip? # skip non-module names + end + + def additional_entries + return [] if root_page? || skip? || name == 'errno' + clean_id_attributes + entries = [] + + css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node| + entries << [node['id'], node['id']] + end + + css('.data > dt[id]').each do |node| + if node['id'].split('.').last.upcase! # skip constants + entries << [node['id'], node['id']] + end + end + + css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node| + entries << [node['id'] + '()', node['id']] + end + + entries + end + + def skip? + type == 'Language' + end + + def clean_id_attributes + css('.section > .target[id]').each do |node| + if dt = node.at_css('+ dl > dt') + dt['id'] ||= node['id'].sub(/\w+\-/, '') + end + node.remove + end + end + end + end +end diff --git a/lib/docs/scrapers/python.rb b/lib/docs/scrapers/python.rb new file mode 100644 index 00000000..c1cd7f97 --- /dev/null +++ b/lib/docs/scrapers/python.rb @@ -0,0 +1,27 @@ +module Docs + class Python < FileScraper + self.version = '3.3.3' + self.type = 'sphinx' + self.dir = '/Users/Thibaut/DevDocs/Docs/Python' # downloaded from docs.python.org/3/download.html + self.base_url = 'http://docs.python.org/3/' + self.root_path = 'library/index.html' + + html_filters.push 'python/entries', 'python/clean_html' + + options[:only_patterns] = [/\Alibrary\//] + + options[:skip] = %w( + library/2to3.html + library/formatter.html + library/index.html + library/intro.html + library/undoc.html + library/unittest.mock-examples.html + library/sunau.html) + + options[:attribution] = <<-HTML + © 1990–2013 Python Software Foundation
+ Licensed under the PSF License. + HTML + end +end diff --git a/public/icons/docs/python/16.png b/public/icons/docs/python/16.png new file mode 100644 index 0000000000000000000000000000000000000000..165f7cf3cbb2898dccf1bf5ee193c8c89f42e383 GIT binary patch literal 547 zcmV+;0^I$HP)C^rfkb3xl9{=Ctz&U#k~jfvJg_;N!`hFv_C6Us=j6?&=TgSBWNSS>?@f?0rXOD(9g4F3(-Kx-35PBW6gzJ9;x{I6+A?x&?z81&1(J|N zvOt>X#TUH~wr2A@@0Ws*wC|Hc$ncJLNThCjXQ3Q$-N2hXE0|~pb^zGsk z;225I*_}=lsoj6t*32rXb1MSdI64|gU?9allEJMJJ}!;r4o!4H3Uw;4C8;zBQc94e z+qgY|8lVQ`Ocl0{YE|v%w*T7J+o~G_PI+Ip@aWR~cC@k+x4=zsYqYQ=EBd->AKLS4 zdUpKfVPL#77OH@bX`SyCaz#9|Dy~WKes=uTFmSvYNeNo6%*$)O8lW0PeLlC^4;3Y{ zkYXOv5lEospFyzKfqIR8f)2U*qi2K{x*`PybY<(q_;5Mk;<#}U`bCc}Ai!1B* zAltBsi)X*1<}TEN)P!h&n~S&xZjlXt+WXg4rfj5&bE6v!stt1R-5_L*fBpqje}KBd l^-3&&H~T+O^j+nDpWki3u~uWFO$Y!0002ovPDHLkV1m=N`-K1i literal 0 HcmV?d00001 diff --git a/public/icons/docs/python/16@2x.png b/public/icons/docs/python/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..d35fc20a7e22ed72379303696fc45b1841512d9b GIT binary patch literal 1316 zcmV+<1>5?GP)X2%ut;QiVW8Nm4OFgk*ZU@C ziQ6Tyn`DB}RQ@mob-~jJ7|1j>An83eDWn!JvK_R~p`6^Sp_O-;jvbd$Kqf2geMeMJ z@xTZg6*p!s(w7>*3nf=CIDoDb;!6P5rwh02?UeW!mG5i<@ZgToP7%!I%|OUsdlE5I zBMYzu(G#$dh_Xdj2{`Av0YDAIB_1Bs)8)WPjMjXyfAK45mxCT01egUUW=YE?rjUB% zL5dmH*O0e-^Tjw^P+a(J{OHucv_Ja6Y$imn-sYW1aC~@iO7XUQhJJtT=Xylu6t4*` z;N1fC@bkN|@1gsHc@AROED z(7|68b^i4Xjk$GyL9P33ro3bqRvk*Se=xNluwH%#kJ04Zbur^d$%)?3?&pLDa#en7srieUg^k z1As|JA1c;^y3v&v%ah2eC{O%6W!3&>N+n4$qJtQR5MYM@(=m!_zXlQ!Fp|m&PDJ%J zKyJXyICL)Q+qCpB>Aogi<2beX*G8W$Gk`U}ulaoz?$=ip_8zdBTPIfW(Xhbo9)pCTYzWiPe0KP@%4e#dVp=n5S~Nk=yaVvChSV!3(W#{SnJ zwL^K0_C~D zgbv``mm%xs-wDCYfwAdwU0-arWD0Qed%*O~K>HKky`s04wuYV6@UWk z`WMZf<_Tcrz=wK6nPGjkK?{sALQ^?Mb zs$Z>Xlv?*9%tX0+