一个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=fancy
。classes
参数是可选的,但将为链接添加任何您想要的自定义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
: 此引用的类型;可以是any
、ref
、doc
或myst
。
项目详情
关闭
sphinx_query_param_ref-0.0.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | d03907bfab00d23c0335a3ef4a3997cc8a82a4ab99470c1e5a0de1c32a4196bc |
|
MD5 | 70343de63bb84af3530f23981b48b697 |
|
BLAKE2b-256 | 278adb21adce190db5e19f32836048518843645cb9a21809ba204c37d9fa22c2 |