{ "info": { "author": "Blaise Laflamme", "author_email": "blaise@laflamme.org", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "# more.mako\n\n`more.mako` is an extension for [Morepath](http://morepath.readthedocs.io) that adds [Mako](http://makotemplates.org)\ntemplate support when you use the `.mako` extension.\n\nExample usage:\n\n```python\nfrom more.mako import MakoApp\n\nclass App(MakoApp):\n pass\n\n@App.path(path='persons/{name}')\nclass Person(object):\n def __init__(self, name):\n self.name = name\n\n@App.template_directory()\ndef get_template_directory():\n return 'templates'\n\n@App.html(model=Person, template='person.mako')\ndef person_default(self, request):\n return {'name': self.name}\n```\n\nand then in `person.mako` in the `templates` subdirectory:\n\n```html\n\n
\nHello {{name}}!
\n \n\n```\n\nYou can also render defs from templates using the special syntax\n`template#defname.mako` like the following example:\n\n```python\n@App.html(model=Root, template='defs#hello.mako')\ndef hello():\n return {'name': 'World'}\n```\n\nand then in `defs.mako`:\n\n```html\n<%def name=\"hello(name)\">\nHello ${name}!
\n%def>\n```\n\nNote that the Mako documentation uses the `.html` extension for\nMako templates, whereas this extension uses `.mako` instead.\n\nTo control Mako behavior you can define a `mako` setting section\nin your app, for instance:\n\n```python\n@App.setting_section(section='mako')\ndef get_setting_section():\n return {\n 'default_filters': ['h'],\n 'format_exceptions': True\n }\n```\n\nFor details on Mako configuration options, consult the [Mako API\ndocumentation](http://docs.makotemplates.org/en/latest/usage.html#api-reference).\n\nCHANGES\n\n0.1.0 (2016-09-08)\n------------------\n\n- Initial public release", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/morepath/more.mako", "keywords": "morepath mako", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "more.mako", "package_url": "https://pypi.org/project/more.mako/", "platform": "any", "project_url": "https://pypi.org/project/more.mako/", "project_urls": { "Homepage": "https://github.com/morepath/more.mako" }, "release_url": "https://pypi.org/project/more.mako/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Mako template bindings for Morepath", "version": "0.1.0" }, "last_serial": 2332734, "releases": { "0.1.0": [] }, "urls": [] }