{ "info": { "author": "Hing-Lung Lau", "author_email": "lung220@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Code Generators", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: HTML" ], "description": "HtmlNode - Python HTML Generator\n=====================================\n\n.. image:: https://travis-ci.org/hllau/html_node.png\n :alt: HtmlNode\n :target: https://travis-ci.org/hllau/html_node\n\n**HtmlNode** is an internal Domain Specific Language (DSL) using Python to generate HTML templates. \nIt is designed to be really easy and flexible to use. By using DSL instead of a specific\ntemplating language, you can write Python code to render HTML directly, so you can debug\nyour presentation logics easily. Also, you get the full power of Python in writing \npresentation logic, without the hassle to learn another templating language.\n\nAn overview for using internal DSL vs external template languages can be found \n`here `_.\n\n\nInstallation\n------------\n\n**Automatic installation**::\n\n pip install HtmlNode\n\nHtmlNode is listed in `PyPI `_ and\ncan be installed with ``pip`` or ``easy_install``.\n\n**Manual installation**: Download the latest source from `PyPI\n`_.\n\n.. parsed-literal::\n\n tar xvzf HtmlNode-$VERSION.tar.gz\n cd HtmlNode-$VERSION\n sudo python setup.py install\n\nThe HtmlNode source code is `hosted on GitHub\n`_.\n\n**Prerequisites**: HtmlNode only runs on Python 2.7 currently.\n\n\nFeatures\n--------\n\n* Very simple syntax and natural way to generate HTML\n* Unicode support\n* Auto-escape dangerous characters\n* Template inheritance support\n* Context variables insertion into templates\n* Auto-completion support for IDEs which can introspect\n* Custom HTML elements can be created on the fly\n* Flexible ways to include attributes for HTML element\n\n\nUsage Example\n-------------\n\n**Example 1 - Simple HTML:**\n\nCode snippet::\n\n from html_node import html_node as h\n \n template = h.div(class_='container')(\n h.span('Hello World!', style='color: pink; font-weight: bold;')\n )\n print template\n\n\nOutput::\n\n
\n \n Hello World!\n \n
\n\n*By default, the actual output is concatenated without space or line feeds.*\n\n\n**Example 2 - Simple reusable layout (with inheritance and placeholders)**\n\nYou can use `placeholder` to mark different block section to replace with. You give the\nplaceholder a name, and provide a method with the same name that returns a unicode string.\nYou can inherit the layout just like how you normally do in Python.\n\nCode snippet::\n\n from html_node import html_node as h, BaseTemplate, placeholder\n \n\n class MyLayout(BaseTemplate):\n \"\"\"My customized layout which other templates can inherit from.\"\"\"\n\n title = 'HtmlNode'\n \n def template(self):\n return h.html5(placeholder('head'), placeholder('body'))\n \n @placeholder\n def head(self):\n return h.head(\n h.title(self.title),\n h.link(rel=\"stylesheet\", type=\"text/css\", href=\"default.css\"),\n )\n \n @placeholder\n def body(self):\n return h.body(\n h.div(class_=['container', 'expand'])(\n placeholder('content')\n )\n )\n\n @placeholder\n def content(self):\n raise NotImplementedError\n\n\n class MyViewTemplate(MyLayout):\n \"\"\"This template will provide the content block for the layout.\"\"\"\n\n @placeholder\n def content(self):\n return u'HtmlNode is a flexible and easy-to-use HTML generator!'\n\n\n template = MyViewTemplate()\n print template\n\n\nOutput::\n\n \n \n \n HtmlNode\n \n \n \n
\n HtmlNode is a flexible and easy-to-use HTML generator!\n
\n \n \n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/hllau/html_node", "keywords": "html builder factory template generator", "license": "Apache v2", "maintainer": null, "maintainer_email": null, "name": "HtmlNode", "package_url": "https://pypi.org/project/HtmlNode/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/HtmlNode/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/hllau/html_node" }, "release_url": "https://pypi.org/project/HtmlNode/0.1.8/", "requires_dist": null, "requires_python": null, "summary": "A simple Python HTML generator", "version": "0.1.8" }, "last_serial": 904182, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "f97a34c0623eccb06b0fe9c9181ec010", "sha256": "667c806a636725d183bb828acc8a4235408f6a3951520789d2bdab8e505eca29" }, "downloads": -1, "filename": "HtmlNode-0.1.tar.gz", "has_sig": false, "md5_digest": "f97a34c0623eccb06b0fe9c9181ec010", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7368, "upload_time": "2013-10-25T18:32:19", "url": "https://files.pythonhosted.org/packages/12/9e/97ae8a9585375096ef74203d81768032c6226f303851b998cab7f23acd6e/HtmlNode-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f081bd55540faf7d7497d2474bda2a59", "sha256": "c01e6a39bdbeb278bf64bc584af7566e4e2985ccc73a5dd66f85800ed299251f" }, "downloads": -1, "filename": "HtmlNode-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f081bd55540faf7d7497d2474bda2a59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7385, "upload_time": "2013-10-25T18:33:49", "url": "https://files.pythonhosted.org/packages/4e/25/d93a9826defd9c35daf9654b6035d22826c70faf58f69c869ca35670fb0a/HtmlNode-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "79458104df815be40b7d60c068e9a8b0", "sha256": "79addd43a3ce9e2c3ba3ff79eeb25118df84948bc59f4eab987606ca8f21f45f" }, "downloads": -1, "filename": "HtmlNode-0.1.2.tar.gz", "has_sig": false, "md5_digest": "79458104df815be40b7d60c068e9a8b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7404, "upload_time": "2013-10-25T18:39:09", "url": "https://files.pythonhosted.org/packages/2a/23/21027e9d35098104cdeef9909ccf56d9f923604cbf9700d4d1ac1fce5a2a/HtmlNode-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "079bd978aa409cedb3d8207188c0e474", "sha256": "81acafb7672ee69e206016a88e6273d01106e56fddd013535b466d44e42060aa" }, "downloads": -1, "filename": "HtmlNode-0.1.3.tar.gz", "has_sig": false, "md5_digest": "079bd978aa409cedb3d8207188c0e474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7563, "upload_time": "2013-10-26T05:01:12", "url": "https://files.pythonhosted.org/packages/fc/47/037a7a9c2d75111cbb8039d4b021b29f7277f5fe7e008220701500c0bd85/HtmlNode-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "fb733bd42dfdf314c14617445444a1ac", "sha256": "689378de331f5dce0c4521dfa90ed0f136c36cceff89c656b9eac4018e392860" }, "downloads": -1, "filename": "HtmlNode-0.1.4.tar.gz", "has_sig": false, "md5_digest": "fb733bd42dfdf314c14617445444a1ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7817, "upload_time": "2013-10-26T05:25:09", "url": "https://files.pythonhosted.org/packages/84/3b/fce2d76cb5bd120b5875fab83d9667f4f8bb1fa75163fb11b59b55ccecbc/HtmlNode-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "ba2c130b6807210dfc7938f8566395a8", "sha256": "8276b4d6f5ac51c7805e53fe996f1b00ecadc4a399acf65eedd559fc6fdc6211" }, "downloads": -1, "filename": "HtmlNode-0.1.5.tar.gz", "has_sig": false, "md5_digest": "ba2c130b6807210dfc7938f8566395a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7814, "upload_time": "2013-10-26T05:28:56", "url": "https://files.pythonhosted.org/packages/14/7b/a3d698d5154fddd9bba22576e01a7c14e858ae7f1409d963321ae7ab2798/HtmlNode-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "0b1fd245ff015ddd015dc32fe9d2e358", "sha256": "7a7d328cc2cb31d34414835e31054940fc78064c4d6f3a5ca8247e3776b3a10b" }, "downloads": -1, "filename": "HtmlNode-0.1.6.tar.gz", "has_sig": false, "md5_digest": "0b1fd245ff015ddd015dc32fe9d2e358", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8082, "upload_time": "2013-10-26T06:36:12", "url": "https://files.pythonhosted.org/packages/46/ad/b1ef8c527114bec5535eadf1ce0ee6de30cb79db67c23be1f18b5abb59d9/HtmlNode-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "99dca32be54d68103e67ffa0f50ef38c", "sha256": "92823536b743a9300d91e255d024f691f1527146614fef44f73fb42a1eaf28ec" }, "downloads": -1, "filename": "HtmlNode-0.1.7.tar.gz", "has_sig": false, "md5_digest": "99dca32be54d68103e67ffa0f50ef38c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8081, "upload_time": "2013-10-26T06:57:49", "url": "https://files.pythonhosted.org/packages/bb/14/58d725c2cf6925ccc9cb65491c4147a7f3e0debb6766e5cb8cb95ec0032e/HtmlNode-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "164144d0fbda040486fdb04789aa2af6", "sha256": "190b90c362a247a35f7e50318fe5beb644ab376a4bf6ea7d0e2317c55f6f0a69" }, "downloads": -1, "filename": "HtmlNode-0.1.8.tar.gz", "has_sig": false, "md5_digest": "164144d0fbda040486fdb04789aa2af6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8082, "upload_time": "2013-10-27T07:43:21", "url": "https://files.pythonhosted.org/packages/bd/ec/c20615c0780ebd49823852f6a00f66699c30ceb112df1e8d80bad1bfd18c/HtmlNode-0.1.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "164144d0fbda040486fdb04789aa2af6", "sha256": "190b90c362a247a35f7e50318fe5beb644ab376a4bf6ea7d0e2317c55f6f0a69" }, "downloads": -1, "filename": "HtmlNode-0.1.8.tar.gz", "has_sig": false, "md5_digest": "164144d0fbda040486fdb04789aa2af6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8082, "upload_time": "2013-10-27T07:43:21", "url": "https://files.pythonhosted.org/packages/bd/ec/c20615c0780ebd49823852f6a00f66699c30ceb112df1e8d80bad1bfd18c/HtmlNode-0.1.8.tar.gz" } ] }