From 24ee0f6355ae3dd08deca5dc511974e768013732 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 25 Mar 2013 17:38:15 -0400 Subject: [PATCH 1/5] Changes driven by accessibility checks --- conf.py | 1 + themes/mongodb/layout.html | 237 ++++++++++++----------- themes/mongodb/static/mongodb-docs.css_t | 20 +- themes/mongodb/theme.conf | 1 + 4 files changed, 133 insertions(+), 126 deletions(-) diff --git a/conf.py b/conf.py index 4d57c7c6e4e..e9a4ada0d88 100644 --- a/conf.py +++ b/conf.py @@ -126,6 +126,7 @@ 'version': version, 'version_selector': meta['version_selector'], 'stable': meta['stable'], + 'language':'en' } html_sidebars = { diff --git a/themes/mongodb/layout.html b/themes/mongodb/layout.html index 0c8f173bf2f..7e2d8c1a750 100644 --- a/themes/mongodb/layout.html +++ b/themes/mongodb/layout.html @@ -9,7 +9,7 @@ {%- set titlesuffix = " — "|safe + docstitle|e + " " + release|e %} {%- else %} {%- set titlesuffix = "" %} -{%- endif %} +{%- endif -%} {%- macro githublink() -%} Edit this Page @@ -20,41 +20,41 @@ {%- endmacro -%} {%- macro sidebar() %} - {%- if render_sidebar %} -
-
- {%- if sidebars != None %} - {%- for sidebartemplate in sidebars %} - {%- include sidebartemplate %} - {%- endfor %} - {%- endif %} -
-
- {%- endif %} -{%- endmacro %} +{%- if render_sidebar %} +
+
+{%- if sidebars != None %} +{%- for sidebartemplate in sidebars %} +{%- include sidebartemplate %} +{%- endfor %} +{%- endif %} +
+
+{%- endif %} +{%- endmacro -%} {%- macro script() %} - - {%- for scriptfile in script_files %} - - {%- endfor %} -{%- endmacro %} + +{%- for scriptfile in script_files %} + +{%- endfor %} +{%- endmacro -%} {%- macro css() %} - - - {%- for cssfile in css_files %} - - {%- endfor %} -{%- endmacro %} + + +{%- for cssfile in css_files %} + +{%- endfor %} +{%- endmacro -%} {%- macro render_nextprev() %}
@@ -70,80 +70,110 @@ {%- endif %}
-{% endmacro -%} - +{%- endmacro -%} +{% if theme_language == '' %} - - {%- block htmltitle %} - {{ title|striptags|e }}{{ titlesuffix }} - {%- endblock %} - - - - - - - {%- if pagename == 'index' %} - - {%- else %} - - {%- endif %} +{%- else -%} + +{%- endif %} + +{%- block htmltitle %} +{{ title|striptags|e }}{{ titlesuffix }} +{%- endblock -%} + + + + +{%- if pagename == 'index' %} + +{%- else %} + +{%- endif -%} - {{ metatags }} - {{ css() }} +{{ metatags }} +{{ css() }} - {%- if not embedded %} - {{ script() }} +{%- if not embedded %} +{{ script() }} - {%- block googlecse_opensearch %} - - {%- endblock -%} +{%- block googlecse_opensearch %} + +{%- endblock -%} - {%- if favicon %} - - {%- endif %} - {%- endif %} +{%- if favicon %} + +{%- endif %} +{%- endif %} {%- block linktags %} {%- include "linktags.html" %} -{%- endblock %} +{%- endblock -%} -{%- block extrahead %}{% endblock %} +{%- block extrahead %}{% endblock -%} {%- block sitesearch %} +{%- endblock -%} + + +{%- block header %} +
+
+ +
+
+{%- endblock -%} + +{%- block content %} +{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} +
+{%- block document %} +
+{%- if render_sidebar %} +
+{%- endif %} +
+
+{% block body %} {% endblock %} +{{- render_nextprev() -}} +
+{%- if render_sidebar %} +
+{%- endif %} +
{%- endblock %} - - -{%- block header %} +{%- block sidebar2 %}{{ sidebar() }}{% endblock %} +
+
+{%- endblock %} +{%- block commnav -%}
- + -
-
- -
- +
+{%- endblock -%} +{%- block searchbox %}
+{%- endblock %} +{%- block subnav %} {%- if theme_project != 'about' %}
    @@ -153,42 +183,13 @@
{%- endif %} -
-{%- endblock %} - -{%- block content %} - {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} -
- {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} -
-
- {% block body %} {% endblock %} - {{- render_nextprev() -}} -
- {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} - - {%- block sidebar2 %}{{ sidebar() }}{% endblock %} -
-
-{%- endblock %} - +{%- endblock -%} {%- block footer %} - + {%- endblock %} - {%- block analytics %} {%- include "analytics.html" %} {%- endblock %} diff --git a/themes/mongodb/static/mongodb-docs.css_t b/themes/mongodb/static/mongodb-docs.css_t index c504e97c385..cd43b576e0f 100644 --- a/themes/mongodb/static/mongodb-docs.css_t +++ b/themes/mongodb/static/mongodb-docs.css_t @@ -109,7 +109,7 @@ div.sphinxsidebar h3 { padding: 0px 0 0 10px; } -div.sphinxsidebar h3 a { color: #444; } +div.sphinxsidebar h3 a { color: black; } div.sphinxsidebar p { color: #333333; @@ -138,7 +138,7 @@ div.sphinxsidebar ul { color: #000; } -div.sphinxsidebar a { color: #444; } +div.sphinxsidebar a { color: black; } div.sphinxsidebar input { border: 1px solid #ccc; @@ -380,32 +380,32 @@ div#mongodb ul.simple { div.sphinxsidebar li.toctree-l1 a.reference { font-size: 1.2em; - color: #444; + color: black; line-height: 1.5em; } div.sphinxsidebar ul.current li.toctree-l1 a { font-size: 1.2em; - color: #444; + color: black; line-height: 1.5em; } div.sphinxsidebar ul.current li.toctree-l2 a { font-size: 1.1em; - color: #646464; + color: black; line-height: 1.5em; } div.sphinxsidebar ul.current li.toctree-l3 a { font-size: 1.0em; - color: #848484; + color: black; line-height: 1.5em; } div.sphinxsidebar ul.current li.toctree-l4 a { font-size: .95em; - color: #7b7b7b; + color: black; line-height: 1.5em; } div.sphinxsidebar ul.current li.toctree-l5 a { font-size: .9em; - color: #a3a3a3; + color: black; line-height: 1.5em; } div.related li.right { @@ -835,3 +835,7 @@ div.admonition-example pre { background-color: #FBFBFB; } li p.first { margin-bottom: 0em; } h4#vnd {padding:0;margin:0;line-height:1.5;padding-left:10px;} + +ul.current li.toctree-l1 a:active {text-decoration:underline;} +ul.current li.toctree-l1 a:hover {font-weight:900;} +ul.current li.toctree-l1 a:focus {text-decoration:none;font-weight:900;} diff --git a/themes/mongodb/theme.conf b/themes/mongodb/theme.conf index b265a82d156..9f8cf31bf81 100644 --- a/themes/mongodb/theme.conf +++ b/themes/mongodb/theme.conf @@ -17,3 +17,4 @@ version = VERSION version_selector = VERSION_SELECTOR latest = LATEST stable = STABLE +language = LANGUAGE From 5673dab63cd2f1be4e59959bd10bd7d343493055 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 25 Mar 2013 17:38:34 -0400 Subject: [PATCH 2/5] Optional changes driven by accessibility checks --- conf.py | 2 ++ themes/mongodb/pagenav.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index e9a4ada0d88..50e113aa8c6 100644 --- a/conf.py +++ b/conf.py @@ -71,6 +71,8 @@ 'djangotoolbox' : ('http://djangotoolbox.readthedocs.org/en/latest/', '../../../build/djangotoolbox.inv'), } +language = 'en' + languages = [ ("ar", "Arabic"), ("cn", "Chinese"), diff --git a/themes/mongodb/pagenav.html b/themes/mongodb/pagenav.html index ad4c9be242f..4c65e3c30cc 100644 --- a/themes/mongodb/pagenav.html +++ b/themes/mongodb/pagenav.html @@ -7,4 +7,4 @@

{{ shorttitle }} {# the following span is replaced by the javascript in versionnav.html #}

Version: {{version}}

{% endif %} -{{ toctree(maxdepth=-1) }} +{{ toctree(maxdepth=-1,titles_only=1) }} From d697ccd775060a9dbe0e6b409978c4d90ad4be53 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Mon, 25 Mar 2013 17:59:24 -0400 Subject: [PATCH 3/5] Optional markup change to add source metadata --- themes/mongodb/layout.html | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/mongodb/layout.html b/themes/mongodb/layout.html index 7e2d8c1a750..024ef38d971 100644 --- a/themes/mongodb/layout.html +++ b/themes/mongodb/layout.html @@ -84,6 +84,7 @@ + {%- if pagename == 'index' %} {%- else %} From 60dde91a2b0307f07fbae369ec36eb60daf98d17 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Tue, 26 Mar 2013 14:27:45 -0400 Subject: [PATCH 4/5] WRITING-222 tweak pagenav add breadcrumbs --- themes/mongodb/layout.html | 23 +++++++++++++++++ themes/mongodb/pagenav.html | 2 +- themes/mongodb/static/mongodb-docs.css_t | 33 ++++++++++++++++++++---- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/themes/mongodb/layout.html b/themes/mongodb/layout.html index 024ef38d971..30b8428de07 100644 --- a/themes/mongodb/layout.html +++ b/themes/mongodb/layout.html @@ -18,6 +18,28 @@ {%- macro jiralink() -%} https://jira.mongodb.org/secure/CreateIssueDetails!init.jspa?pid=10380&issuetype=4&priority=4&summary=Comment+on%3a+%22{{ pagename | escape }}%2Etxt%22 {%- endmacro -%} +{%- set reldelim1 = reldelim1 is not defined and '' or reldelim1 %} +{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} +{%- macro relbar() %} +
+{#

{{ _('Navigation') }}

#} +
    +{# {%- for rellink in rellinks %} +
  • + {{ rellink[3] }} + {%- if not loop.first %}{{ reldelim2 }}{% endif %}
  • + {%- endfor %} +#} {%- block rootrellink %} +{#
  • {{ shorttitle|e }}{{ reldelim1 }}
  • #} + {%- endblock %} + {%- for parent in parents %} +
  • {{ parent.title }}{{ reldelim1 }}
  • + {%- endfor %} + {%- block relbaritems %} {% endblock %} +
+
+{%- endmacro %} {%- macro sidebar() %} {%- if render_sidebar %} @@ -143,6 +165,7 @@
{%- endif %}
+{{ relbar() }}
{% block body %} {% endblock %} {{- render_nextprev() -}} diff --git a/themes/mongodb/pagenav.html b/themes/mongodb/pagenav.html index 4c65e3c30cc..2c317e45126 100644 --- a/themes/mongodb/pagenav.html +++ b/themes/mongodb/pagenav.html @@ -7,4 +7,4 @@

{{ shorttitle }} {# the following span is replaced by the javascript in versionnav.html #}

Version: {{version}}

{% endif %} -{{ toctree(maxdepth=-1,titles_only=1) }} +{{ toctree(maxdepth=1,titles_only=1) }} diff --git a/themes/mongodb/static/mongodb-docs.css_t b/themes/mongodb/static/mongodb-docs.css_t index cd43b576e0f..0ab9a512b75 100644 --- a/themes/mongodb/static/mongodb-docs.css_t +++ b/themes/mongodb/static/mongodb-docs.css_t @@ -45,7 +45,7 @@ div.body { div.body > div#cse-results + div.section { margin:0 1.5em; } div.body > div#cse-results + span.target + div.section { margin:0 1.5em; } div.body > div#cse-results + span.target + span.target+ div.section { margin:0 1.5em; } - +div.body > div#cse-results {margin:0;padding:0;margin-left:24px;height:auto;} div.footer { color:white; width:auto; @@ -176,7 +176,7 @@ div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 { } div.body h1 { - border-top: 5px solid white; + border-top: none; margin-top: 0; font-size: 200%; } @@ -378,16 +378,20 @@ div#mongodb ul.simple { list-style:circle; } +/* div.sphinxsidebar li.toctree-l1 a.reference { font-size: 1.2em; color: black; line-height: 1.5em; } +*/ +/* div.sphinxsidebar ul.current li.toctree-l1 a { font-size: 1.2em; color: black; line-height: 1.5em; } +*/ div.sphinxsidebar ul.current li.toctree-l2 a { font-size: 1.1em; color: black; @@ -413,6 +417,7 @@ div.related li.right { margin-right: 5px; margin-top: 85px; } + div.sphinxsidebar tt.literal .pre { font-weight: normal; } @@ -836,6 +841,24 @@ div.admonition-example pre { background-color: #FBFBFB; } li p.first { margin-bottom: 0em; } h4#vnd {padding:0;margin:0;line-height:1.5;padding-left:10px;} -ul.current li.toctree-l1 a:active {text-decoration:underline;} -ul.current li.toctree-l1 a:hover {font-weight:900;} -ul.current li.toctree-l1 a:focus {text-decoration:none;font-weight:900;} +div.sphinxsidebarwrapper {padding-top:0.5em;} +div.sphinxsidebarwrapper ul {margin:0;padding:0;margin-left:10px;} +div.sphinxsidebarwrapper ul li {font-size:1.0em;font-family:Helvetica,Arial,Sans-serif;line-height:1.5;} +div.sphinxsidebarwrapper ul li a:active, +div.sphinxsidebarwrapper ul li a:focus, +div.sphinxsidebarwrapper ul li a:hover {font-weight:900;} +div.sphinxsidebarwrapper ul li a tt span {font-family:Helvetica,Arial,sans-serif;font-size:inherit;color:black;} +div.sphinxsidebarwrapper ul li a:active tt span, div.sphinxsidebarwrapper ul li a:hover tt span, div.sphinxsidebarwrapper ul li a:focus tt span {font-weight:900} +div.sphinxsidebarwrapper ul.current li.current a tt span {font-weight:900;} +div.sphinxsidebar ul.current li.current tt.literal .pre {font-weight:900;} +div.sphinxsidebar a:active tt.literal .pre, +div.sphinxsidebar a:focus tt.literal .pre, +div.sphinxsidebar a:hover tt.literal .pre {font-weight:900;} +div.body div.bc {padding-top:0.5em; margin-left:24px; background:white;color:black;} +div.body div.bc li.jr {float: right;display:none;} +div.body div.bc ul {padding:0;margin:0} +div.body div.bc ul li {list-style: none;font-size:0.8em;display:inline;color:black;} +div.body div.bc ul li a {color:black;} +div.bc ul li:after {content:"›"} +div.sphinxsidebarwrapper h3 {line-height:2.0;margin:0;padding:0} +div.sphinxsidebarwrapper h3:first-child {line-height:1.0;margin:0;padding:0} From 4d75b7eaf0726b8b4aeb5c7984909ac0573e8e22 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Tue, 26 Mar 2013 14:39:39 -0400 Subject: [PATCH 5/5] WRITING-222 rearrange pagenav (optional) --- conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 50e113aa8c6..004bdb5dcef 100644 --- a/conf.py +++ b/conf.py @@ -134,10 +134,10 @@ html_sidebars = { '**': ['pagenav.html'], } -html_sidebars['**'].append('intrasites.html') +html_sidebars['**'].append('wikisidebar.html') +#html_sidebars['**'].append('intrasites.html') html_sidebars['**'].append('formats.html') # html_sidebars['**'].append('translations.html') -html_sidebars['**'].append('wikisidebar.html') # -- Options for LaTeX output --------------------------------------------------