Matthew Schinckel avatar Matthew Schinckel committed ffd7db7

Use pandoc to convert the README.md on the fly, else return the md content directly.

Comments (0)

Files changed (2)

README.rst

-django-menus
-============
-
-django-menus is an app that provides some useful template helpers for
-rendering and handling menus within django projects.
-
-To use in in your django project, it needs to be installed:
-
-::
-
-    $ pip install -E /path/to/your/venv django-menus
-
-And ``"menus"`` needs to be in your ``settings.INSTALLED_APPS``.
-
-menu\_item
-----------
-
-An inclusion template tag that will create a single instance of a menu
-item, which will only be rendered if the logged in user can access the
-referenced view. Secondly, the currently active view will have a CSS
-class of ``active`` in it's menu item.
-
-::
-
-    {% load menu_item %}
-
-    {% menu_item "/foo/" "Foo" %}
-    {% menu_item "/bar/" "Bar" %}
-
-If we were viewing ``/foo/``, this renders to:
-
-::
-
-    <a class="active" href="/foo/">Foo</a>
-    <a href="/bar/">Bar</a>
-
-Using the standard template. If you want, you can override the
-``menus/item.html`` template to change the display format.
-
-You may also pass in a string like ``"url:foo_name"`` to the first
-argument. This will do a ``reverse('foo_name')`` call (with no args or
-kwargs) to find a matching url.
-
-If the menu item title is ``'home'`` (case insensitive), or the url path
-is ``'/'``, then an exact match will be required to mark it as active,
-otherwise a prefix match is done. This means that if you had a menu item
-as above, and were viewing the url ``/foo/bar/``, then the first
-menu\_item would be marked as active.
-
-tree\_menu
-----------
-
-An extension to
-`django-mptt <https://github.com/django-mptt/django-mptt/>`_, this is a
-template that you can use to have a dynamic tree menu, where selecting
-items with children expands them, and selecting a leaf node follows the
-link. To use it, you'll need to have mptt installed into your project as
-well as this package.
-
-You use it like:
-
-::
-
-    {% load mptt_tags %}
-
-    {% block tree_menu %}
-      {% full_tree_for_model app_label.ModelName as menu %}
-      {% include "menu/tree-menu.html" %}
-    {% endblock %}
-
-If you want it to dynamically hide/show nested data, then you will want
-to have:
-
-::
-
-        <script src="{{ STATIC_URL }}menus/js/tree-menu.js"></script>
-        <link rel="stylesheet" href="{{ STATIC_URL }}menus/style/tree-menu.css" 
-              type="text/css" media="screen" title="no title" charset="utf-8">
-
-Somewhere in your page.
-
-This part is currently in use in one small part of a project, and may
-change if I start to use it more. This README is a little light on
-because I haven't touched this code in a long, long time.
 from distutils.core import setup
 
+def rst(filename):
+    import subprocess
+    try:
+        return subprocess.check_output(["pandoc", filename, '-t', 'rst'])
+    except OSError:
+        return open(filename).read()
+
 setup(
     name = "django-menus",
-    version = "1.0.1",
+    version = "1.0.2",
     description = "Menu helpers for django projects",
     url = "http://bitbucket.org/schinckel/django-menus/",
     author = "Matthew Schinckel",
     packages = [
         "menus",
     ],
-    long_description = open("README.rst").read(),
+    long_description = rst("README.md"),
     classifiers = [
         'Programming Language :: Python',
         'License :: OSI Approved :: BSD License',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.