{ "info": { "author": "Jakub Jirutka", "author_email": "jakub@jirutka.cz", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": "SublimeDSL\r\n==========\r\n\r\n|Build Status| |Coverage Status| |Code Climate| |version| |downloads|\r\n|documentation|\r\n\r\nThe configuration of Sublime Text uses verbose JSON files, XML files,\r\nand also horrible PList/XML files (TextMate legacy). When used in\r\nplugins, some of them (e.g. keymaps) may contain even hundreds of lines\r\nwith huge ratio of duplications. Sooner or later, it\u2019ll become quite\r\nhard to maintain such a mess.\r\n\r\nThe aim of this module is to provide simple pythonic DSL for generating\r\nparticular configuration files. Currently only `Key\r\nBindings `__\r\nare supported, but other configs may come later.\r\n\r\nYou\u2019re more than welcome to add DSL for other Sublime Text\u2019s configs!\r\n\r\nUsage\r\n-----\r\n\r\nExamples\r\n~~~~~~~~\r\n\r\n.. code:: python\r\n\r\n #!/usr/bin/env python3\r\n from sublimedsl.keymap import *\r\n\r\n Keymap(\r\n bind('backspace')\r\n .to('run_macro_file', file='res://Packages/Default/Delete Left Right.sublime-macro')\r\n .when('setting.auto_match_enabled').any().true()\r\n .also('preceding_text').regex_contains(r'_$')\r\n .also('following_text').regex_contains(r'^_'),\r\n\r\n bind('super+k', 'super+shift+up')\r\n .to('new_pane', move=False),\r\n\r\n common_context=[\r\n context('selector').equal('text.asciidoc')\r\n ],\r\n default_match_all=True\r\n\r\n ).dump()\r\n\r\nThe above code generates:\r\n\r\n.. code:: json\r\n\r\n [\r\n {\r\n \"keys\": [ \"backspace\" ],\r\n \"command\": \"run_macro_file\",\r\n \"args\": { \"file\": \"res://Packages/Default/Delete Left Right.sublime-macro\" },\r\n \"context\": [\r\n { \"key\": \"setting.auto_match_enabled\", \"operator\": \"equal\", \"operand\": true, \"match_all\": false },\r\n { \"key\": \"preceding_text\", \"operator\": \"regex_contains\", \"operand\": \"_$\", \"match_all\": true },\r\n { \"key\": \"following_text\", \"operator\": \"regex_contains\", \"operand\": \"^_\", \"match_all\": true },\r\n { \"key\": \"selector\", \"operator\": \"equal\", \"operand\": \"text.asciidoc\", \"match_all\": true }\r\n ]\r\n },\r\n {\r\n \"keys\": [ \"super+k\", \"super+shift+up\" ],\r\n \"command\": \"new_pane\",\r\n \"args\": { \"move\": false },\r\n \"context\": [\r\n { \"key\": \"selector\", \"operator\": \"equal\", \"operand\": \"text.asciidoc\", \"match_all\": true }\r\n ]\r\n }\r\n ]\r\n\r\nYou can also look at real-world example in the `Asciidoctor\r\nplugin `__:\r\n`Keymap\r\nDSL `__\r\nand `generated\r\nJSON `__.\r\n\r\nInstallation\r\n------------\r\n\r\nSystem-wide\r\n~~~~~~~~~~~\r\n\r\nInstall from PyPI system-wide:\r\n\r\n::\r\n\r\n sudo pip install sublimedsl\r\n\r\n\u2026or manually:\r\n\r\n::\r\n\r\n git clone git@github.com:jirutka/sublimedsl.git\r\n cd sublimedsl\r\n sudo ./setup.py install\r\n\r\nLocally\r\n~~~~~~~\r\n\r\nIf you don\u2019t have a root access to the system, or just don\u2019t want to\r\ninstall sublimedsl system-wide, then you can tell ``pip`` or\r\n``setup.py`` to install it into your home directory (namely\r\n``~/.local``):\r\n\r\n::\r\n\r\n pip install --user sublimedsl\r\n\r\n\u2026or manually:\r\n\r\n::\r\n\r\n git clone git@github.com:jirutka/sublimedsl.git\r\n cd sublimedsl\r\n ./setup.py --user install\r\n\r\nLicense\r\n-------\r\n\r\nThis project is licensed under `MIT\r\nlicense `__.\r\n\r\n.. |Build Status| image:: https://api.travis-ci.org/jirutka/sublimedsl.svg?branch=master\r\n :target: https://travis-ci.org/jirutka/sublimedsl\r\n.. |Coverage Status| image:: https://coveralls.io/repos/jirutka/sublimedsl/badge.svg?branch=master&service=github\r\n :target: https://coveralls.io/github/jirutka/sublimedsl?branch=master\r\n.. |Code Climate| image:: https://codeclimate.com/github/jirutka/sublimedsl/badges/gpa.svg\r\n :target: https://codeclimate.com/github/jirutka/sublimedsl\r\n.. |version| image:: https://img.shields.io/pypi/v/sublimedsl.svg?style=flat\r\n :target: https://pypi.python.org/pypi/sublimedsl\r\n.. |downloads| image:: https://img.shields.io/pypi/dm/sublimedsl.svg?style=flat\r\n :target: https://pypi.python.org/pypi/sublimedsl\r\n.. |documentation| image:: https://readthedocs.org/projects/sublimedsl/badge/?version=latest\r\n :target: http://sublimedsl.readthedocs.org/en/latest/", "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/jirutka/sublimedsl", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sublimedsl", "package_url": "https://pypi.org/project/sublimedsl/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sublimedsl/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/jirutka/sublimedsl" }, "release_url": "https://pypi.org/project/sublimedsl/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "A convenient DSL for generating SublimeText configs.", "version": "0.3.2" }, "last_serial": 1684574, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6e2e7cb6ccb029cc42f26ec0ed62aff1", "sha256": "b28eb2524b06d9e39046378e89c676ec5c6b07d03aea8b0a74e64432dfacec05" }, "downloads": -1, "filename": "sublimedsl-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6e2e7cb6ccb029cc42f26ec0ed62aff1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5728, "upload_time": "2015-08-08T00:00:29", "url": "https://files.pythonhosted.org/packages/e3/3b/deeebb7e3def604cf1a089f3572d7e285eb2d7c4e5aea21d8a316a6382c4/sublimedsl-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1a6ebbfc49aea6986f14aa9b7cf171bc", "sha256": "c30f6a9e8eefe81877b1198fb1f082884cada66fd3c1080b189de544f0d53c51" }, "downloads": -1, "filename": "sublimedsl-0.2.0.tar.gz", "has_sig": false, "md5_digest": "1a6ebbfc49aea6986f14aa9b7cf171bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5942, "upload_time": "2015-08-08T13:25:22", "url": "https://files.pythonhosted.org/packages/4c/65/5bc98717303200abc9caf595bfbdc200b055a66ef8d094e17ab3056a2ade/sublimedsl-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "a4017cd3159552b7a196d2e1df37dca1", "sha256": "186d2e676eb48aa2a80e8a5bd7e869a1725892186b53abfa2410f15d58c5e1a7" }, "downloads": -1, "filename": "sublimedsl-0.3.0.tar.gz", "has_sig": false, "md5_digest": "a4017cd3159552b7a196d2e1df37dca1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5915, "upload_time": "2015-08-08T14:46:30", "url": "https://files.pythonhosted.org/packages/52/0b/2050a0697ca589037fff6f2ece4c9b135e71e7ebafe6d73d075e79e515ba/sublimedsl-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "bb6eb8c972e08810c9666219ad61c09d", "sha256": "0751ebddcfb386a253ab740a607c8e8324466309fa9e38ccca2225ed77169e19" }, "downloads": -1, "filename": "sublimedsl-0.3.1.tar.gz", "has_sig": false, "md5_digest": "bb6eb8c972e08810c9666219ad61c09d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5955, "upload_time": "2015-08-16T21:55:53", "url": "https://files.pythonhosted.org/packages/5d/9f/82e13d709084b4a711d46d2884f52716f1fef91759c7258f0a729bc1398c/sublimedsl-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "539440cf27e097e1f1d1aefa910462fa", "sha256": "672f97ffaf4f93de73efc935459f15fd926ec65c44b020c39ce28669452d62bf" }, "downloads": -1, "filename": "sublimedsl-0.3.2.tar.gz", "has_sig": false, "md5_digest": "539440cf27e097e1f1d1aefa910462fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6576, "upload_time": "2015-08-19T19:29:53", "url": "https://files.pythonhosted.org/packages/8a/1b/1a70a36634988d61eaeb0544a1f869f780076f30d4ec402d1b496f77d4f5/sublimedsl-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "539440cf27e097e1f1d1aefa910462fa", "sha256": "672f97ffaf4f93de73efc935459f15fd926ec65c44b020c39ce28669452d62bf" }, "downloads": -1, "filename": "sublimedsl-0.3.2.tar.gz", "has_sig": false, "md5_digest": "539440cf27e097e1f1d1aefa910462fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6576, "upload_time": "2015-08-19T19:29:53", "url": "https://files.pythonhosted.org/packages/8a/1b/1a70a36634988d61eaeb0544a1f869f780076f30d4ec402d1b496f77d4f5/sublimedsl-0.3.2.tar.gz" } ] }