{ "info": { "author": "Concentric Sky", "author_email": "code@concentricsky.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Framework :: Django", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Topic :: Text Processing :: Markup :: HTML" ], "description": "Description\n===========\n\nBreakdown is a lightweight python webserver that parses jinja2 templates. It's intended to be used by designers for doing rapid prototyping.\n\n\nBasic Usage\n===========\n\nBreakdown needs a ``templates`` directory and a ``static`` directory to serve from. If your working directory contains these, you can simply run breakdown with no arguments::\n\n $ breakdown\n\nOr, you can specify the path to a directory containing ``templates`` and ``static``::\n\n $ breakdown /path/to/project\n\nBreakdown will also work with a django project structure. If the project path contains an ``apps`` directory, breakdown will automatically detect this and combine the ``static`` and ``templates`` directories for each django app. You'll also get a listing of the directories it found. Here's the output of running breakdown on a django project with two apps: 'mainsite' and 'blog'::\n\n $ breakdown ~/django/myproject\n Serving templates from:\n /Users/josh/django/myproject/apps/blog/templates\n /Users/josh/django/myproject/apps/mainsite/templates\n\n Serving static data from:\n /Users/josh/django/myproject/apps/blog/static\n /Users/josh/django/myproject/apps/mainsite/static\n\nTemplate Context Objects\n------------------------\n\nYou can define values for template variables by supplying a json dictionary for each page.\n\nWhen loading a template, breakdown will attempt to load a json dictionary of the same name from the context directory (``context`` by default) and add it to the page context. For example, when loading ``blog/article_detail.html`` breakdown will look for ``/context/blog/article_detail.json``. \n\nFor all pages, breakdown also attempts to load ``/context/base.json``. Any values defined here will be available on all pages, and will be overridden by any of the same name defined in individual page context objects.\n\nFor example, if we define ``base.json`` like this::\n\n {\n \"request\": {\n \"user\": {\n \"name\":\"Austin\",\n \"member\": \"Member #4812\"\n }\n },\n \"object\": {\n \"id\": 555,\n \"title\": \"Excellent Blog Post\"\n }\n }\n\nthen ``request`` and ``object`` become available to all templates, and ``{{request.user.name}}`` yields ``Austin``.\n\nYou can specify a function by adding a key with trailing parentheses::\n\n {\n \"request\": {\n \"user\": {\n \"name\":\"Austin\",\n \"is_authenticated()\": true,\n \"birth_year()\": 1982,\n \"middle_name()\": \"David\",\n \"member\": \"Member #4812\"\n }\n }\n }\n\nThe trailing parentheses are removed, and now ``{{request.user.is_authenticated()}}`` returns ``True``. Functions defined in this way ignore any arguments and return the value specified in the json dictionary. ``{{request.user.is_authenticated(arg1, arg2, arg3)}}`` also returns ``True``. However, these functions cannot be used without parentheses and ``{{request.user.is_authenticated}}`` prints something like ``at 0x101f32f50>``.\n\nIf you define a ``__unicode__`` or ``__unicode__()`` key, its value will be used when referencing its enclosing object directly. With a context object such as either::\n\n {\n \"request\": {\n \"user\": {\n \"name\":\"Austin\",\n \"__unicode__\": \"User named Austin\"\n }\n }\n }\n\nor::\n\n {\n \"request\": {\n \"user\": {\n \"name\":\"Austin\",\n \"__unicode__()\": \"User named Austin\"\n }\n }\n }\n\nreferencing ``{{request.user}}`` will yield ``User named Austin``.\n\nBreakdown does not support full context object inheritance, but top-level values defined for individual pages override those defined in ``base.json``. If you define ``/context/blog/article_detail.json`` like this::\n\n {\n \"blog\": {\n \"title\": \"Skiing Blog\"\n },\n \"request\": {\n \"user\": {\n \"name\": \"Josh\"\n }\n }\n }\n\nthen in ``/blog/article_detail.html`` a reference to ``{{request.user.name}}`` will print ``Josh``, ``{{request.user.birth_year}}`` is blank, and ``{{request.user}}`` yields ``{u'name': u'Josh'}``.\n\n\nViewing Templates\n-----------------\n\nOnce breakdown is running, it will print the local URL the webserver is listening on::\n\n Server running at http://127.0.0.1:5000 ...\n\nYou can now view templates in your browser by navigating to http://127.0.0.1:5000. However, you won't see anything here unless one of your template directories contains a file named ``index.html``. The URL of any template (besides ``index.html``) will be identical to its filename, with all relative paths preserved. Below is an example of template filenames and their corresponding URL on the local server:\n\n==================== ====================================\n**Template** **URL**\n-------------------- ------------------------------------\nindex.html http://127.0.0.1:5000/\narticle.html http://127.0.0.1:5000/article\nblog/index.html http://127.0.0.1:5000/blog\nblog/post.html http://127.0.0.1:5000/blog/post\n==================== ====================================\n\n*Note: The server will accept template URLs with or without .html appended to them*\n\nAdditional Features\n===================\n\nTemplate tags\n-------------\n\nFor convenience, A few template functions have been added to the `jinja2 template API `_:\n\n################\n{{ greeking() }}\n################\n\nGenerates a block of randomized lorem ipsum text marked-up with various HTML elements: ````, ````, ````, ````, ``
    ``, and ``
      ``.\n\n##########################\n{{ image(width, height) }}\n##########################\n\nIf you have `PIL `_ installed, you can use this function to generate an ```` tag with a sample image of the specified size (without PIL, the width/height are ignored and you get a large sample image)\n\n#############################\n{{ url(\\*args, \\*\\*kwargs) }}\n#############################\n\nIgnores all arguments and returns ``'#'``.\n\nCleverCSS\n---------\n\nBreakdown also supports automatic `CleverCSS `_ parsing. If the file ``foo.css`` is requested and not found, breakdown will then look for a matching ``foo.clevercss`` and compile it to vanilla css on the fly.\n\nExport mode\n-----------\n\nBreakdown can run in an alternate *export* mode which dumps all of the rendered templates to a directory that you specify. It also collects all of your static files (similar to djangos ``collectstatic`` command) to a **static/** directory. This mode can be enabled with ``-e`` and a path to export to; e.g.: ``breakdown -e output``\n\n**NOTE**: If you want to be able to browse the exported content from the file system directly, you should make sure that your links to other templates end with '.html'\n\n \nAdvanced\n========\n\n**Command line options**:\n -h, --help show this help message and exit\n -p PORT, --port=PORT run server on an alternate port (default is 5000)\n -m, --media treat MEDIA_URL as STATIC_URL in templates\n -s, --static-url override STATIC_URL (default is /static/)\n -v, --version display the version number and exit\n -c DIR, --context_dir_name=DIR set the directory name for context object files (default is ``context``)\n -e DIR, --export=DIR export HTML to directory instead of running server", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "breakdown", "package_url": "https://pypi.org/project/breakdown/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/breakdown/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/breakdown/1.0.9/", "requires_dist": null, "requires_python": null, "summary": "Lightweight jinja2 template prototyping server", "version": "1.0.9" }, "last_serial": 787040, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9589587652117918e8db656d4fdc9a21", "sha256": "69a24236dc4746a4776df9d97cb33e71c5ad09ad2457504aa5a77f0a76091b20" }, "downloads": -1, "filename": "breakdown-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9589587652117918e8db656d4fdc9a21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6157, "upload_time": "2012-01-06T21:53:40", "url": "https://files.pythonhosted.org/packages/6c/88/2d68b69d12fcbc727b50d3de17993419fd0fd89d44099145e2509263a5c6/breakdown-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "b0139ed27d48de094d96380d457cc66a", "sha256": "8daf2af70b8b37d3eb7d9fe3b2f4ac56810b9d88cdebab46c24f86f99d934a38" }, "downloads": -1, "filename": "breakdown-1.0.1.tar.gz", "has_sig": false, "md5_digest": "b0139ed27d48de094d96380d457cc66a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6348, "upload_time": "2012-01-06T23:01:09", "url": "https://files.pythonhosted.org/packages/e8/3f/22c62b06bf07ff6d6f6543805dacc8cebfa14d03eb182e2e50baf7ec1022/breakdown-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "980bdd3480bce3cb331b37f7c8a8b3a3", "sha256": "9d46eb49a7f646a980fde9dcbf1367005965d7d05bc979179c59d8d56ff0c405" }, "downloads": -1, "filename": "breakdown-1.0.2.tar.gz", "has_sig": false, "md5_digest": "980bdd3480bce3cb331b37f7c8a8b3a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6973, "upload_time": "2012-02-03T02:19:19", "url": "https://files.pythonhosted.org/packages/91/90/0554d6dda6806c7f57b152b00b9c177683dce62db55e85feebf4e1516d83/breakdown-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "04c99bcefab27afdaa25f1442bb12d20", "sha256": "5114d7510037d134479b3305d9e3684f78902b17b00bfb237428dc0c9a17af05" }, "downloads": -1, "filename": "breakdown-1.0.3.tar.gz", "has_sig": false, "md5_digest": "04c99bcefab27afdaa25f1442bb12d20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7619, "upload_time": "2012-02-15T19:09:49", "url": "https://files.pythonhosted.org/packages/86/69/1671b3a938f07a7ccb527dc7b434900f103e7b404d178abd35cd8bbb78c9/breakdown-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "297a0700b01e7090a2e1d5409aa2ac83", "sha256": "6ea98e3d007129d7f77e722a14bab10c459732cdc55096268cb6e50813e54db1" }, "downloads": -1, "filename": "breakdown-1.0.4.tar.gz", "has_sig": false, "md5_digest": "297a0700b01e7090a2e1d5409aa2ac83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8013, "upload_time": "2012-02-15T22:23:00", "url": "https://files.pythonhosted.org/packages/57/c9/70d36d6047eb759ff8f9df07c9ddba8e788a9d3d0214365d1a21941b66ce/breakdown-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "52e24b934d84a7cd1f047f6a021b115c", "sha256": "82cedac01a515689adb2530a35da19b1db6820866001f903c48f41c8c1f706fd" }, "downloads": -1, "filename": "breakdown-1.0.5.tar.gz", "has_sig": false, "md5_digest": "52e24b934d84a7cd1f047f6a021b115c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8107, "upload_time": "2012-02-22T20:40:13", "url": "https://files.pythonhosted.org/packages/2d/f1/9bbc9925e482ef656cf25f897da181e60c30df9d1893c49182094092b95e/breakdown-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "cc35bfc560311a2ffdc7b23742ca8b52", "sha256": "7ed104d70fc98ed2ed67649156006f99120cb261feb872c3a4c3e30d4cb22235" }, "downloads": -1, "filename": "breakdown-1.0.6.tar.gz", "has_sig": false, "md5_digest": "cc35bfc560311a2ffdc7b23742ca8b52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8867, "upload_time": "2012-05-09T21:33:32", "url": "https://files.pythonhosted.org/packages/67/5e/865edd3436b49d40213fa7c0f886e2071afc3e67d2b7791e548cf05b16e0/breakdown-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "c2bfd1ab113360bc95ad0991179f731b", "sha256": "bdb2be7770e7b528dc415ae6006a607a5bd71c742f5a2a5fd886fd551377f458" }, "downloads": -1, "filename": "breakdown-1.0.7.tar.gz", "has_sig": false, "md5_digest": "c2bfd1ab113360bc95ad0991179f731b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13150, "upload_time": "2012-10-31T18:49:06", "url": "https://files.pythonhosted.org/packages/94/1c/d95839ac88141405f65d1ed512e1a2ec3825731b9d1c89b13794de27b1ec/breakdown-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "c2123092b62b1f465e94776b1f28cb6e", "sha256": "fe57a94d98c6c94b6bbfbcf67b90e9ddf3c40756831eabbaf8fe96b4691f0045" }, "downloads": -1, "filename": "breakdown-1.0.8.tar.gz", "has_sig": false, "md5_digest": "c2123092b62b1f465e94776b1f28cb6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13385, "upload_time": "2013-01-18T00:04:13", "url": "https://files.pythonhosted.org/packages/ae/c0/dcb1d4a59b1acf368b2bc8b753be8a547cb07697e60c06b65c948b7936d2/breakdown-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "27a2d04fb5de2203834f32555efc24b1", "sha256": "088f4ef6faf97055fdc6a9601615dbc49fbf0b315249063058322aeb3a31dc65" }, "downloads": -1, "filename": "breakdown-1.0.9.tar.gz", "has_sig": false, "md5_digest": "27a2d04fb5de2203834f32555efc24b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13527, "upload_time": "2013-02-05T00:35:34", "url": "https://files.pythonhosted.org/packages/3e/99/444fc512b4317a5d49c9e87740325005be4c27e0e8321f53364a8df54d43/breakdown-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "27a2d04fb5de2203834f32555efc24b1", "sha256": "088f4ef6faf97055fdc6a9601615dbc49fbf0b315249063058322aeb3a31dc65" }, "downloads": -1, "filename": "breakdown-1.0.9.tar.gz", "has_sig": false, "md5_digest": "27a2d04fb5de2203834f32555efc24b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13527, "upload_time": "2013-02-05T00:35:34", "url": "https://files.pythonhosted.org/packages/3e/99/444fc512b4317a5d49c9e87740325005be4c27e0e8321f53364a8df54d43/breakdown-1.0.9.tar.gz" } ] }