跳转到主要内容

一个Sphinx扩展,它增加了创建附加URL查询参数的引用的能力。

项目描述

sphinx-query-param-ref

一个Sphinx扩展,它增加了创建附加URL查询参数的引用的能力。

安装

通过pip安装

pip install sphinx-query-param-ref

或从源代码安装最新开发版本

git clone https://github.com/peytondmurray/sphinx-query-param-ref
cd sphinx-query-param-ref
pip install .

使用方法

首先,通过将其添加到扩展列表中激活扩展

# conf.py

extensions = [
    "sphinx-query-param-ref",
]

这将在RST文档中添加一个新的指令,该指令将带有URL查询参数的引用添加到文档中

.. query-param-ref:: project/examples
    :parameters: ?tags=fancy
    :ref-type: doc
    :classes: custom-link-class-name

    A fancy custom ref!

此节点将解析到指向project/examples文档的链接,但URL后面会附加?tags=fancyclasses参数是可选的,但将为链接添加任何您想要的自定义HTML类。上述代码片段的实际输出将是

<div class="query-param-ref-wrapper">
    <a href="<whatever the reference to project/examples is resolved to>?tags=fancy">A fancy custom ref!</a>
</div>

文档

query-param-ref有三个参数,它们都是可选的

  • parameters: 追加到ref URL末尾的字符串。
  • classes: 附加到<a>元素的HTML类的空格分隔列表。
  • ref-type: 此引用的类型;可以是anyrefdocmyst

项目详情


下载文件

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

源代码分发

sphinx_query_param_ref-0.0.1.tar.gz (4.7 kB 查看哈希值)

上传时间 源代码

支持