sphinxcontrib-requirements-txt


Namesphinxcontrib-requirements-txt JSON
Version 0.0.4 PyPI version JSON
download
home_page
SummaryA sphinx extension to generate a rst/markdown to display the dependencies of a python package from requirement.txt
upload_time2023-09-02 14:34:29
maintainer
docs_urlNone
author
requires_python>=3.8
licenseGPL v3
keywords sphinx myst requirements.txt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # sphinxcontrib-requirements-txt

[![readthedocs](https://shields.io/readthedocs/sphinxcontrib-requirements-txt)](https://sphinx-contrib-requirements-txt.readthedocs.io)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/sphinx-contrib/requirements-txt/main.svg)](https://results.pre-commit.ci/latest/github/sphinx-contrib/requirements-txt/main)
[![github/workflow](https://github.com/sphinx-contrib/requirements-txt/actions/workflows/main.yml/badge.svg)](https://github.com/sphinx-contrib/requirements-txt/actions)
[![codecov](https://codecov.io/gh/sphinx-contrib/requirements-txt/branch/main/graph/badge.svg)](https://codecov.io/gh/sphinx-contrib/requirements-txt)

[![github/downloads](https://shields.io/github/downloads/sphinx-contrib/requirements-txt/total)](https://github.com/sphinx-contrib/requirements-txt/releases)
[![github/downloads/latest](https://shields.io/github/downloads/sphinx-contrib/requirements-txt/latest/total)](https://github.com/sphinx-contrib/requirements-txt/releases/latest)
[![github/issues](https://shields.io/github/issues/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/issues)
[![github/issues-closed](https://shields.io/github/issues-closed/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/issues?q=is%3Aissue+is%3Aclosed)
[![github/issues-pr](https://shields.io/github/issues-pr/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/pulls)
[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/pulls?q=is%3Apr+is%3Aclosed)
[![github/discussions](https://shields.io/github/discussions/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/discussions)
[![github/milestones](https://shields.io/github/milestones/all/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/milestones)
[![github/forks](https://shields.io/github/forks/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/network/members)
[![github/stars](https://shields.io/github/stars/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/stargazers)
[![github/watchers](https://shields.io/github/watchers/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/watchers)
[![github/contributors](https://shields.io/github/contributors/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/graphs/contributors)
[![github/commit-activity](https://shields.io/github/commit-activity/w/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/graphs/commit-activity)
[![github/last-commit](https://shields.io/github/last-commit/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/commits)
[![github/release-date](https://shields.io/github/release-date/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/releases/latest)

[![github/license](https://shields.io/github/license/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/blob/main/LICENSE)
[![github/languages](https://shields.io/github/languages/count/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)
[![github/languages/top](https://shields.io/github/languages/top/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)
[![github/directory-file-count](https://shields.io/github/directory-file-count/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)
[![github/code-size](https://shields.io/github/languages/code-size/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)
[![github/repo-size](https://shields.io/github/repo-size/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)
[![github/v](https://shields.io/github/v/release/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)

[![pypi/status](https://shields.io/pypi/status/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#description)
[![pypi/v](https://shields.io/pypi/v/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#history)
[![pypi/downloads](https://shields.io/pypi/dd/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#files)
[![pypi/format](https://shields.io/pypi/format/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#files)
[![pypi/implementation](https://shields.io/pypi/implementation/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#files)
[![pypi/pyversions](https://shields.io/pypi/pyversions/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#files)

A sphinx extension to generate a rst/markdown to display the dependencies of
a python package from `requirement.txt`.

## Usage

Take MyST as an example. rst is similar.

`requirement.txt`:

````kconfig
# To complete package names, a cache is needed.
# Every time you change template, the cache must be regenerated.
#
# ```shell
# $ pkgbuild-language-server --print-config cache
# /home/wzy/.cache/pacman.json
# ```

pyalpm
# See <https://wiki.archlinux.org/title/Namcap>.
git+git://gitlab.archlinux.org/pacman/namcap
````

`docs/conf.py`:

```python
# ...
extensions = [
    "myst_parser",
    "sphinxcontrib.requirements_txt",
]
# ...
```

`docs/index.md`:

````markdown
```{requirements} ../requirements.txt
```
````

Then:

```shell
cd docs && sphinx-build . _build/html
cd -
xdg-open docs/_build/html/index.html
```

A generated markdown will be inserted and rendered. You see:

![screenshot](https://github.com/Freed-Wu/pkgbuild-language-server/assets/32936898/c64ba56f-e2d5-4755-be50-632bd65d431c)

## Customize

````markdown
```{requirements} /the/path/of/requirements.txt
---
title: Dependence
template: /the/path/of/template.j2
---
```
````

- `/the/path/of/requirements.txt` can be a glob expression.
- `title` can contain `{title}`, which will be converted to the base name of
  requirement file. Such as `requirements/dev.txt` will be converted to `dev`.
- `template` is a jinja2 file. See [jinja2 syntax](https://docs.jinkan.org/docs/jinja2/templates.html)
  and
  [examples](https://github.com/sphinx-contrib/requirements-txt/blob/main/src/sphinxcontrib/requirements_txt/assets/jinja2).

## Alternatives

- [sphinxcontrib-eval](https://github.com/sphinx-contrib/eval#generate-requirements-document)

See
[![readthedocs](https://shields.io/readthedocs/sphinxcontrib-requirements-txt)](https://sphinxcontrib-requirements-txt.readthedocs.io)
to know more.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sphinxcontrib-requirements-txt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "sphinx,myst,requirements.txt",
    "author": "",
    "author_email": "Wu Zhenyu <wuzhenyu@ustc.edu>",
    "download_url": "https://files.pythonhosted.org/packages/15/09/86a2e5de277b58d56e379600f21034fab5fc8df1c29e1f60c82041dce8e2/sphinxcontrib-requirements-txt-0.0.4.tar.gz",
    "platform": null,
    "description": "# sphinxcontrib-requirements-txt\n\n[![readthedocs](https://shields.io/readthedocs/sphinxcontrib-requirements-txt)](https://sphinx-contrib-requirements-txt.readthedocs.io)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/sphinx-contrib/requirements-txt/main.svg)](https://results.pre-commit.ci/latest/github/sphinx-contrib/requirements-txt/main)\n[![github/workflow](https://github.com/sphinx-contrib/requirements-txt/actions/workflows/main.yml/badge.svg)](https://github.com/sphinx-contrib/requirements-txt/actions)\n[![codecov](https://codecov.io/gh/sphinx-contrib/requirements-txt/branch/main/graph/badge.svg)](https://codecov.io/gh/sphinx-contrib/requirements-txt)\n\n[![github/downloads](https://shields.io/github/downloads/sphinx-contrib/requirements-txt/total)](https://github.com/sphinx-contrib/requirements-txt/releases)\n[![github/downloads/latest](https://shields.io/github/downloads/sphinx-contrib/requirements-txt/latest/total)](https://github.com/sphinx-contrib/requirements-txt/releases/latest)\n[![github/issues](https://shields.io/github/issues/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/issues)\n[![github/issues-closed](https://shields.io/github/issues-closed/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/issues?q=is%3Aissue+is%3Aclosed)\n[![github/issues-pr](https://shields.io/github/issues-pr/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/pulls)\n[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/pulls?q=is%3Apr+is%3Aclosed)\n[![github/discussions](https://shields.io/github/discussions/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/discussions)\n[![github/milestones](https://shields.io/github/milestones/all/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/milestones)\n[![github/forks](https://shields.io/github/forks/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/network/members)\n[![github/stars](https://shields.io/github/stars/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/stargazers)\n[![github/watchers](https://shields.io/github/watchers/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/watchers)\n[![github/contributors](https://shields.io/github/contributors/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/graphs/contributors)\n[![github/commit-activity](https://shields.io/github/commit-activity/w/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/graphs/commit-activity)\n[![github/last-commit](https://shields.io/github/last-commit/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/commits)\n[![github/release-date](https://shields.io/github/release-date/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/releases/latest)\n\n[![github/license](https://shields.io/github/license/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt/blob/main/LICENSE)\n[![github/languages](https://shields.io/github/languages/count/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)\n[![github/languages/top](https://shields.io/github/languages/top/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)\n[![github/directory-file-count](https://shields.io/github/directory-file-count/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)\n[![github/code-size](https://shields.io/github/languages/code-size/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)\n[![github/repo-size](https://shields.io/github/repo-size/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)\n[![github/v](https://shields.io/github/v/release/sphinx-contrib/requirements-txt)](https://github.com/sphinx-contrib/requirements-txt)\n\n[![pypi/status](https://shields.io/pypi/status/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#description)\n[![pypi/v](https://shields.io/pypi/v/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#history)\n[![pypi/downloads](https://shields.io/pypi/dd/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#files)\n[![pypi/format](https://shields.io/pypi/format/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#files)\n[![pypi/implementation](https://shields.io/pypi/implementation/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#files)\n[![pypi/pyversions](https://shields.io/pypi/pyversions/sphinxcontrib-requirements-txt)](https://pypi.org/project/sphinxcontrib-requirements-txt/#files)\n\nA sphinx extension to generate a rst/markdown to display the dependencies of\na python package from `requirement.txt`.\n\n## Usage\n\nTake MyST as an example. rst is similar.\n\n`requirement.txt`:\n\n````kconfig\n# To complete package names, a cache is needed.\n# Every time you change template, the cache must be regenerated.\n#\n# ```shell\n# $ pkgbuild-language-server --print-config cache\n# /home/wzy/.cache/pacman.json\n# ```\n\npyalpm\n# See <https://wiki.archlinux.org/title/Namcap>.\ngit+git://gitlab.archlinux.org/pacman/namcap\n````\n\n`docs/conf.py`:\n\n```python\n# ...\nextensions = [\n    \"myst_parser\",\n    \"sphinxcontrib.requirements_txt\",\n]\n# ...\n```\n\n`docs/index.md`:\n\n````markdown\n```{requirements} ../requirements.txt\n```\n````\n\nThen:\n\n```shell\ncd docs && sphinx-build . _build/html\ncd -\nxdg-open docs/_build/html/index.html\n```\n\nA generated markdown will be inserted and rendered. You see:\n\n![screenshot](https://github.com/Freed-Wu/pkgbuild-language-server/assets/32936898/c64ba56f-e2d5-4755-be50-632bd65d431c)\n\n## Customize\n\n````markdown\n```{requirements} /the/path/of/requirements.txt\n---\ntitle: Dependence\ntemplate: /the/path/of/template.j2\n---\n```\n````\n\n- `/the/path/of/requirements.txt` can be a glob expression.\n- `title` can contain `{title}`, which will be converted to the base name of\n  requirement file. Such as `requirements/dev.txt` will be converted to `dev`.\n- `template` is a jinja2 file. See [jinja2 syntax](https://docs.jinkan.org/docs/jinja2/templates.html)\n  and\n  [examples](https://github.com/sphinx-contrib/requirements-txt/blob/main/src/sphinxcontrib/requirements_txt/assets/jinja2).\n\n## Alternatives\n\n- [sphinxcontrib-eval](https://github.com/sphinx-contrib/eval#generate-requirements-document)\n\nSee\n[![readthedocs](https://shields.io/readthedocs/sphinxcontrib-requirements-txt)](https://sphinxcontrib-requirements-txt.readthedocs.io)\nto know more.\n",
    "bugtrack_url": null,
    "license": "GPL v3",
    "summary": "A sphinx extension to generate a rst/markdown to display the dependencies of a python package from requirement.txt",
    "version": "0.0.4",
    "project_urls": {
        "Bug Report": "https://github.com/sphinx-contrib/requirements-txt/issues",
        "Download": "https://github.com/sphinx-contrib/requirements-txt/releases",
        "Homepage": "https://sphinxcontrib-requirements-txt.readthedocs.io",
        "Source": "https://github.com/sphinx-contrib/requirements-txt"
    },
    "split_keywords": [
        "sphinx",
        "myst",
        "requirements.txt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "caaee795d7562c7514bf1139debba320dc2d6bafea90c132c2665e9dec87f209",
                "md5": "cffbd8def186d0496a3e3af73348ca2e",
                "sha256": "b312e6ff740407c67b8d79d2b5dcbd8c9109d882bff1cb040e5f585303efd431"
            },
            "downloads": -1,
            "filename": "sphinxcontrib_requirements_txt-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cffbd8def186d0496a3e3af73348ca2e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 18869,
            "upload_time": "2023-09-02T14:34:28",
            "upload_time_iso_8601": "2023-09-02T14:34:28.048773Z",
            "url": "https://files.pythonhosted.org/packages/ca/ae/e795d7562c7514bf1139debba320dc2d6bafea90c132c2665e9dec87f209/sphinxcontrib_requirements_txt-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "150986a2e5de277b58d56e379600f21034fab5fc8df1c29e1f60c82041dce8e2",
                "md5": "b6b38db226bd3009cb4ccbd6db7ae5e7",
                "sha256": "5375fc48c5b0c6ce0ef232e599ca509ffb986e1ed12269460511eeaeaaeda1e6"
            },
            "downloads": -1,
            "filename": "sphinxcontrib-requirements-txt-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "b6b38db226bd3009cb4ccbd6db7ae5e7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 25570,
            "upload_time": "2023-09-02T14:34:29",
            "upload_time_iso_8601": "2023-09-02T14:34:29.740735Z",
            "url": "https://files.pythonhosted.org/packages/15/09/86a2e5de277b58d56e379600f21034fab5fc8df1c29e1f60c82041dce8e2/sphinxcontrib-requirements-txt-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-02 14:34:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sphinx-contrib",
    "github_project": "requirements-txt",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "sphinxcontrib-requirements-txt"
}
        
Elapsed time: 0.22155s