{ "info": { "author": "Yongping Guo", "author_email": "guoyoooping@163.com", "bugtrack_url": null, "classifiers": [], "description": "sphinxcontrib-cmd2img\n*********************\n\nA sphinx extension to render the image/figure generated by the command body.\n\n:author: \"Yongping Guo\"\n\n1. Installing and setup\n=======================\n\npip install sphinxcontrib-cmd2img\n\nAnd just add ``sphinxcontrib.cmd2img`` to the list of extensions in the\n``conf.py`` file. For example::\n\n extensions = ['sphinxcontrib.cmd2img']\n\n2. Introduction and examples\n============================\n\nIn rst we we use `image`_ and `figure`_ directive to render image/figure in\nthe target html document, which give us much convenience. In fact we could\nrending more things than that.\n\n.. _image: http://docutils.sourceforge.net/docs/ref/rst/directives.html#image\n.. _figure: http://docutils.sourceforge.net/docs/ref/rst/directives.html#figure\n\nSometime some command would convert or generate a image, we would like to\nrender it efficiently and directly, for example:\n\nditaa_ is a small command-line utility that can convert diagrams drawn\nusing ascii art ('drawings' that contain characters that resemble lines\nlike | / - ), into proper bitmap graphics. We could use the following\ndirective to render the image generated by ditaa::\n\n .. cmd2img:: ditaa\n\n +--------+ +-------+ +-------+\n | | --+ ditaa +--> | |\n | Text | +-------+ |diagram|\n |Document| |!magic!| | |\n | {d}| | | | |\n +---+----+ +-------+ +-------+\n : ^\n | Lots of work |\n +-------------------------+\n\nOr use the following directive to render it as a figure, for a figure, we can\nadd a caption::\n\n .. cmd2fig:: ditaa\n :caption: figure 1. An example to use ditaa to render a figure\n\n +--------+ +-------+ +-------+\n | | --+ ditaa +--> | |\n | Text | +-------+ |diagram|\n |Document| |!magic!| | |\n | {d}| | | | |\n +---+----+ +-------+ +-------+\n : ^\n | Lots of work |\n +-------------------------+\n\nAnother example is gnuplot::\n\n .. cmd2img:: gnuplot\n\n set y2tics -100, 10\n set ytics nomirror\n plot sin(1/x) axis x1y1, 100*cos(x) axis x1y2\n\nAnother example is convert, it will be rendered as a gif in the target::\n\n .. cmd2img:: convert rose: -duplicate 29 -virtual-pixel Gray -distort SRT '%[fx:360.0*t/n]' -set delay '%[fx:t == 0 ? 240 : 10]' -loop 0 rose.gif\n\nAnother example::\n\n .. cmd2img:: dot -T png\n\n digraph example {\n a [label=\"sphinx\", href=\"http://www.sphinx-doc.org/en/master/usage/extensions/index.html\", target=\"_top\"];\n b [label=\"other\"];\n a -> b;\n }\n\n3 Options\n-----------\n\nsphinxcontrib-cmd2img provide some options for easy use.\n\n3.1 command options\n-------------------\n\nFor command options, you should add it right after the command, for example::\n\n .. cmd2fig:: ditaa --no-antialias\n :caption: figure 2. illustration for command option.\n\n +--------+ +-------+ +-------+\n | | --+ ditaa +--> | |\n | Text | +-------+ |diagram|\n |Document| |!magic!| | |\n | {d}| | | | |\n +---+----+ +-------+ +-------+\n : ^\n | Lots of work |\n +-------------------------+\n\n3.2 sphinxcontrib-cmd2img options\n---------------------------------\n\n1) ditaa options:\n\n * :show_source: for text generated iamge, if the source code is shown. \n * :watermark: Add water mark in the image\n * :gravity: watermark gravity, see detail imagematick command convert -draw\n * :location: watermark location, see detail imagematick command convert -draw\n * :fill: watermark contention, see detail imagematick command convert -draw\n * :pointsize: watermark pointsize, see detail imagematick command convert -draw\n * :font: watermark font, see detail imagematick command convert -draw\n\nFor example::\n\n .. cmd2img:: gnuplot\n :width: 300\n :watermark: text 0,0 \"gnuplot test\"\n\n set y2tics -100, 10\n set ytics nomirror\n plot sin(1/x) axis x1y1, 100*cos(x) axis x1y2\n\n5. License\n==========\n\nGPLv3\n\n.. _ditaa: http://ditaa.sourceforge.net/\n.. _Sphinx: http://sphinx.pocoo.org/\n\n6. Changelog\n============\n\n0.1 Initial upload.\n0.2 Correct minor typo", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/stathissideris/sphinxcontrib-cmd2img", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "sphinxcontrib-cmd2img", "package_url": "https://pypi.org/project/sphinxcontrib-cmd2img/", "platform": "any", "project_url": "https://pypi.org/project/sphinxcontrib-cmd2img/", "project_urls": { "Homepage": "https://github.com/stathissideris/sphinxcontrib-cmd2img" }, "release_url": "https://pypi.org/project/sphinxcontrib-cmd2img/0.2/", "requires_dist": null, "requires_python": "", "summary": "Sphinx extension to render the image by script or command", "version": "0.2" }, "last_serial": 5707921, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "b58a0fd294e02b3d312593f11d5a3ef4", "sha256": "2bc85614d39916bdc51505190e1bba1f4f2aab285bf0e9351f99432e1d7b9cea" }, "downloads": -1, "filename": "sphinxcontrib-cmd2img-0.1.tar.gz", "has_sig": false, "md5_digest": "b58a0fd294e02b3d312593f11d5a3ef4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7039, "upload_time": "2019-08-15T08:22:19", "url": "https://files.pythonhosted.org/packages/70/a4/89b0f34738073fcef5df249b2726db1637fd250468171eca61dd17cf5822/sphinxcontrib-cmd2img-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "5975feb37ecc5cb5db223337b7dbda8e", "sha256": "00e0e11dbeb2d8e7a61fdee94a7223309375eb89d8053cfa7b8d8c8040e43a2b" }, "downloads": -1, "filename": "sphinxcontrib-cmd2img-0.2.tar.gz", "has_sig": false, "md5_digest": "5975feb37ecc5cb5db223337b7dbda8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7062, "upload_time": "2019-08-21T08:42:17", "url": "https://files.pythonhosted.org/packages/93/f6/7fbe0d3fbb13489a9c592bf6491f77614f50497fd61f88a20067ddfbebb2/sphinxcontrib-cmd2img-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5975feb37ecc5cb5db223337b7dbda8e", "sha256": "00e0e11dbeb2d8e7a61fdee94a7223309375eb89d8053cfa7b8d8c8040e43a2b" }, "downloads": -1, "filename": "sphinxcontrib-cmd2img-0.2.tar.gz", "has_sig": false, "md5_digest": "5975feb37ecc5cb5db223337b7dbda8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7062, "upload_time": "2019-08-21T08:42:17", "url": "https://files.pythonhosted.org/packages/93/f6/7fbe0d3fbb13489a9c592bf6491f77614f50497fd61f88a20067ddfbebb2/sphinxcontrib-cmd2img-0.2.tar.gz" } ] }