Skip to content

Commit 28bd05e

Browse files
author
Sam Kleinman
committed
theme: cleanup to layout.html and conf.py
1 parent dfab904 commit 28bd05e

File tree

6 files changed

+125
-211
lines changed

6 files changed

+125
-211
lines changed

conf.py

Lines changed: 41 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
#
66
# This file is execfile()d with the current directory set to its containing dir.
77

8-
# All configuration values have a default; values that are commented out
9-
# serve to show the default.
10-
118
import sys
129
import os
1310
import datetime
@@ -16,40 +13,34 @@
1613

1714
import mongodb_docs_meta
1815

19-
meta = { 'branch': mongodb_docs_meta.get_branch(),
20-
'commit': mongodb_docs_meta.get_commit(),
21-
'manual_path': mongodb_docs_meta.get_manual_path(),
22-
'date': str(datetime.date.today().year),
16+
meta = {
17+
'branch': mongodb_docs_meta.get_branch(),
18+
'commit': mongodb_docs_meta.get_commit(),
19+
'manual_path': mongodb_docs_meta.get_manual_path(),
20+
'date': str(datetime.date.today().year),
2321
}
2422

2523
# -- General configuration ----------------------------------------------------
2624

2725
needs_sphinx = '1.0'
2826

29-
# Add any Sphinx extension module names here, as strings. They can be extensions
30-
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
31-
extensions = ["sphinx.ext.intersphinx", "sphinx.ext.extlinks", "sphinx.ext.todo", "mongodb_domain", "additional_directives", "aggregation_domain"]
27+
extensions = [
28+
'sphinx.ext.intersphinx',
29+
'sphinx.ext.extlinks',
30+
'sphinx.ext.todo',
31+
'mongodb_domain',
32+
'additional_directives',
33+
'aggregation_domain',
34+
]
3235

33-
# Add any paths that contain templates here, relative to this directory.
3436
templates_path = ['.templates']
37+
exclude_patterns = []
3538

36-
# The suffix of source filenames.
3739
source_suffix = '.txt'
3840

39-
# The encoding of source files.
40-
#source_encoding = 'utf-8-sig'
41-
42-
# The master toctree document.
4341
master_doc = 'contents'
44-
45-
# General information about the project.
4642
project = u'MongoDB'
4743
copyright = u'2011-' + meta['date'] + ', 10gen, Inc.'
48-
49-
# The version info for the project you're documenting, acts as replacement for
50-
# |version| and |release|, also used in various other places throughout the
51-
# built documents. The value of ``version`` is used in the paths for the curl commands.
52-
5344
version = '2.2.2'
5445
release = version
5546

@@ -59,91 +50,35 @@
5950
'.. |year| replace:: ' + meta['date'] + BREAK +
6051
'.. |hardlink| replace:: http://docs.mongodb.org/' + meta['branch'])
6152

62-
# The language for content autogenerated by Sphinx. Refer to documentation
63-
# for a list of supported languages.
64-
#language = None
65-
66-
# There are two options for replacing |today|: either, you set today to some
67-
# non-false value, then it is used:
68-
#today = ''
69-
# Else, today_fmt is used as the format for a strftime call.
70-
#today_fmt = '%B %d, %Y'
71-
72-
# List of patterns, relative to source directory, that match files and
73-
# directories to ignore when looking for source files.
74-
exclude_patterns = []
75-
76-
# The reST default role (used for this markup: `text`) to use for all documents.
77-
#default_role = None
78-
79-
# If true, '()' will be appended to :func: etc. cross-reference text.
80-
#add_function_parentheses = True
81-
82-
# If true, the current module name will be prepended to all description
83-
# unit titles (such as .. function::).
84-
#add_module_names = True
85-
86-
# If true, sectionauthor and moduleauthor directives will be shown in the
87-
# output. They are ignored by default.
88-
#show_authors = False
89-
90-
# The name of the Pygments (syntax highlighting) style to use.
9153
pygments_style = 'sphinx'
9254

93-
# A list of ignored prefixes for module index sorting.
94-
#modindex_common_prefix = []
95-
9655
extlinks = {
9756
'issue': ('https://jira.mongodb.org/browse/%s', '' ),
9857
'wiki': ('http://www.mongodb.org/display/DOCS/%s', ''),
9958
'api': ('http://api.mongodb.org/%s', ''),
10059
'source': ('https://github.com/mongodb/mongo/blob/master/%s', ''),
10160
'docsgithub' : ( 'http://github.com/mongodb/docs/blob/' + meta['branch'] + '/%s', ''),
10261
'hardlink' : ( 'http://docs.mongodb.org/' + meta['branch'] + '/%s', '')
103-
}
62+
}
10463

10564
intersphinx_mapping = {
10665
'pymongo': ('http://api.mongodb.org/python/current/', None),
10766
'python' : ('http://docs.python.org/', None),
10867
'django': ('https://django.readthedocs.org/en/latest/', None),
10968
'djangomongodbengine': ('http://django-mongodb.org/', None),
11069
'djangotoolbox' : ('http://djangotoolbox.readthedocs.org/en/latest/', None),
111-
}
70+
}
11271

11372
# -- Options for HTML output ---------------------------------------------------
11473

115-
# The theme to use for HTML and HTML Help pages. See the documentation for
116-
# a list of builtin themes...
11774
html_theme = 'mongodb'
118-
119-
# Add any paths that contain custom themes here, relative to this directory.
12075
html_theme_path = ['themes']
121-
122-
# The name for this set of Sphinx documents. If None, it defaults to
123-
# "<project> v<release> documentation".
12476
html_title = project + ' Manual'
77+
htmlhelp_basename = 'MongoDBdoc'
12578

126-
# A shorter title for the navigation bar. Default is the same as html_title.
127-
#html_short_title = None
128-
129-
# The name of an image file (relative to this directory) to place at the top
130-
# of the sidebar.
13179
html_logo = ".static/logo-mongodb.png"
132-
133-
# The name of an image file (within the static path) to use as favicon of the
134-
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
135-
# pixels large.
136-
#html_favicon = None
137-
138-
# Add any paths that contain custom static files (such as style sheets) here,
139-
# relative to this directory. They are copied after the builtin static files,
140-
# so a file named "default.css" will overwrite the builtin "default.css".
14180
html_static_path = ['source/.static']
14281

143-
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
144-
# using the given strftime format.
145-
html_last_updated_fmt = '%b %d, %Y'
146-
14782
html_copy_source = False
14883
html_use_smartypants = True
14984
html_domain_indices = True
@@ -155,27 +90,21 @@
15590

15691
manual_edition_path = 'http://docs.mongodb.org/' + meta['branch'] + '/' + project + '-Manual-' + meta['branch']
15792

158-
html_theme_options = { 'branch': meta['branch'],
159-
'pdfpath': manual_edition_path + '.pdf',
160-
'epubpath': manual_edition_path + '.epub',
161-
'manual_path': meta['manual_path'],
162-
'repo_name': 'docs',
163-
'jira_project': 'DOCS',
164-
'google_analytics': 'UA-7301842-8',
165-
'is_manual': True,
166-
'project': 'manual',
167-
}
168-
169-
# If true, an OpenSearch description file will be output, and all pages will
170-
# contain a <link> tag referring to it. The value of this option must be the
171-
# base URL from which the finished HTML is served.
172-
#html_use_opensearch = ''
173-
174-
# This is the file name suffix for HTML files (e.g. ".xhtml").
175-
#html_file_suffix = None
176-
177-
# Output file base name for HTML help builder.
178-
htmlhelp_basename = 'MongoDBdoc'
93+
html_theme_options = {
94+
'branch': meta['branch'],
95+
'pdfpath': manual_edition_path + '.pdf',
96+
'epubpath': manual_edition_path + '.epub',
97+
'manual_path': meta['manual_path'],
98+
'repo_name': 'docs',
99+
'jira_project': 'DOCS',
100+
'google_analytics': 'UA-7301842-8',
101+
'is_manual': True,
102+
'project': 'manual',
103+
}
104+
105+
html_sidebars = {
106+
'**': ['localtoc.html', 'pagenav.html', 'wikisidebar.html'],
107+
}
179108

180109
# -- Options for LaTeX output --------------------------------------------------
181110

@@ -187,21 +116,18 @@
187116
('crud', 'MongoDB-crud.tex', u'MongoDB CRUD Operations Introduction', u'MongoDB Documentation Project', 'manual'),
188117
]
189118

190-
latex_elements = { 'preamble': '\DeclareUnicodeCharacter{FF04}{\$} \DeclareUnicodeCharacter{FF0E}{.}',
191-
'pointsize': '10pt',
192-
'papersize': 'letterpaper'
193-
}
119+
latex_elements = {
120+
'preamble': '\DeclareUnicodeCharacter{FF04}{\$} \DeclareUnicodeCharacter{FF0E}{.}',
121+
'pointsize': '10pt',
122+
'papersize': 'letterpaper'
123+
}
194124

195125
latex_use_parts = True
196126
latex_show_pagerefs = True
197127
latex_show_urls = False
198128
latex_domain_indices = True
199-
200-
# The name of an image file (relative to this directory) to place at the top of the title page.
201-
#latex_logo = None
202-
203-
# Documents to append as an appendix to all manuals.
204-
#latex_appendices = []
129+
latex_logo = None
130+
latex_appendices = []
205131

206132
# -- Options for manual page output --------------------------------------------
207133

@@ -244,7 +170,5 @@
244170
epub_identifier = 'http://docs.mongodb.org/' + meta['branch']
245171
epub_exclude_files = []
246172

247-
# HTML files that should be inserted before/after the pages created by sphinx.
248-
# The format is a list of tuples containing the path and title.
249-
#epub_pre_files = []
250-
#epub_post_files = []
173+
epub_pre_files = []
174+
epub_post_files = []

themes/mongodb/analytics.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script type="text/javascript">
2+
var _gaq = _gaq || [];
3+
var pluginUrl = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.') + 'google-analytics.com/plugins/ga/inpage_linkid.js';
4+
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
5+
_gaq.push(['_setAccount', '{{theme_google_analytics}}']);
6+
_gaq.push(['_setDomainName', 'docs.mongodb.org']);
7+
{%- if (pagename == "meta/401") or (pagename == "meta/403") or (pagename == "meta/404") or (pagename == "meta/410") %}
8+
_gaq.push(['_trackPageview', '/{{theme_manaul_path}}/{{pagename}}/?page=' + document.location.pathname + document.location.search + '&from=' + document.referrer]);
9+
{%- else %}
10+
_gaq.push(['_trackPageview']);
11+
{%- endif %}
12+
(function() {
13+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
14+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
15+
var s = document.getElementsByTagName('script')[0];
16+
s.parentNode.insertBefore(ga, s);
17+
})();
18+
</script>
19+
20+
<script type="text/javascript">
21+
document.write(unescape("%3Cscript src='" + document.location.protocol + "//munchkin.marketo.net/munchkin.js' type='text/javascript'%3E%3C/script%3E"));
22+
</script>
23+
<script>try { mktoMunchkin("017-HGS-593"); } catch(e) {}</script>

0 commit comments

Comments
 (0)