- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我刚刚将我的文档从 Github 上传到 ReadTheDocs,我发现它在 ReadTheDocs 和我的本地机器上呈现完全不同。我正在使用最新的 sphinx_rtd_theme
在我的本地机器上。
这是我本地机器上的显示:
这是 ReadTheDocs 上的渲染:
我在 Chrome、Firefox 和 Microsoft Edge 上尝试过,结果相同,所以它似乎不是浏览器问题。
这是我的 conf.py 的副本:
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain 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 sys
# sys.path.insert(0, os.path.abspath('.'))
import os
# -- Project information -----------------------------------------------------
project = 'OrderedTree'
project_title = 'Ordered Tree'
copyright = '2018, Jonathan Gossage'
author = 'Jonathan Gossage'
# The short X.Y version
version = '0.0'
# The full version, including alpha/beta/rc tags
release = '0.0.1'
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
]
# 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']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# 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 = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# Elements to be included at yhe start of each document file
rst_prolog = """
.. |br| raw:: html
<br />
.. |pn| replace:: {}
.. |pt| replace:: {}
""".format(project, project_title)
# -- 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 = 'sphinx_rtd_theme'
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd:
html_theme = 'default'
else:
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# 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".
if on_rtd:
html_static_path = []
else:
html_static_path = ['_static']
html_context = { # Specify the css file to use
'css_files': ['_static/theme_overrides.css',]
}
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = '{}doc'.format(project)
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, '{}.tex'.format(project), '{} Documentation'.format(project_title),
'{}'.format(author), 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, '{}'.format(project), '{} Documentation'.format(project_title),
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, '{}'.format(project), '{} Documentation'.format(project_title),
author, '{}'.format(project), 'One line description of project.',
'Miscellaneous'),
]
# -- Options for Epub output -------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project_title
epub_author = author
epub_publisher = author
epub_copyright = copyright
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''
# A unique identification for the text.
#
# epub_uid = ''
# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
# -- Extension configuration -------------------------------------------------
# -- Options for intersphinx extension ---------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
# -- Options for todo extension ----------------------------------------------
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
sphinx_rtd_theme Footer.html
并将此片段添加到其中并使用修改后的
Footer.html
覆盖基本副本。片段如下:
<br /> <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
<img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a>
<br />
<p>
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>
</p>
最佳答案
听起来像静态 Assets 没有被复制到 RTD 上。让我们看看build log , 下 python /home/docs/checkouts/readthedocs.org/user_builds/orderedtree/envs/latest/bin/sphinx-build -T -E -b readthedocs -d _build/doctrees-readthedocs -D language=en . _build/html
:
copying static files... WARNING: html_static_path entry '/home/docs/checkouts/readthedocs.org/readthedocs/templates/sphinx/_static' does not exist
conf.py
中的设置:
html_static_path = ['_static']
html_static_path = []
关于python-sphinx - ReadTheDocs 和 localhost 之间的渲染差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50080481/
在 Sphinx 2.0.6 中尝试启用通配符 (*) 的搜索时出现以下错误 index products: syntax error, unexpected $undefined near '*'
如果我更新 sphinx.conf 文件中的资源,我可以使用 --rotate 重新索引,一切正常。如果我更新 sphinx.conf 中的索引或添加新索引 --rotate 无效,我必须重新启动 s
问题 我一直在用(Python) Sphinx doc ,以及 CommonMark解析器,编写包含用 reStructuredText 和 Markdown 编写的文件的 Sphinx 文档。到目前
我正在使用漂亮的 sphinx-bootstrap-theme 0.3.4 并尝试将它应用到 Sphinx Python 文档生成器 1.2 版之上。 当我通过 make html 构建文档时,我没有
关于此主题,有几篇“未答复”的帖子与无法找到“sphinx-build”有关: sphinx-build -h command not found in Mac OS Sphinx 是在 OSX 上使
我正在使用 Sphinx 搜索引擎,我遇到一个问题,即一些文件没有显示在搜索结果中,但绝对应该显示。我已经检查以确保没有信息。缺少会阻止这些文件出现的信息。 有什么方法可以直接查询索引,看看有没有这些
如何使用 Sphinx 从索引中获取所有记录?就像 SELECT * FROM index 一样?我知道我可以做这样的事情来获取与特定关键字匹配的所有记录:/usr/local/sphinx/bin/
我对 Sphinx 很陌生,在服务器上记录我的项目。现在一位同事看到了我一直在做的事情,她想做同样的事情——在同一台服务器上记录她的项目。 这些项目不相关(它们不属于单个 TOCtree),我不知道如
我有一个很大的索引定义,索引需要很长时间。我怀疑主要问题是由生成的许多 LEFT OUTER JOIN 引起的。 我看到了 this question ,但找不到有关使用 source: :query
写作的python工具,awscli-bastion , 具有以下由 cookiecutter 构建的目录结构. . ├── awscli_bastion │ ├── __init__.py │
Sphinx 文档生成器提供 only markup .例如,以下将仅包含外部文件“仅”如果其 html 生成器: .. only:: html .. include:: a.rst 但是我将如
我在我的Rails应用程序中实现了 sphinx 搜索。 我想模糊搜索。它应该搜索拼写错误,例如,如果输入搜索查询charact * a * ristics,则应该搜索charact * e * ri
Sphinx-autodoc 将字典、列表和元组扁平化 - 使长的几乎不可读。也并不总是需要 pretty-print 格式,因为一些嵌套的容器比分列更好地保持扁平化。有没有办法显示源代码中输入的可迭
我正在使用 Sphinx 为我的项目编写文档,并且发现下面给出的两个相似的 reStructuredText 段的呈现方式有所不同。 示例 1 Some text: * Item 0 * Item
考虑ReStructuredText中的以下列表: Broken list example ------------------- #. First do spam #. Then do ``eggs
我正在使用 Sphinx Doc 为我的一个项目创建文档,并且我在整个文档中多次使用了一些词,例如 - IP 地址、端口号和许多其他可能会随时间变化的内容。如果由于某种原因,其中一个将被更改,我只想在
我在 .rst 文件中有以下文本: Some text. * Heading | The first topic. | Another topic which is very verbose
我有很多 Sphinx 页面,它们都有相同的链接。像那些: .. _CC-BY: https://creativecommons.org/licenses/by/3.0/ .. _MIT: http:
我想链接到我的狮身人面像文档中的一些URL: blah 我在文档中发现了类似的内容:http://sphinx-doc.org/ext/extlinks.html-而是按照约定用链接替换自定义语法。
使用 sphinx 的自动模块 (https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html) 时, 我只是写在一个 .rst
我是一名优秀的程序员,十分优秀!