Skip to content

Clean up HTML template, optimize JavaScript, eliminate the blank line #340

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

Merged
merged 4 commits into from
Oct 22, 2012
Merged
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
264 changes: 99 additions & 165 deletions themes/mongodb/layout.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{#
basic/layout.html
~~~~~~~~~~~~~~~~~

Master layout template for Sphinx themes.

:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}{%- block doctype -%}
{%- block doctype -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{%- endblock %}
Expand All @@ -22,17 +14,13 @@
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}

{%- macro githublink() -%}
<a href="https://github.com/mongodb/docs/blob/{{theme_branch}}/source/{{pagename}}.txt" target="_blank" title="Edit {{pagename}}.txt on github">Edit this Page</a>
<a href="https://github.com/mongodb/docs/blob/{{theme_branch}}/source/{{pagename}}.txt" target="_blank" title="Edit {{pagename|e}}.txt on github">Edit this Page</a>
{%- endmacro -%}

{%- 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 -%}

{%- macro relbar(show_logo=True) %}

<div class="related">
<ul>
{#- for rellink in rellinks %}
Expand All @@ -55,7 +43,6 @@
</ul>
</div>
{%- endmacro %}

{%- macro sidebar() %}
{%- if render_sidebar %}
<div class="sphinxsidebar">
Expand Down Expand Up @@ -84,7 +71,6 @@
</div>
{%- endif %}
{%- endmacro %}

{%- macro script() %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
Expand All @@ -95,76 +81,35 @@
HAS_SOURCE: {{ has_source|lower }}
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
{%- for scriptfile in script_files %}
{% if scriptfile == '_static/jquery.js' %}
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
{%- else -%}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endif -%}
{%- 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 %}

{%- macro homenav() %}
<div id="home-nav" class="spread">
<div class="split">
<ul class="home-nav">
<li class="docs"><a href="http://docs.mongodb.org/manual/" "MongoDB Documentation"><span class="hidden">MongoDB Documentation</span></a></li>
<li class="try"><a href="#" onclick="$('#shell').slideToggle('fast');$('.readLine').focus();" title="Try Out MongoDB"><span class="hidden">Try Out MongoDB</span></a></li>
<li class="downloads"><a href="http://www.mongodb.org/downloads" title="Download MongoDB"><span class="hidden">Download MongoDB</span></a></li>
<li class="drivers"><a href="http://www.mongodb.org/display/DOCS/Drivers" title="Get the latest MongoDB drivers"><span class="hidden">Get the latest MongoDB drivers</span></a></li>
</ul>
</div>
</div>
{%- endmacro %}

{%- macro trymongo() %}
<div id="main-db" class="spread hidden">
<div class="split">
<div id="shell" style="display: none;">
<div>
<img class="title" src="http://media.mongodb.org/title-shell.png" width="462" height="43" alt="A Tiny MongoDB Shell." />
<a class="hide" href="#" onclick="$('#shell').slideToggle('fast')">X CLOSE</a>
<div id="terminal">
<p class="response">MongoDB browser shell version: 0.1.0</p>
<p>connecting to random database</p>
<p>type "help" for help</p>
<p>type "tutorial" to start the tutorial</p>
</div>
<script type="text/javascript" src="http://www.mongodb.org/try/js/mongo.js"></script>
<script type="text/javascript" src="http://www.mongodb.org/try/js/object_id.js"></script>
<script type="text/javascript" src="http://www.mongodb.org/try/js/lib/collection.js"></script>
<script type="text/javascript" src="http://www.mongodb.org/try/js/constants.js"></script>
<script type="text/javascript" src="http://www.mongodb.org/try/js/connection.js"></script>
<script type="text/javascript" src="http://www.mongodb.org/try/js/utils.js"></script>
<script type="text/javascript" src="http://www.mongodb.org/try/js/shell_utils.js"></script>
<script type="text/javascript" src="http://www.mongodb.org/try/js/lib/query.js"></script>
<script type="text/javascript" src="http://www.mongodb.org/try/js/tokens.js"></script>
</div>
</div>
</div>
</div>
{%- 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 -%}
<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 }}" />

{%- if pagename == 'index' %}
<link rel="canonical" href="http://docs.mongodb.org/manual/" />
{%- else %}
<link rel="canonical" href="http://docs.mongodb.org/manual/{{pagename}}" />
{%- endif %}

<head>
{%- block htmltitle %}
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
{%- endblock %}
<link rel="shortcut icon" href="http://media.mongodb.org/favicon.ico" />
<link rel="author" href="https://plus.google.com/101024085748034940765?rel=author" title="MongoDB Google+ Profile"/>
<meta name="robots" content="index" />
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
{%- if pagename == 'index' %}
<link rel="canonical" href="http://docs.mongodb.org/manual/" />
{%- else %}
<link rel="canonical" href="http://docs.mongodb.org/manual/{{pagename}}" />
{%- endif -%}
{{ metatags }}
{{ css() }}
{%- if not embedded %}
Expand All @@ -174,36 +119,36 @@
<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) }}"/>
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif %}
{%- endif %}
{%- block linktags %}
{%- if hasdoc('about') %}
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
{%- endif %}
{%- if hasdoc('genindex') %}
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
{%- endif %}
{%- if hasdoc('search') %}
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
{%- endif %}
{%- if hasdoc('copyright') %}
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
{%- endif %}
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
<link rel="start" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
{%- if parents %}
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
{%- endif %}
{%- if next %}
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
{%- endif %}
{%- if prev %}
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
{%- endif %}
{%- endblock %}
{%- block extrahead %} {% endblock %}
{%- block sitesearch %}
<!-- Put the following javascript before the closing </head> tag. -->
<script>
(function() {
var cx = '017213726194841070573:WMX6838984';
Expand All @@ -214,79 +159,76 @@
})();
</script>
{%- endblock %}
</head>
<body>
</head>
<body>
{%- block header %}
<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://www.mongodb.org/display/DOCS/Drivers">Drivers</a></li>
<li class="normal"><a href="http://www.mongodb.org/display/DOCS/Events">Events</a></li>
<li class="normal last"><a class="last" href="http://www.mongodb.org/display/DOCS/International+Documentation">International</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://www.mongodb.org/display/DOCS/Drivers">Drivers</a></li>
<li class="normal"><a href="http://www.mongodb.org/display/DOCS/Events">Events</a></li>
<li class="normal last"><a class="last" href="http://www.mongodb.org/display/DOCS/International+Documentation">International</a></li>
</ul>
</div>
</div>
<div id="header-db" class="spread">
<div class="split">
<div id="logo">
<div><a href="http://docs.mongodb.org/"><img src="{{ pathto('_static', 1) }}/logo-mongodb.png" width="190" height="55" alt="mongoDB" /></a></div>
</div>
</div>
<div class="split">
<div id="logo">
<div><a href="http://docs.mongodb.org/"><img src="{{ pathto('_static', 1) }}/logo-mongodb.png" width="190" height="55" alt="mongoDB" /></a></div>
</div>
</div>
<div class="search-db"><gcse:searchbox></gcse:searchbox></div>
<div id="etp">
<ul>
<li>{{ githublink() }}</li>
<li><a href="http://github.com/mongodb/docs" target="_blank" title="Fork the documentation on GitHub and contribute.">GitHub</a></li>
<li><a id="jirafeedback" href="{{ jiralink() }}" target="_blank" title="Report a problem or send feedback about {{pagename|e}}.txt on Jira">Feedback</a></li>
<li><a id="jirafeedback" href="{{ jiralink()|e }}" target="_blank" title="Report a problem or send feedback about {{pagename|e}}.txt on Jira">Feedback</a></li>
</ul>
</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">
{%- 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></gcse:searchresults></div>
{% block body %} {% endblock %}
</div>
{%- if render_sidebar %}
</div>
{%- endif %}
</div>
{%- endblock %}

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

{%- block footer %}
<div class="footer">

<p>This documentation is a product of the MongoDB Documentation Project: fork the repository on <a href="https://github.com/mongodb/docs">GitHub</a>, or open a <a href="http://jira.mongodb.org/browse/DOCS">Jira Case</a> to contribute.

{%- if show_copyright %}
<p>
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }} {% endtrans %} Licensed under <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons</a>. MongoDB&reg;, Mongo&reg;, and the leaf logo are registered trademarks of 10gen, Inc.
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }} {% endtrans %} Licensed under <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons</a>. MongoDB&reg;, Mongo&reg;, and the leaf logo are registered trademarks of 10gen, Inc.</p>
</p>
{%- endif %}
{%- endif %}
</div>
<div class="footer">
<p>This documentation is a product of the MongoDB Documentation Project: fork the repository on <a href="https://github.com/mongodb/docs">GitHub</a>, or open a <a id="jirafooter" href="http://jira.mongodb.org/browse/DOCS">Jira Case</a> to contribute.
{%- if show_copyright %}
<p>{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }} {% endtrans %} Licensed under <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons</a>. MongoDB&reg;, Mongo&reg;, and the leaf logo are registered trademarks of 10gen, Inc.
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }} {% endtrans %} Licensed under <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons</a>.
MongoDB&reg;, Mongo&reg;, and the leaf logo are registered trademarks of 10gen, Inc.</p>
{%- endif %}
{%- endif %}
</div>
{%- endblock %}
{%- block marketosrc %}
<script type="text/javascript" src="//munchkin.marketo.net/munchkin.js"></script>
{%- endblock %}

{%- block analytics %}
<script type="text/javascript">
{%- block analytics %}
var _gaq = _gaq || [];
var pluginUrl = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.') + 'google-analytics.com/plugins/ga/inpage_linkid.js';
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
Expand All @@ -303,31 +245,23 @@
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
{%- endblock %}
{%- endblock -%}
{%- block marketo %}
<script type="text/javascript">
document.write(unescape("%3Cscript src='" + document.location.protocol + "//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script>try { mktoMunchkin("017-HGS-593"); } catch(e) {}</script>
{%- endblock %}
try { mktoMunchkin("017-HGS-593"); } catch(e) {}
{% endblock -%}
{%- block jiracollector -%}
<script type="text/javascript">
// Requires jQuery!
jQuery.ajax({
url: "https://jira.mongodb.org/s/en_US-bxctp1/782/6/1.2.4/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector-embededjs.js?collectorId=298ba4e7",
type: "get",
cache: true,
dataType: "script"
});
window.ATL_JQ_PAGE_PROPS = {
"triggerFunction": function(showCollectorDialog) {
jQuery("#jirafeedback").click(function(e) {
e.preventDefault();
showCollectorDialog();
});
}};
</script>
window.ATL_JQ_PAGE_PROPS = {
"triggerFunction": function(showCollectorDialog) {
jQuery("#jirafeedback").click(function(e) {e.preventDefault();showCollectorDialog();});
jQuery("#jirafooter").click(function(e) {e.preventDefault();showCollectorDialog();});
}};
{%- endblock %}
</script>
</body>
</html>
</html>
13 changes: 13 additions & 0 deletions themes/mongodb/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{#
basic/page.html
~~~~~~~~~~~~~~~

Master template for simple pages.

:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}
{%- extends "layout.html" -%}
{% block body %}
{{ body }}
{% endblock %}
2 changes: 1 addition & 1 deletion themes/mongodb/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ pygments_style = sphinx
branch = BRANCH
pdfpath = PDFPATH
epubpath = EPUBPATH
manual_path = PATH
manual_path = PATH