加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
conf.py 3.92 KB
一键复制 编辑 原始数据 按行查看 历史
# -*- coding: utf-8 -*-
#
# MongoDB documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 3 09:58:40 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
import sys
import os
import datetime
from sphinx.errors import SphinxError
from giza.config.runtime import RuntimeStateConfig
from giza.config.helper import fetch_config, get_versions, get_manual_path
conf = fetch_config(RuntimeStateConfig())
sconf = conf.system.files.data.sphinx_local
sys.path.append(os.path.join(conf.paths.projectroot, conf.paths.buildsystem, 'sphinxext'))
try:
tags
except NameError:
class Tags(object):
def has(self, *args):
return False
tags = Tags()
# -- General configuration ----------------------------------------------------
needs_sphinx = '1.0'
extensions = [
'sphinx.ext.extlinks',
'sphinx.ext.todo',
'mongodb',
'directives',
'intermanual',
]
locale_dirs = [ os.path.join(conf.paths.projectroot, conf.paths.locale) ]
gettext_compact = False
templates_path = ['.templates']
exclude_patterns = []
source_suffix = '.txt'
master_doc = sconf.master_doc
language = 'en'
project = sconf.project
copyright = u'2008-{0}'.format(datetime.date.today().year)
version = conf.version.branch
release = conf.version.release
rst_epilog = '\n'.join([
'.. |copy| unicode:: U+000A9',
'.. |ent-build| replace:: MongoDB Enterprise',
'.. |year| replace:: {0}'.format(datetime.date.today().year),
'.. |hardlink| replace:: {0}/{1}'.format(conf.project.url, conf.git.branches.current),
'.. |branch| replace:: ``{0}``'.format(conf.git.branches.current),
])
pygments_style = 'sphinx'
extlinks = {
'issue': ('https://jira.mongodb.org/browse/%s', '' ),
'api': ('http://api.mongodb.com/%s', ''),
'manual': ('http://docs.mongodb.com/manual%s', ''),
'ecosystem': ('http://docs.mongodb.com/ecosystem%s', ''),
### We could use the already defined :api: but if we need to specify a particular driver,
### we could just change here
'csharp-api': ('http://api.mongodb.com/csharp/current/html%s.htm', ''),
}
## add `extlinks` for each published version.
for i in conf.git.branches.published:
extlinks[i] = ( ''.join([ conf.project.url, '/', i, '%s' ]), '' )
intersphinx_mapping = {}
for i in conf.system.files.data.intersphinx:
intersphinx_mapping[i.name] = ( i.url, os.path.join(conf.paths.projectroot,
conf.paths.output,
i.path))
# -- Options for HTML output ---------------------------------------------------
html_theme = sconf.theme.name
html_theme_path = [ os.path.join(conf.paths.buildsystem, 'themes') ]
html_title = conf.project.title
htmlhelp_basename = 'MongoDBdoc'
html_logo = sconf.logo
html_static_path = sconf.paths.static
html_copy_source = False
html_domain_indices = True
html_use_index = True
html_split_index = False
html_show_sourcelink = False
html_show_sphinx = True
html_show_copyright = True
manual_edition_path = '{0}/{1}/{2}'.format(conf.project.url,
conf.git.branches.current,
sconf.theme.book_path_base)
html_theme_options = {
'branch': conf.git.branches.current,
'manual_path': get_manual_path(conf),
'language': language,
'repo_name': sconf.theme.repo,
'jira_project': sconf.theme.jira,
'google_analytics': sconf.theme.google_analytics,
'project': sconf.theme.project,
'version': version,
'version_selector': [{'text':'Shell','path':'getting-started/shell'},
{'text':'Python','path':'getting-started/python'},
{'text':'C#','path':'getting-started/csharp'}],
# 'version_selector': get_versions(conf),
'stable': conf.version.stable,
'sitename': sconf.theme.sitename,
'nav_excluded': sconf.theme.nav_excluded,
}
html_sidebars = sconf.sidebars
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化