{ "info": { "author": "Fernando Chorney", "author_email": "fernando.chorney@invenia.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Topic :: Documentation", "Topic :: Utilities" ], "description": "# SphinxContrib RunCmd\n\n[![Build Status](https://travis-ci.org/invenia/sphinxcontrib-runcmd.svg?branch=master)](https://travis-ci.org/invenia/sphinxcontrib-runcmd?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/invenia/sphinxcontrib-runcmd/badge.svg?branch=master)](https://coveralls.io/github/invenia/sphinxcontrib-runcmd)\n[![Pip Version](https://img.shields.io/pypi/v/sphinxcontrib-runcmd.svg)](https://pypi.org/project/sphinxcontrib-runcmd)\n[![Python Version](https://img.shields.io/badge/python-2.7%20%7C%203.6-blue.svg)](https://www.python.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nSphinx RunCmd aims to allow you to place the output of arbitrary commands in your rst files, while also giving you greater flexibility in how the output is formatted.\n\n## Installation\n\nsphinxcontrib-runcmd is available on PyPI. To install:\n\n```sh\n$ pip install sphinxcontrib-runcmd\n```\n\n## Add runcmd to your Project\n\nFirst you'll want to add `sphinxcontrib.runcmd` to your `conf.py` file in your docs folder:\n\n```python\nextensions = [\"sphinxcontrib.runcmd\"]\n```\n\nFrom there, all you need to do is use `runcmd` as a directive in your documentation files.\n```rst\n.. runcmd:: python script.py -h\n :syntax: bash\n :prompt:\n```\n\n## Options\n\nThis directive is basically a sub-directive of `code-block`, so it has all of code blocks directives such as:\n - linenos\n - dedent\n - lineno-start\n - emphasize-lines\n - caption\n - class\n - name\n\nThis directive builds upon that and adds the following:\n - syntax: str\n - Since we're using the arguments section for a command we can't actually pass the syntax we want to the `code-block` in the arguments. Therefore you can set it in the options which will then get passed into the `code-block` to colorize your commands output.\n - replace: str\n - Takes in a comma separated list of regex `pattern/replace,pattern/replace` and applies it to the output in that order.\n - prompt: bool\n - Display the command prompt in the output\n - dedent-output: int\n - Will dedent the output only by the int value you specify. Will not dedent the prompt if specified. Be careful, because the `code-block` dedent will be applied on top of this dedent if both are set in the options.\n\n### Replace Option\n\nThe `replace` option uses the `CSV` package to parse the string, thus you can wrap your replacements in double quotes if you want to use commas and whatnot.\n\nYou also need to double escape any forward slashes, but you can single escape quotes.\n\n```rst\n.. runcmd:: python test.py -h\n :replace: \"this\\\\/is\\\\/a\\\\/path/now\\\\/its\\\\/another\\\\/path\",\"\\\"/'\"\n```\n\nThe first replacement will replace `this/is/a/path` with `now/its/another/path`.\n\nThe second replacement will replace `\"` with `'`.\n\n## License\n\nsphinxcontrib-runcmd is provided under an MIT License.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://pypi.org/project/sphinxcontrib-runcmd", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/invenia/sphinxcontrib-runcmd", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sphinxcontrib-runcmd", "package_url": "https://pypi.org/project/sphinxcontrib-runcmd/", "platform": "any", "project_url": "https://pypi.org/project/sphinxcontrib-runcmd/", "project_urls": { "Download": "https://pypi.org/project/sphinxcontrib-runcmd", "Homepage": "https://github.com/invenia/sphinxcontrib-runcmd" }, "release_url": "https://pypi.org/project/sphinxcontrib-runcmd/0.2.0/", "requires_dist": [ "sphinx", "coverage; extra == 'test'", "pytest; extra == 'test'", "pytest-cov; extra == 'test'", "sphinx-testing; extra == 'test'" ], "requires_python": "", "summary": "Sphinx \"runcmd\" extension", "version": "0.2.0" }, "last_serial": 4466933, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "f308c7d81ac322126ee377456df9478c", "sha256": "1be6c42474c9d1ad1dbd679d26583351e1b226c6a29a16c334707768b436e2f6" }, "downloads": -1, "filename": "sphinxcontrib_runcmd-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f308c7d81ac322126ee377456df9478c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6009, "upload_time": "2018-10-30T14:07:25", "url": "https://files.pythonhosted.org/packages/d5/19/41962469f2a528ada17d2d26fc0a3bbc4ef26aacc7776ca55247e82a81dc/sphinxcontrib_runcmd-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6a48e77f25dacf83d84d71724c06778", "sha256": "479f008fd15727d15415464788ef394f0c1b2e8c9b0e14b524463e93ffde965b" }, "downloads": -1, "filename": "sphinxcontrib-runcmd-0.1.3.tar.gz", "has_sig": false, "md5_digest": "b6a48e77f25dacf83d84d71724c06778", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5298, "upload_time": "2018-10-30T14:07:26", "url": "https://files.pythonhosted.org/packages/ed/a9/f20c6c93b6a33d35f777e8a7b508f7c3d0ccfaf1cfc76378b7298a74ea26/sphinxcontrib-runcmd-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "b5deff6afc851000d9b86d4f7bd4001a", "sha256": "7b739b68e27210b4c7c12ba16e5b3da7b313c49991401f896d29bea0f0771934" }, "downloads": -1, "filename": "sphinxcontrib_runcmd-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b5deff6afc851000d9b86d4f7bd4001a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6043, "upload_time": "2018-11-08T20:19:33", "url": "https://files.pythonhosted.org/packages/83/d9/67a79080b5d9fcb367470af9e525a9c53122e95744665de09462dcd676d8/sphinxcontrib_runcmd-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f83279160447eb14ba9168f3283d2851", "sha256": "3551c389d9c5fe82d693c7222feb9658b1a1a5a1abcb0063e8385e5528c64c76" }, "downloads": -1, "filename": "sphinxcontrib-runcmd-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f83279160447eb14ba9168f3283d2851", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5376, "upload_time": "2018-11-08T20:19:34", "url": "https://files.pythonhosted.org/packages/a2/03/6eb30814c9839f36131284a46ec9fc39d7bd356078648bc7125d5d1c05e8/sphinxcontrib-runcmd-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b5deff6afc851000d9b86d4f7bd4001a", "sha256": "7b739b68e27210b4c7c12ba16e5b3da7b313c49991401f896d29bea0f0771934" }, "downloads": -1, "filename": "sphinxcontrib_runcmd-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b5deff6afc851000d9b86d4f7bd4001a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6043, "upload_time": "2018-11-08T20:19:33", "url": "https://files.pythonhosted.org/packages/83/d9/67a79080b5d9fcb367470af9e525a9c53122e95744665de09462dcd676d8/sphinxcontrib_runcmd-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f83279160447eb14ba9168f3283d2851", "sha256": "3551c389d9c5fe82d693c7222feb9658b1a1a5a1abcb0063e8385e5528c64c76" }, "downloads": -1, "filename": "sphinxcontrib-runcmd-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f83279160447eb14ba9168f3283d2851", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5376, "upload_time": "2018-11-08T20:19:34", "url": "https://files.pythonhosted.org/packages/a2/03/6eb30814c9839f36131284a46ec9fc39d7bd356078648bc7125d5d1c05e8/sphinxcontrib-runcmd-0.2.0.tar.gz" } ] }