{ "info": { "author": "Takeshi KOMIYA", "author_email": "i.tkomiya@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Framework :: Sphinx :: Extension", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Documentation", "Topic :: Documentation :: Sphinx" ], "description": "sphinxcontrib-imagehelper\n==========================\n\n.. image:: https://travis-ci.org/tk0miya/sphinxcontrib-imagehelper.svg?branch=master\n :target: https://travis-ci.org/tk0miya/sphinxcontrib-imagehelper\n\n.. image:: https://coveralls.io/repos/tk0miya/sphinxcontrib-imagehelper/badge.png?branch=master\n :target: https://coveralls.io/r/tk0miya/sphinxcontrib-imagehelper?branch=master\n\n.. image:: https://codeclimate.com/github/tk0miya/sphinxcontrib-imagehelper/badges/gpa.svg\n :target: https://codeclimate.com/github/tk0miya/sphinxcontrib-imagehelper\n\n`sphinxcontrib-imagehelper` is helpers for creating image Sphinx extensions.\n\nAdding new image format support to Sphinx is too boring.\nThis helper helps you to create image sphinx extensions.\n\nIt provides these features:\n\n* Caching converted images\n* Conseal sphinx directory structure; determine path of images automatically\n* Support common options for image directive (cf. `:height:`, `:scale:`, `:align:`, and so on)\n* Enhance standard imaging directives; `image` and `figure` get capability to embed new image format\n\nWith `sphinxcontrib-imagehelper`, all you have to do is only convert new image format to\nwell known image formats.\n\nInstall\n=======\n\n::\n\n $ pip install sphinxcontrib-imagehelper\n\nExample\n=======\n\n::\n\n from sphinxcontrib.imagehelper import (\n add_image_type, add_image_directive, add_figure_directive, ImageConverter\n )\n\n # Declare converter class inherits ImageConverter\n class MyImageConverter(ImageConverter):\n # Override `get_filename_for()` to determine filename\n def get_filename_for(self, node):\n # filename is came from its URI and configuration\n hashed = sha1((node['uri'] + self.app.config.some_convert_settings).encode('utf-8')).hexdigest()\n return 'myimage-%s.png' % hashed\n\n # Override `convert()` to convert new image format to well known image formats (PNG, JPG and so on)\n def convert(self, node, filename, to):\n # Hint: you can refer self.app.builder.format to switch conversion behavior\n succeeded = convert_myimage_to_png(filename, to,\n option1=node['option'],\n option2=self.app.config.some_convert_settings)\n if succeeded:\n return True # return True if conversion succeeded\n else:\n return False\n\n def setup(app)\n # Register new image type: myimage\n add_image_type(app, 'my', 'img', MyImageConverter)\n\n # Register my-image directive\n add_image_directive(app, 'my')\n\n # Register my-figure directive\n add_figure_directive(app, 'my')\n\nHelpers\n=======\n\n`sphinxcontrib.imagehelper.add_image_type(app, name, ext, handler)`\n Register a new image type which is identified with file extension `ext`.\n The `handler` is used to convert image formats.\n\n`sphinxcontrib.imagehelper.ImageConverter`\n A handler class for converting image formats. It is used at `add_image_type()`.\n The developers of sphinx-extensions should create a handler class which inherits `ImageConverter`,\n and should override two following methods:\n\n `ImageConverter.option_spec`\n A definition of additional options.\n By default, it is empty dict.\n\n `ImageConverter.get_last_modified_for(self, node)`\n Determine last modified time of target image.\n By default, this method returns the timestamp of the image file.\n\n `ImageConverter.get_filename_for(self, node)`\n Determine a filename of converted image.\n By default, this method returns the filename replaced its extension with '.png'::\n\n def get_filename_for(self, node):\n return os.path.splitext(node['uri'])[0] + '.png'\n\n `ImageConverter.convert(self, node, filename, to)`\n Convert image to embedable format.\n By default, this method does nothing.\n\n`sphinxcontrib.imagehelper.add_image_directive(app, name, option_spec={})`\n Add a custom image directive to Sphinx.\n The directive is named as `name`-image (cf. astah-image).\n\n If `option_spec` is given, the new directive accepts custom options.\n\n`sphinxcontrib.imagehelper.add_figure_directive(app, name, option_spec={})`\n Add a custom figure directive to Sphinx.\n The directive is named as `name`-figure (cf. astah-figure).\n\n If `option_spec` is given, the new directive accepts custom options.\n\n`sphinxcontrib.imagehelper.generate_image_directive(name, option_spec={})`\n Generate a custom image directive class. The class is not registered to Sphinx.\n You can enhance the directive class with subclassing.\n\n`sphinxcontrib.imagehelper.generate_figure_directive(name, option_spec={})`\n Generate a custom figure directive class. The class is not registered to Sphinx.\n You can enhance the directive class with subclassing.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tk0miya/sphinxcontrib-imagehelper", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "sphinxcontrib-imagehelper", "package_url": "https://pypi.org/project/sphinxcontrib-imagehelper/", "platform": "any", "project_url": "https://pypi.org/project/sphinxcontrib-imagehelper/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/tk0miya/sphinxcontrib-imagehelper" }, "release_url": "https://pypi.org/project/sphinxcontrib-imagehelper/1.1.1/", "requires_dist": null, "requires_python": null, "summary": "Sphinx extension helper about images", "version": "1.1.1" }, "last_serial": 1857521, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c5c74cfcb8e553c9709d89ad42c6aee7", "sha256": "303584691f2eea58eda352d03eeacba37720a201ac40161d00951aba95c374a5" }, "downloads": -1, "filename": "sphinxcontrib_imagehelper-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c5c74cfcb8e553c9709d89ad42c6aee7", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9427, "upload_time": "2015-06-13T05:21:29", "url": "https://files.pythonhosted.org/packages/d3/14/e0c956ccd1f6398506ea871e9c788e72a4bb8626daa27e627d862d5f0aa9/sphinxcontrib_imagehelper-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3d7b3c773ee811eb7807ad0ec68f660b", "sha256": "e542a4c7ebfd7c58eb418a2714e24cabd7f572082ac51f4e96534ed8adf00933" }, "downloads": -1, "filename": "sphinxcontrib-imagehelper-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3d7b3c773ee811eb7807ad0ec68f660b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6518, "upload_time": "2015-06-13T05:21:25", "url": "https://files.pythonhosted.org/packages/c8/e2/4fcf1909b06f86eed42ff874009fb945e098ea1e04e8b441914411adda44/sphinxcontrib-imagehelper-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "06a0666e47d5e0a2ceb07a05ca8bf423", "sha256": "ad6d0ad394f4fda0ad7098bc14eae2d9ef023aeeb576aab89c263caf8764f5cd" }, "downloads": -1, "filename": "sphinxcontrib_imagehelper-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "06a0666e47d5e0a2ceb07a05ca8bf423", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9236, "upload_time": "2015-06-13T09:35:34", "url": "https://files.pythonhosted.org/packages/7a/3b/e424cd14869cf79c8e5db1e9f2e0e0ef93ab02a4f1486532ca5cb86e2e4e/sphinxcontrib_imagehelper-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "149de18bcb4587f9856eba001e91ddc5", "sha256": "cbc961ba93b5be0783f0d5693530ad85f32e1742d0b67dc5b5bd64b2d9ba2b75" }, "downloads": -1, "filename": "sphinxcontrib-imagehelper-1.0.1.tar.gz", "has_sig": false, "md5_digest": "149de18bcb4587f9856eba001e91ddc5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5860, "upload_time": "2015-06-13T09:35:30", "url": "https://files.pythonhosted.org/packages/d8/02/6788f969ee1d49ab5f76575b03446180b7b6063476f09ff6cf5869258f72/sphinxcontrib-imagehelper-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "f87a49091d1dcf13d657e205b43702b6", "sha256": "ca825498a0d6156789d684c9521e4382eea8afc7603161f09984d869540baf64" }, "downloads": -1, "filename": "sphinxcontrib_imagehelper-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f87a49091d1dcf13d657e205b43702b6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9363, "upload_time": "2015-10-10T13:06:59", "url": "https://files.pythonhosted.org/packages/d4/91/f120087abcf72cd222ca5d71f18bf6e2738e3e2cdd2e50e43b2259c45001/sphinxcontrib_imagehelper-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fca31cd44ce4fbb04443585eb3d3e08", "sha256": "35d8b7f9a0baad78f7ed4929a96cbfe4a262db1a7b6f228f29ab1329b65ce2f0" }, "downloads": -1, "filename": "sphinxcontrib-imagehelper-1.1.0.tar.gz", "has_sig": false, "md5_digest": "0fca31cd44ce4fbb04443585eb3d3e08", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6492, "upload_time": "2015-10-10T13:06:55", "url": "https://files.pythonhosted.org/packages/4d/77/1d345286e5efad92121bdb33245b438145746ba78218457b7deed7055180/sphinxcontrib-imagehelper-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "5d43f675662028900d260dbe8555f508", "sha256": "3c5e8d8686470fd552dbd21ea5c39f697ad523a270a980b311af6d9c7d999bb1" }, "downloads": -1, "filename": "sphinxcontrib_imagehelper-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5d43f675662028900d260dbe8555f508", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9492, "upload_time": "2015-12-11T14:03:54", "url": "https://files.pythonhosted.org/packages/e2/c8/dd1bc9811f8723f5efc9dac24dd70d5df07c4ba94743edfb5dcf1d18211e/sphinxcontrib_imagehelper-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "96b89f265d4e2998bcc2f38a99c874ad", "sha256": "09bfea2442de2dc099677acc2abf973496af1f6fb3682c9bae039893daa5a390" }, "downloads": -1, "filename": "sphinxcontrib-imagehelper-1.1.1.tar.gz", "has_sig": false, "md5_digest": "96b89f265d4e2998bcc2f38a99c874ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6572, "upload_time": "2015-12-11T14:03:47", "url": "https://files.pythonhosted.org/packages/42/24/b1f0f42fca8e96f82e93b8558c9abbe959d5e560ffbbd1ae8745c27c58b9/sphinxcontrib-imagehelper-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5d43f675662028900d260dbe8555f508", "sha256": "3c5e8d8686470fd552dbd21ea5c39f697ad523a270a980b311af6d9c7d999bb1" }, "downloads": -1, "filename": "sphinxcontrib_imagehelper-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5d43f675662028900d260dbe8555f508", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9492, "upload_time": "2015-12-11T14:03:54", "url": "https://files.pythonhosted.org/packages/e2/c8/dd1bc9811f8723f5efc9dac24dd70d5df07c4ba94743edfb5dcf1d18211e/sphinxcontrib_imagehelper-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "96b89f265d4e2998bcc2f38a99c874ad", "sha256": "09bfea2442de2dc099677acc2abf973496af1f6fb3682c9bae039893daa5a390" }, "downloads": -1, "filename": "sphinxcontrib-imagehelper-1.1.1.tar.gz", "has_sig": false, "md5_digest": "96b89f265d4e2998bcc2f38a99c874ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6572, "upload_time": "2015-12-11T14:03:47", "url": "https://files.pythonhosted.org/packages/42/24/b1f0f42fca8e96f82e93b8558c9abbe959d5e560ffbbd1ae8745c27c58b9/sphinxcontrib-imagehelper-1.1.1.tar.gz" } ] }