python - 格式化函数名称的简单方法

标签 python python-sphinx

我在 sphinx (1.2.1) 中使用默认主题,我希望函数名称出现在标题中(带有 args 等等,在函数文档字符串上)以某种方式更大且更易读,如其他主题。由于我做了一些改编,我不想切换主题

有什么办法可以实现吗?

enter image description here

最佳答案

您应该能够通过指定自己的 CSS 来做到这一点。这些函数具有 css 类“.function”。所以你可以添加这样的东西

dl.function dt {
   font-weight: normal;
   [etc ...]
}

在你的 [sphinx 目录]/source/_static/default.css 中。我通常只复制原始 sphinx css 文件并在末尾添加我的编辑。

类似

dl.class dt,
dl.exception dt,
dl.method dt,

关于python - 格式化函数名称的简单方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21634768/

相关文章:

python-sphinx - 无法使用Sphinx doc在标签上使用:ref:

c++ - C++ 中的狮身人面像 (Linux)

Python 文档文章 "Security considerations"有关 `smtplib` 的 SSL 上下文

python - 使用预处理器输出时出现 pycparser 错误

python - 使用 Python Paramiko 通过 SSH 将输入/变量传递给命令/脚本

python - 狮身人面像模板

python - 我在哪里可以找到有关带有 sphinx-doc 拿破仑扩展的 Google 风格文档字符串中支持的新语法的更多信息?

python - 在 gitlab ci pipeline/python 3 alpine 图像中找不到 sphinx-build 命令

python - 无法连接具有相同长度的 Pandas 数据帧?

python - 需要帮助使用 pip 安装特定的 python 包