跳转到主要内容

用于集成Sphinx分站工具

项目描述

sphinx-affiliates

CI status License: MIT

允许搜索包含多个 Sphinx文档 html站点的文档。

当您有一个组织下的多个github仓库,并使用sphinx为它们构建文档,使用github pages提供工件时,这很有用。当您为组织中的一个仓库配置一个 自定义域名,例如 https://my.site.org,任何其他仓库的github pages(例如repo2)将作为 https://my.site.org/repo2 显示。但是,这些站点的 search.html 将不知道对方:它们将完全独立。此扩展将通过以下方式解决这个问题:

  • 将搜索引擎更改为允许加载多个索引
  • 将搜索索引生成过程更改为生成一个额外的索引
  • 添加配置选项,将来自分站的其他索引添加到 search.html 页面。

要使用此功能,请通过 pip 安装它,并在您的 conf.py 中添加如下内容:

extensions = [
    'sphinx_affiliates',   # Add the extension
]

# Where this site's build is hosted, this will be the URL for all the search
# results from this site.
affiliate_options = {
    'canonical_url': "https://affiliate_search.github.io",
}

# Other sites to add to the search of this site. HTTP urls may get blocked
# as cross-site scripting
sphinx_affiliates = [
    '../other_repo1/affiliate_searchindex.js',
    'https://affiliate_search.github.io/other_repo2/affiliate_searchindex.js',
]

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

此版本没有可用的源分发文件。请参阅生成分发归档教程

构建分发

sphinx_affiliates-0.2.1-py3-none-any.whl (10.1 kB 查看哈希值)

上传时间 Python 3

sphinx_affiliates-0.2.1-py2-none-any.whl (10.1 kB 查看哈希值)

上传时间 Python 2

由以下支持