Skip to main content

A Sphinx extension that adds the ability to create references with attached URL query parameters

Project description

sphinx-query-param-ref

A Sphinx extension that adds the ability to create references with attached URL query parameters.

Installation

Install via pip:

pip install sphinx-query-param-ref

or from source for the latest development version:

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

Usage

First, activate the extension by adding it to the list of extensions:

# conf.py

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

This will add a new directive which adds references with URL query parameters to an RST document:

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

    A fancy custom ref!

This node will resolve to a link to the project/examples document, but with ?tags=fancy appended to the URL. The classes parameter is optional, but will add any custom html classes to the link that you want. The actual output of the snippet above will be

<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>

Documentation

The query-param-ref has three parameters, all of them optional:

  • parameters: The string to append to the end of the ref URL.
  • classes: A space-separated list of HTML classes to attach to the <a> element.
  • ref-type: Type of reference this is; can be any, ref, doc, or myst.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_query_param_ref-0.0.1.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file sphinx_query_param_ref-0.0.1.tar.gz.

File metadata

File hashes

Hashes for sphinx_query_param_ref-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d03907bfab00d23c0335a3ef4a3997cc8a82a4ab99470c1e5a0de1c32a4196bc
MD5 70343de63bb84af3530f23981b48b697
BLAKE2b-256 278adb21adce190db5e19f32836048518843645cb9a21809ba204c37d9fa22c2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page