Sphinx 文档构建在私有 GitHub 存储库的 readthedocs 上失败



我已经为Python 3.6项目设置并构建了Sphinx文档(2.1.2(,该项目目前位于私有GitHub存储库中。我想在公开发布项目后 readthedocs.org 托管文档,但目前 readthedocs 构建总是失败并显示此错误消息

 git clone --no-single-branch --depth 50 https://github.com/<user name>/<repo name> .
Cloning into '.'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled

我试图查看 readthedocs 项目设置,但我似乎找不到正确的设置来修改以使构建工作。配置。YAML 直接从 Python 项目的 readthedocs 模板复制而来。

# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
  builder: html
  configuration: docs/conf.py
  fail_on_warning: false
# Build documentation with MkDocs
#mkdocs:
#  configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF and ePub
formats: htmlzip
# Optionally set the version of Python and requirements required to build your docs
python:
   version: 3.6
   install:
      - requirements: docs/requirements.txt
      - requirements: requirements.txt
      - method: pip
   system_packages: true

这是docs/conf.py.

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath(os.pardir))

# -- Project information -----------------------------------------------------
project = '<project name>'
copyright = '2019, <author>'
author = '<author>'
# The full version, including alpha/beta/rc tags
release = '0.1.0'

# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'recommonmark',
    'sphinx.ext.autodoc',
    'sphinxcontrib.httpdomain',
    'sphinx.ext.intersphinx',
    'sphinx.ext.todo',
    'sphinx.ext.coverage',
    'sphinx.ext.viewcode',
    'sphinx.ext.githubpages'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

这可能是因为 ReadTheDocs 允许从其免费成员资格访问公共存储库。

但是,对于私有的GitHub存储库,我们将不得不使用此处提到的ReadtheDocs for Bussiness。

截至2020年2月,每个计划的费用如下:

Plan:
 Advanced ($150 per month)
Plan Features:
Style your documentation to fit your company's brand
Support custom SSL certificates
Host documentation on your own domain

计划:基本($ 50/月(

计划功能: 用于为公司员工托管文档

希望这有帮助

最新更新