Skip to main content

reStructuredText custom role to add ref to PyPI.

Project description

reStructuredText custom role to refer PyPI packages.

Description

This is python package to provide features to refer to PyPI in docutils (and more).

Included features:

  • reStructuredText role

  • Sphinx extension

Installation

pip install rst-pypi-ref

Usage

When you write :pypi:`rst-pypi-ref` into reStructuredText source, this appends ref to PyPI URL for rst-pypi-ref.

Supporting syntax

  • Package name only: :pypi:`rst-pypi-ref`

  • Explicit version: :pypi:`rst-pypi-ref==0.2.0`

  • Change display text: :pypi:`PyPI Link <rst-pypi-ref>`

    • There package name in between < and >.

Simple usage

$ echo ':pypi:`rst-pypi-ref`' | python -m rst_pypi_ref.cli
<document source="<stdin>">
    <paragraph>
        <reference refuri="https://pypi.org/project/rst-pypi-ref">
            rst-pypi-ref

With Sphinx

extensions = [
    "rst_pypi_ref.sphinx",
]

For other docutils app

In entrypoint (before parse reST source), Call rst_pypi_ref.core.bootstrap.

from rst_pypi_ref.core import bootstrap

bootstrap()

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

rst_pypi_ref-0.3.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rst_pypi_ref-0.3.0-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file rst_pypi_ref-0.3.0.tar.gz.

File metadata

  • Download URL: rst_pypi_ref-0.3.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for rst_pypi_ref-0.3.0.tar.gz
Algorithm Hash digest
SHA256 114b7a878f40d4a84bb538e5d9b486c1019248747a6927ac9971527e6184f9b1
MD5 8e9449903ccb84217e122a7b2a4236b3
BLAKE2b-256 d39c7492ff1453f465607a4108af249db49ee0113dcce09a0e95a85dfb2638f8

See more details on using hashes here.

File details

Details for the file rst_pypi_ref-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: rst_pypi_ref-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for rst_pypi_ref-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 095501fd1c46094c1e859c395f645def19e7641704a88b0a55a3ad104056ce84
MD5 80b83107a48893cf60f9186e7a9a1543
BLAKE2b-256 c82fc7a424d2871c5697a9e67e22bd63fdecda84c83b65a2cda3b2adeca4d86b

See more details on using hashes here.

Supported by

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