From 7dc1131732fbfca757577fe5e6715f2c741420c0 Mon Sep 17 00:00:00 2001 From: Lisa Roach Date: Wed, 14 Sep 2016 03:13:52 +0000 Subject: [PATCH 1/2] Serves static content from docs.python.org. Except for the collapsible sidebar, which requires a change in Sphinx iteself. Also changed hover color for header links. --- tools/pydoctheme/static/pydoctheme.css | 2 +- tools/static/copybutton.js | 62 ------------------------- tools/static/py.png | Bin 695 -> 0 bytes tools/templates/layout.html | 6 +-- 4 files changed, 4 insertions(+), 66 deletions(-) delete mode 100644 tools/static/copybutton.js delete mode 100644 tools/static/py.png diff --git a/tools/pydoctheme/static/pydoctheme.css b/tools/pydoctheme/static/pydoctheme.css index a1f926227..670ebecd7 100644 --- a/tools/pydoctheme/static/pydoctheme.css +++ b/tools/pydoctheme/static/pydoctheme.css @@ -20,7 +20,7 @@ div.related a { } div.related a:hover { - color: #0095C4; + color: #b4eaea; } div.related:first-child { diff --git a/tools/static/copybutton.js b/tools/static/copybutton.js deleted file mode 100644 index 716c9e472..000000000 --- a/tools/static/copybutton.js +++ /dev/null @@ -1,62 +0,0 @@ -$(document).ready(function() { - /* Add a [>>>] button on the top-right corner of code samples to hide - * the >>> and ... prompts and the output and thus make the code - * copyable. */ - var div = $('.highlight-python .highlight,' + - '.highlight-python3 .highlight') - var pre = div.find('pre'); - - // get the styles from the current theme - pre.parent().parent().css('position', 'relative'); - var hide_text = 'Hide the prompts and output'; - var show_text = 'Show the prompts and output'; - var border_width = pre.css('border-top-width'); - var border_style = pre.css('border-top-style'); - var border_color = pre.css('border-top-color'); - var button_styles = { - 'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0', - 'border-color': border_color, 'border-style': border_style, - 'border-width': border_width, 'color': border_color, 'text-size': '75%', - 'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em', - 'border-radius': '0 3px 0 0' - } - - // create and add the button to all the code blocks that contain >>> - div.each(function(index) { - var jthis = $(this); - if (jthis.find('.gp').length > 0) { - var button = $('>>>'); - button.css(button_styles) - button.attr('title', hide_text); - button.data('hidden', 'false'); - jthis.prepend(button); - } - // tracebacks (.gt) contain bare text elements that need to be - // wrapped in a span to work with .nextUntil() (see later) - jthis.find('pre:has(.gt)').contents().filter(function() { - return ((this.nodeType == 3) && (this.data.trim().length > 0)); - }).wrap(''); - }); - - // define the behavior of the button when it's clicked - $('.copybutton').click(function(e){ - e.preventDefault(); - var button = $(this); - if (button.data('hidden') === 'false') { - // hide the code output - button.parent().find('.go, .gp, .gt').hide(); - button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden'); - button.css('text-decoration', 'line-through'); - button.attr('title', show_text); - button.data('hidden', 'true'); - } else { - // show the code output - button.parent().find('.go, .gp, .gt').show(); - button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible'); - button.css('text-decoration', 'none'); - button.attr('title', hide_text); - button.data('hidden', 'false'); - } - }); -}); - diff --git a/tools/static/py.png b/tools/static/py.png deleted file mode 100644 index 93e4a02c3d321c545898a2ebb8873c26dd8a9e5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 695 zcmV;o0!aOdP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iOD~ z5jY_RGbdgE00K8jL_t(I%Vm>KNL4`;hrfH@vv+$Uln|xSCTLTOHmzE;5FTwpDtJ)a zz)exE-2_34AR^i+ZCXeh7m*-F5k*FrmbSHs%rX_!{PXUec{69`w(#D(>Vd<+%=bIz zH_V)XUD5sE?K5ebbKaSDu}#Dnq^Y!3`tis9>wSO*T+WBP3wS3NNBU~*PAtw^yjZ+< zQ5yK0z%d{y@_Pz6YdL>s7$6Y^hI$}5GUX?Ns>+iCUiRP z7h|*&%kQa?wQA%pYzqpaf*4?WM!x_ygY0K@07rplx^QhGhnE)r4wbx0x11<&3V?63 z=F8ch)p6iQ88E;iumPmSZif%JIwIgKh$T3)*ab8ImGLVf;IoYtVAb11Z&@wm>96=S z)!B&hojbAPoik&f)Lp;=N!HK;X~5oyfJ49$pbcorTyADv dm$H!t;2#0MumAjv0Ga>*002ovPDHLkV1gIiH5UK? diff --git a/tools/templates/layout.html b/tools/templates/layout.html index 4a974406b..3a63e0069 100644 --- a/tools/templates/layout.html +++ b/tools/templates/layout.html @@ -1,6 +1,6 @@ {% extends "!layout.html" %} {% block rootrellink %} -
  • Python{{ reldelim1 }}
  • @@ -30,8 +30,8 @@ {%- endif %} {% endblock %} {% block extrahead %} - - {% if not embedded %}{% endif %} + + {% if not embedded %}{% endif %} {{ super() }} {% endblock %} From 6ff869cffdb40df54a0f1649fe7f00f0f5803cec Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Tue, 1 Nov 2016 22:22:25 -0500 Subject: [PATCH 2/2] Use a simpler color for navbar link hover --- tools/pydoctheme/static/pydoctheme.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pydoctheme/static/pydoctheme.css b/tools/pydoctheme/static/pydoctheme.css index 670ebecd7..1d82d41c7 100644 --- a/tools/pydoctheme/static/pydoctheme.css +++ b/tools/pydoctheme/static/pydoctheme.css @@ -20,7 +20,7 @@ div.related a { } div.related a:hover { - color: #b4eaea; + color: #eee; } div.related:first-child {