【问题标题】:How can an RST file be excluded from Sphinx's default search?如何从 Sphinx 的默认搜索中排除 RST 文件?
【发布时间】:2020-12-01 18:20:59
【问题描述】:

在使用 RST 编写的 Sphinx 项目中,有没有办法通过默认搜索功能将文件排除在考虑范围之外?项目中的一些 RST 文件作为参考包含(例如 LICENSE 文件),但在搜索结果中没有用处。

是否有配置选项或指令指示 Sphinx 不要索引特定 RST 文件以包含在搜索结果中?

【问题讨论】:

    标签: python html python-sphinx restructuredtext


    【解决方案1】:

    如果您在 RST 文件顶部添加:nosearch:,它将被排除在全文搜索之外。

    此功能是在 Sphinx 3.0 中添加的。见https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#special-metadata-fields

    【讨论】:

    • 完美。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2020-06-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    • 2012-12-30
    相关资源
    最近更新 更多