Skip to content

Style & formatting changes for accessibility & usability #787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
'djangotoolbox' : ('http://djangotoolbox.readthedocs.org/en/latest/', '../../../build/djangotoolbox.inv'),
}

language = 'en'

languages = [
("ar", "Arabic"),
("cn", "Chinese"),
Expand Down Expand Up @@ -126,15 +128,16 @@
'version': version,
'version_selector': meta['version_selector'],
'stable': meta['stable'],
'language':'en'
}

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 --------------------------------------------------

Expand Down
261 changes: 143 additions & 118 deletions themes/mongodb/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{%- set titlesuffix = " — "|safe + docstitle|e + " " + release|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
{%- endif -%}

{%- macro githublink() -%}
<a href="https://github.com/mongodb/{{theme_repo_name}}/blob/{{theme_branch}}/source/{{pagename}}.txt" target="_blank" title="Edit {{pagename}}.txt on github">Edit this Page</a>
Expand All @@ -18,43 +18,65 @@
{%- 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() %}
<div class="bc">
{# <h3>{{ _('Navigation') }}</h3> #}
<ul>
{# {%- for rellink in rellinks %}
<li class="jr" {% if loop.first %}style="margin-right: 10px"{% endif %}>
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
{%- endfor %}
#} {%- block rootrellink %}
{# <li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li> #}
{%- endblock %}
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
{%- endfor %}
{%- block relbaritems %} {% endblock %}
</ul>
</div>
{%- endmacro %}

{%- macro sidebar() %}
{%- if render_sidebar %}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{%- if sidebars != None %}
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
{%- endif %}
</div>
</div>
{%- endif %}
{%- endmacro %}
{%- if render_sidebar %}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{%- if sidebars != None %}
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
{%- endif %}
</div>
</div>
{%- endif %}
{%- endmacro -%}

{%- macro script() %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ url_root }}',
VERSION: '{{ version|e }}',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: {{ has_source|lower }},
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
{%- endmacro %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ url_root }}',
VERSION: '{{ version|e }}',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: {{ has_source|lower }},
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
{%- endmacro -%}

{%- macro css() %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- for cssfile in css_files %}
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
{%- endfor %}
{%- endmacro %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- for cssfile in css_files %}
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
{%- endfor %}
{%- endmacro -%}

{%- macro render_nextprev() %}
<div id="btnv">
Expand All @@ -70,80 +92,112 @@
{%- endif %}
</ul>
</div>
{% endmacro -%}

{%- endmacro -%}
{% if theme_language == '' %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{%- block htmltitle %}
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
{%- endblock %}

<link rel="shortcut icon" href="http://media.mongodb.org/favicon.ico" />
<meta name="robots" content="index" />
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
<meta name="release" content="{{theme_release}}"/>

{%- if pagename == 'index' %}
<link rel="canonical" href="http://docs.mongodb.org/{{theme_project}}/" />
{%- else %}
<link rel="canonical" href="http://docs.mongodb.org/{{ theme_project }}/{{pagename}}" />
{%- endif %}
{%- else -%}
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{theme_language}}">
{%- endif %}
<head>
{%- block htmltitle %}
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
{%- endblock -%}
<link rel="shortcut icon" href="http://media.mongodb.org/favicon.ico" />
<meta name="robots" content="index" />
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
<meta name="release" content="{{release}}"/>
<meta name="DC.Source" content="https://github.com/mongodb/{{theme_repo_name}}/blob/{{theme_branch}}/source/{{pagename}}.txt"/>
{%- if pagename == 'index' %}
<link rel="canonical" href="http://docs.mongodb.org/{{theme_project}}/" />
{%- else %}
<link rel="canonical" href="http://docs.mongodb.org/{{ theme_project }}/{{pagename}}" />
{%- endif -%}

{{ metatags }}
{{ css() }}
{{ metatags }}
{{ css() }}

{%- if not embedded %}
{{ script() }}
{%- if not embedded %}
{{ script() }}

{%- block googlecse_opensearch %}
<link rel="search" type="application/opensearchdescription+xml" href="http://docs.mongodb.org/osd.xml" title="MongoDB Help"/>
{%- endblock -%}
{%- block googlecse_opensearch %}
<link rel="search" type="application/opensearchdescription+xml" href="http://docs.mongodb.org/osd.xml" title="MongoDB Help"/>
{%- endblock -%}

{%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif %}
{%- endif %}
{%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif %}
{%- endif %}

{%- block linktags %}
{%- include "linktags.html" %}
{%- endblock %}
{%- endblock -%}

{%- block extrahead %}{% endblock %}
{%- block extrahead %}{% endblock -%}
{%- block sitesearch %}
<script>
(function() {
(function() {
var cx = '017213726194841070573:WMX6838984';
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
})();
})();
</script>
{%- endblock -%}
</head>
<body>
{%- block header %}
<div id="header-db" class="spread">
<div class="split">
<div id="logo">
<div><a href="{{ pathto('index') }}"><img class="logo" src="http://media.mongodb.org/logo-mongodb.png" alt="MongoDB Logo"/></a></div>
</div>
</div>
</div>
{%- endblock -%}

{%- block content %}
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
<div class="document">
{%- block document %}
<div class="documentwrapper">
{%- if render_sidebar %}
<div class="bodywrapper">
{%- endif %}
<div class="body">
{{ relbar() }}
<div id="cse-results"><gcse:searchresults linkTarget="_top"></gcse:searchresults></div>
{% block body %} {% endblock %}
{{- render_nextprev() -}}
</div>
{%- if render_sidebar %}
</div>
{%- endif %}
</div>
{%- endblock %}
</head>
<body>

{%- block header %}
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
<div class="clearer"></div>
</div>
{%- endblock %}
{%- block commnav -%}
<div id="top-right">
<div class="user-right">
<ul id="header-menu-bar" class="ajs-menu-bar">
<li class="normal"><a target="_blank" href="http://groups.google.com/group/mongodb-user">Forums</a></li>
<li class="normal"><a target="_blank" href="http://blog.mongodb.org/">Blog</a></li>
<li class="normal"><a href="http://www.mongodb.org/downloads">Download</a></li>
<li class="normal"><a href="http://docs.mongodb.org/ecosystem/drivers/">Drivers</a></li>
<li class="normal"><a href="http://www.10gen.com/events">Events</a></li>
<li class="normal last"><a class="last" href="http://docs.mongodb.org/manual/meta/translation">Translations</a></li>
</ul>
</div>
<div class="user-right">
<ul id="header-menu-bar" class="ajs-menu-bar">
<li class="normal"><a target="_blank" href="http://groups.google.com/group/mongodb-user">Forums</a></li>
<li class="normal"><a target="_blank" href="http://blog.mongodb.org/">Blog</a></li>
<li class="normal"><a href="http://www.mongodb.org/downloads">Download</a></li>
<li class="normal"><a href="http://docs.mongodb.org/ecosystem/drivers/">Drivers</a></li>
<li class="normal"><a href="http://www.10gen.com/events">Events</a></li>
<li class="normal last"><a class="last" href="http://docs.mongodb.org/manual/meta/translation">Translations</a></li>
</ul>
</div>
<div id="header-db" class="spread">
<div class="split">
<div id="logo">
<div><a href="{{ pathto('index') }}"><img class="logo" src="http://media.mongodb.org/logo-mongodb.png" alt="MongoDB Logo"/></a></div>
</div>
</div>

</div>
{%- endblock -%}
{%- block searchbox %}
<div class="search-db"><gcse:searchbox></gcse:searchbox></div>
{%- endblock %}
{%- block subnav %}
{%- if theme_project != 'about' %}
<div id="etp">
<ul>
Expand All @@ -153,42 +207,13 @@
</ul>
</div>
{%- endif %}
</div>
{%- endblock %}

{%- block content %}
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
<div class="document">
{%- block document %}
<div class="documentwrapper">
{%- if render_sidebar %}
<div class="bodywrapper">
{%- endif %}
<div class="body">
<div id="cse-results"><gcse:searchresults linkTarget="_top"></gcse:searchresults></div>
{% block body %} {% endblock %}
{{- render_nextprev() -}}
</div>
{%- if render_sidebar %}
</div>
{%- endif %}
</div>
{%- endblock %}

{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
<div class="clearer"></div>
</div>
{%- endblock %}

{%- endblock -%}
{%- block footer %}
<div class="footer">
<p>
{% trans copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }} {% endtrans %}
MongoDB&reg;, Mongo&reg;, and the leaf logo are registered trademarks of 10gen, Inc.
</p>
</div>
<div class="footer">
<p>{% trans copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }} {% endtrans %}
MongoDB&reg;, Mongo&reg;, and the leaf logo are registered trademarks of 10gen, Inc.</p>
</div>
{%- endblock %}

{%- block analytics %}
{%- include "analytics.html" %}
{%- endblock %}
Expand Down
2 changes: 1 addition & 1 deletion themes/mongodb/pagenav.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ <h3><a href="{{ pathto(master_doc) }}">{{ shorttitle }}</a>
{# the following span is replaced by the javascript in versionnav.html #}
<h4 id="vnd">Version: <span id="vn">{{version}}</span></h4>
{% endif %}
{{ toctree(maxdepth=-1) }}
{{ toctree(maxdepth=1,titles_only=1) }}
Loading