{ "info": { "author": "Martin Mahner", "author_email": "martin@mahner.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": ".. warning:: django-rstify is not in active development! Please take a look at it's successor django-markup. https://github.com/bartTC/django-markup\r\n\r\n===============================================================\r\ndjango-rstify - A restructured text filter for django templates\r\n===============================================================\r\n\r\ndjango-rstify is a set of template filters to provide easy conversion from\r\n`restructured text`_ to HTML. Besides this basic functionality this application\r\nallows you to highlight sourcecode snippets inside your text using the `pygments`_\r\nlibrary.\r\n\r\n.. hint:: Django already provides a simple `restructured text filter`_. If you\r\n don't need the extras in this application, I recommend to use the *core version*.\r\n\r\nInstallation\r\n============\r\n\r\nThere are several ways to install this application:\r\n\r\n1. Checkout the latest version from my git repository::\r\n\r\n git clone git://github.com/bartTC/django-rstify.git\r\n\r\n Then either put the directory ``rstify`` into your pythonpath or\r\n switch to ``django-rstify`` and do ``python setup.py install``.\r\n\r\n2. Install this application using easy_install::\r\n\r\n easy_install django-rstify\r\n\r\nFinally, put ``rstify`` into your ``INSTALLED_APPS`` setting in your django project.\r\n\r\nHow to use it in templates\r\n==========================\r\n\r\nTo convert a restructured text from an object to HTML simply apply the ``rstify``\r\nfilter on it::\r\n\r\n {% load rstify_tags %}\r\n\r\n {{ entry.content|rstify }}\r\n\r\nIf you want to convert inline content, use the ``filter`` templatetag around::\r\n\r\n {% load rstify_tags %}\r\n\r\n {% filter rstify %}\r\n This is some *restructured text*.\r\n {% endfilter %}\r\n\r\nHow to use it in sourcecode\r\n===========================\r\n\r\nApplying this filter inside your code is easy::\r\n\r\n >>> from rstify import rstify\r\n >>>\r\n >>> print rstify('This is *restructured text*.')\r\n

This is restructured text.

\r\n\r\nInitial Header Level\r\n====================\r\n\r\nBy default the initial heading in your restructured text becomes a ``

`` in\r\nHTML::\r\n\r\n >>> header = '''\r\n ... ================\r\n ... This is a Header\r\n ... ================\r\n ... '''\r\n >>> print rstify(header)\r\n
\r\n

This is a Header

\r\n
\r\n\r\nYou can override this by setting the ``initial_header_level`` to an integer from\r\n1 to 6::\r\n\r\n >>> print rstify(header, initial_header_level=3)\r\n
\r\n

This is a Header

\r\n
\r\n\r\nIn your template just set this as the first option of the ``rstify`` filter::\r\n\r\n {{ entry.content|rstify:\"3\" }}\r\n\r\nSyntax Highlighting\r\n===================\r\n\r\ndjango-rstify provides syntax highlighting using the pygments_ library. To highlight\r\nparts of your restructured text, simply put it in a ``sourcecode`` directive::\r\n\r\n Here is some text. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\r\n Integer porttitor nulla sed dui. Aenean lorem mi, tincidunt et, porttitor\r\n nec, condimentum venenatis, felis. Maecenas ornare blandit leo.\r\n\r\n .. sourcecode:: python\r\n\r\n def foo(bar):\r\n return bar*2\r\n\r\n Continue with text. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\r\n Integer porttitor nulla sed dui. Aenean lorem mi, tincidunt et, porttitor nec,\r\n condimentum venenatis, felis. Maecenas ornare blandit leo.\r\n\r\nPygments provides a bunch of highlighters (also called *lexer*), just replace\r\n``python`` with a lexer of your choice. Here is a complete set of `available lexers`_.\r\nRead `pygments styles`_ how to colorize the output using css.\r\n\r\nLicense\r\n=======\r\n\r\nThis application is licensed under the ``New BSD License``. See ``LICENSE`` for details.\r\ndjango-rstify comes bundled with a pygments directive which is released under ``BSD License``.\r\nSee ``rstify/pygments_directive.py`` for details.\r\n\r\n.. _`restructured text`: http://docutils.sourceforge.net/rst.html\r\n.. _`restructured text filter`: http://docs.djangoproject.com/en/dev/ref/contrib/#markup\r\n.. _`pygments`: http://pygments.org/\r\n.. _`pygments styles`: http://pygments.org/docs/styles/\r\n.. _`available lexers`: http://pygments.org/docs/lexers/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://code.google.com/p/django-rstify/", "keywords": "", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "django-rstify", "package_url": "https://pypi.org/project/django-rstify/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-rstify/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://code.google.com/p/django-rstify/" }, "release_url": "https://pypi.org/project/django-rstify/0.2/", "requires_dist": null, "requires_python": null, "summary": "A set of templatetags and filters to use restructured text inside django templates.", "version": "0.2" }, "last_serial": 934136, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "5eb1d6b9426fc17bf827a2483ba89e5b", "sha256": "b4e1f19446d5f2bac4abf6571c0354ee5e7fd37adc5a81d8e4895d7509ffde10" }, "downloads": -1, "filename": "django-rstify-0.1.tar.gz", "has_sig": false, "md5_digest": "5eb1d6b9426fc17bf827a2483ba89e5b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5210, "upload_time": "2008-09-16T14:05:51", "url": "https://files.pythonhosted.org/packages/b4/e4/7f7d7bb0c7c88341c541ff2623ffc7eb106473dbf3d5bb121dabae35a0f4/django-rstify-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "95ff57daabd8486cd06a5f1d522823bd", "sha256": "8121165b9c01a19e5aa6d005b92c09d34e32a89a5bdc00cb0cca00f90bbba9f3" }, "downloads": -1, "filename": "django-rstify-0.2.tar.gz", "has_sig": false, "md5_digest": "95ff57daabd8486cd06a5f1d522823bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5214, "upload_time": "2008-09-16T14:26:00", "url": "https://files.pythonhosted.org/packages/ad/6d/b87198ebd9b89d78945a94551f43866476188c9e0b66ae39391c9abe7d6a/django-rstify-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "95ff57daabd8486cd06a5f1d522823bd", "sha256": "8121165b9c01a19e5aa6d005b92c09d34e32a89a5bdc00cb0cca00f90bbba9f3" }, "downloads": -1, "filename": "django-rstify-0.2.tar.gz", "has_sig": false, "md5_digest": "95ff57daabd8486cd06a5f1d522823bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5214, "upload_time": "2008-09-16T14:26:00", "url": "https://files.pythonhosted.org/packages/ad/6d/b87198ebd9b89d78945a94551f43866476188c9e0b66ae39391c9abe7d6a/django-rstify-0.2.tar.gz" } ] }