|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# |
| 3 | +# MongoDB documentation build configuration file, created by |
| 4 | +# sphinx-quickstart on Mon Oct 3 09:58:40 2011. |
| 5 | +# |
| 6 | +# This file is execfile()d with the current directory set to its containing dir. |
| 7 | + |
| 8 | +import sys |
| 9 | +import os.path |
| 10 | +import datetime |
| 11 | + |
| 12 | +project_root = os.path.join(os.path.abspath(os.path.dirname(__file__))) |
| 13 | +sys.path.append(project_root) |
| 14 | + |
| 15 | +from giza.config.runtime import RuntimeStateConfig |
| 16 | +from giza.config.helper import fetch_config, get_versions, get_manual_path |
| 17 | + |
| 18 | +conf = fetch_config(RuntimeStateConfig()) |
| 19 | +intersphinx_libs = conf.system.files.data.intersphinx |
| 20 | +sconf = conf.system.files.data.sphinx_local |
| 21 | + |
| 22 | +sys.path.append(os.path.join(conf.paths.projectroot, conf.paths.buildsystem, 'sphinxext')) |
| 23 | + |
| 24 | +# -- General configuration ---------------------------------------------------- |
| 25 | + |
| 26 | +needs_sphinx = '1.0' |
| 27 | + |
| 28 | +extensions = [ |
| 29 | + 'sphinx.ext.extlinks', |
| 30 | + 'sphinx.ext.todo', |
| 31 | + 'mongodb', |
| 32 | + 'directives', |
| 33 | + 'intermanual', |
| 34 | + 'fasthtml' |
| 35 | +] |
| 36 | + |
| 37 | +templates_path = ['.templates'] |
| 38 | +exclude_patterns = [] |
| 39 | + |
| 40 | +source_suffix = '.txt' |
| 41 | + |
| 42 | +master_doc = sconf.master_doc |
| 43 | +language = 'en' |
| 44 | +project = sconf.project |
| 45 | +copyright = u'2008-{0}'.format(datetime.date.today().year) |
| 46 | + |
| 47 | +version = '3.0' |
| 48 | +release = version |
| 49 | + |
| 50 | +rst_epilog = '\n'.join([ |
| 51 | + '.. |branch| replace:: ``{0}``'.format(conf.git.branches.current), |
| 52 | + '.. |copy| unicode:: U+000A9', |
| 53 | + '.. |year| replace:: {0}'.format(datetime.date.today().year), |
| 54 | + '.. |ent-build| replace:: MongoDB Enterprise', |
| 55 | + '.. |hardlink| replace:: http://docs.mongodb.com/realm/', |
| 56 | + '.. |atlas-full| replace:: MongoDB Atlas', |
| 57 | + '.. |atlas| replace:: Atlas' |
| 58 | +]) |
| 59 | + |
| 60 | +extlinks = { |
| 61 | + 'issue': ('https://jira.mongodb.org/browse/%s', '' ), |
| 62 | + 'api': ('http://api.mongodb.com/%s', ''), |
| 63 | + 'manual': ('http://docs.mongodb.org/manual%s', ''), |
| 64 | + 'gettingstarted': ('http://docs.mongodb.org/getting-started%s', ''), |
| 65 | + 'atlas': ('https://docs.atlas.mongodb.com%s',''), |
| 66 | + 'mms-docs': ('https://docs.cloud.mongodb.com%s', ''), |
| 67 | + 'mms-home': ('https://cloud.mongodb.com%s', ''), |
| 68 | + 'guides': ('https://docs.mongodb.com/guides%s', ''), |
| 69 | + 'java-docs-latest': ('http://mongodb.github.io/mongo-java-driver/3.11/%s', ''), |
| 70 | +} |
| 71 | + |
| 72 | +intersphinx_mapping = {} |
| 73 | + |
| 74 | +try: |
| 75 | + for i in intersphinx_libs: |
| 76 | + intersphinx_mapping[i['name']] = ( i['url'], os.path.join(conf.paths.projectroot, |
| 77 | + conf.paths.output, |
| 78 | + i['path'])) |
| 79 | +except: |
| 80 | + for i in intersphinx_libs: |
| 81 | + intersphinx_mapping[i.name] = ( i.url, os.path.join(conf.paths.projectroot, |
| 82 | + conf.paths.output, |
| 83 | + i.path)) |
| 84 | + |
| 85 | + |
| 86 | +languages = [ |
| 87 | + ("ar", "Arabic"), |
| 88 | + ("cn", "Chinese"), |
| 89 | + ("cs", "Czech"), |
| 90 | + ("de", "German"), |
| 91 | + ("es", "Spanish"), |
| 92 | + ("fr", "French"), |
| 93 | + ("hu", "Hungarian"), |
| 94 | + ("id", "Indonesian"), |
| 95 | + ("it", "Italian"), |
| 96 | + ("jp", "Japanese"), |
| 97 | + ("ko", "Korean"), |
| 98 | + ("lt", "Lithuanian"), |
| 99 | + ("pl", "Polish"), |
| 100 | + ("pt", "Portuguese"), |
| 101 | + ("ro", "Romanian"), |
| 102 | + ("ru", "Russian"), |
| 103 | + ("tr", "Turkish"), |
| 104 | + ("uk", "Ukrainian") |
| 105 | +] |
| 106 | + |
| 107 | +# -- Options for HTML output --------------------------------------------------- |
| 108 | + |
| 109 | +html_theme = sconf.theme.name |
| 110 | +html_theme_path = [ os.path.join(conf.paths.buildsystem, 'themes') ] |
| 111 | +html_title = conf.project.title |
| 112 | +htmlhelp_basename = 'MongoDBdoc' |
| 113 | + |
| 114 | +html_logo = ".static/logo-mongodb.png" |
| 115 | +html_static_path = ['source/.static'] |
| 116 | +html_last_updated_fmt = '%b %d, %Y' |
| 117 | + |
| 118 | +html_copy_source = False |
| 119 | +html_domain_indices = True |
| 120 | +html_use_index = True |
| 121 | +html_split_index = False |
| 122 | +html_show_sourcelink = False |
| 123 | +html_show_sphinx = True |
| 124 | +html_show_copyright = True |
| 125 | + |
| 126 | +manual_edition_path = '{0}/{1}/{2}.{3}' |
| 127 | + |
| 128 | +html_theme_options = { |
| 129 | + 'branch': conf.git.branches.current, |
| 130 | + 'translations': languages, |
| 131 | + 'language': language, |
| 132 | + 'manual_path': "ecosystem", |
| 133 | + 'repo_name': 'docs-ecosystem', |
| 134 | + 'jira_project': 'DOCS', |
| 135 | + 'google_analytics': sconf.theme.google_analytics, |
| 136 | + 'project': sconf.project, |
| 137 | + 'nav_excluded': sconf.theme.nav_excluded, |
| 138 | +} |
| 139 | + |
| 140 | +html_sidebars = sconf.sidebars |
0 commit comments