Metadata-Version: 2.1
Name: rst-pypi-ref
Version: 0.2.0
Summary: reStructuredText custom role to add ref to PyPI.
Author-email: Kazuya Takei <myself@attakei.net>
Description-Content-Type: text/x-rst
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Sphinx
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Documentation :: Sphinx
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Text Processing :: Markup :: reStructuredText
Requires-Dist: docutils
Requires-Dist: sphinx ; extra == "sphinx"
Requires-Dist: pygments ; extra == "test"
Requires-Dist: pytest ~=7.2.0 ; extra == "test"
Project-URL: Home, https://github.com/attakei-lab/rst-pypi-ref
Project-URL: Repository, https://github.com/attakei-lab/rst-pypi-ref
Provides-Extra: sphinx
Provides-Extra: test

============
rst-pypi-ref
============

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

.. code-block:: console

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

Simple usage
------------

.. code-block:: console

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

.. code-block:: python

   extensions = [
       "rst_pypi_ref.sphinx",
   ]

For other docutils app
----------------------

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

.. code-block:: python

   from rst_pypi_ref.core import bootstrap

   bootstrap()

