From fd91ae069dfd2dc4493874dc8662f81725e4d5f5 Mon Sep 17 00:00:00 2001 From: juandgc Date: Thu, 20 Apr 2017 22:09:15 -0500 Subject: [PATCH 1/3] changed README from md to rst --- README.md | 208 ---------------------------------------------------- README.rst | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 211 insertions(+), 208 deletions(-) delete mode 100755 README.md create mode 100644 README.rst diff --git a/README.md b/README.md deleted file mode 100755 index 0a78d9f..0000000 --- a/README.md +++ /dev/null @@ -1,208 +0,0 @@ -# Django Menu Generator -> A menu generating application for Django - -[![status-image]][status-link] -[![version-image]][version-link] -[![coverage-image]][coverage-link] - -A productivity tool that enables the generation of full featured menus through python dictionaries list, you only need to setup the HTML structure once for each menu you like to build and then use the dictionaries to generate menu items - -## Features: - -- Tested support to Python 2.7, 3.4, 3.5, 3.6 -- Tested support to Django 1.8.18, 1.9.13, 1.10.7, 1.11 -- No database -- Support unlimited menus -- Icons support -- Semi-Automatically identifies the selected item and his breadcrums -- Conditional menu items display through validators (Permissions, Authentications or whatever you want) - -## Installation: - -You can install it with one of these options: -- easy_install django-menu-generator -- pip install django-menu-generator -- git clone http://github.com/un33k/django-menu-generator - 1. cd django-menu-generator - 2. run python setup.py -- wget https://github.com/un33k/django-menu-generator/zipball/master - 1. unzip the downloaded file - 2. cd into django-menu-generator-* directory - 3. run python setup.py - -## Usage: - -1. Install 'django-menu-generator' as per the above instructions. -2. Add 'menu_generator' to your INSTALLED_APPS. -3. Add {% load menu_generator %} to templates that will handle the menus. - -```python -#################################################################################### -Example: settings.py -#################################################################################### - -NAV_MENU_LEFT = [ - { - "name": "Home", - "url": "/", - }, - { - "name": "About", - "url": "/about", - }, -] - -NAV_MENU_RIGHT = [ - { - "name": "Login", - "url": "login_url_view", # reversible - "validators": ["menu_generator.validators.is_anonymous"], - }, - { - "name": "Register", - "url": "register_view_url", # reversible - "validators": ["menu_generator.validators.is_anonymous"], - }, - { - "name": "Account", - "url": "/acount", - "validators": ["menu_generator.validators.is_authenticated"], - "submenu": [ - { - "name": "Profile", - "url": "/account/profile", - }, - { - "name": "Account Balance", - "url": "/account/balance", - "validators": ["myapp.profiles.is_paid_user"], - }, - { - "name": "Account Secrets", - "url": "/account/secrets", - "validators": ["menu_generator.validators.is_superuser"], - } - ], - }, -] - -FOOTER_MENU_LEFT = [ - { - "name": "Facebook", - "url": "facebook.com/foobar", - }, - { - "name": "Contact US", - "url": "/contact", - }, -] - -FOOTER_MENU_RIGHT = [ - { - "name": "Address", - "url": "/address", - }, -] -``` - -You can build the menu dictionaries list inside the project apps with ``menus.py`` files, see the docs for more. - -Then in your template, load the template tag to generate your menu. - - ```html - - {% load menu_generator %} - - - - Django Menu Generator - - - {% get_menu "NAV_MENU_LEFT" as left_menu %} -
- {% for item in left_menu %} -
  • - {{ item.name }} -
  • - {% if item.submenu %} - - {% endif %} - {% endfor %} -
    - - {% get_menu "NAV_MENU_RIGHT" as right_menu %} -
    - {% for item in right_menu %} -
  • - {{ item.name }} -
  • - {% if item.submenu %} - - {% endif %} - {% endfor %} -
    - - - - {% get_menu "FOOTER_MENU_LEFT" as left_footer_menu %} -
    - -
    - - {% get_menu "FOOTER_MENU_RIGHT" as right_footer_menu %} -
    - -
    - - - - ``` - -## Running the tests: - -To run the tests against the current environment: - - python manage.py test - - -## License: - -Released under a ([MIT](LICENSE)) license. - -## Author and mantainers: - -[Milton Lenis](https://github.com/MiltonLn) - miltonln04@gmail.com - -## Credits: - -I'd like to thank [Val Kneeman][valkneeman-link], the original author of this project under the name 'menuware' -https://github.com/un33k/django-menuware - - - -[status-image]: https://travis-ci.org/RADYConsultores/django-menu-generator.svg?branch=master -[status-link]: https://travis-ci.org/RADYConsultores/django-menu-generator?branch=master - -[version-image]: https://img.shields.io/pypi/v/django-menu-generator.svg -[version-link]: https://pypi.python.org/pypi/django-menu-generator - -[coverage-image]: https://coveralls.io/repos/github/RADYConsultores/django-menu-generator/badge.svg?branch=master -[coverage-link]: https://coveralls.io/github/RADYConsultores/django-menu-generator?branch=master - -[download-image]: https://img.shields.io/pypi/dm/django-menu-generator.svg -[download-link]: https://pypi.python.org/pypi/django-menu-generator - -[valkneeman-link]: https://github.com/un33k - diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..3e7b912 --- /dev/null +++ b/README.rst @@ -0,0 +1,211 @@ +Django Menu Generator +===================== + + A menu generating application for Django + +|status-image| |version-image| |coverage-image| + +A productivity tool that enables the generation of full featured menus +through python dictionaries list, you only need to setup the HTML +structure once for each menu you like to build and then use the +dictionaries to generate menu items + +Features: +--------- + +- Tested support to Python 2.7, 3.4, 3.5, 3.6 +- Tested support to Django 1.8.18, 1.9.13, 1.10.7, 1.11 +- No database +- Support unlimited menus +- Icons support +- Semi-Automatically identifies the selected item and his breadcrums +- Conditional menu items display through validators (Permissions, + Authentications or whatever you want) + +Installation: +------------- + +You can install it with one of these options: - easy\_install +django-menu-generator - pip install django-menu-generator - git clone +http://github.com/un33k/django-menu-generator 1. cd +django-menu-generator 2. run python setup.py - wget +https://github.com/un33k/django-menu-generator/zipball/master 1. unzip +the downloaded file 2. cd into django-menu-generator-\* directory 3. run +python setup.py + +Usage: +------ + +1. Install 'django-menu-generator' as per the above instructions. +2. Add 'menu\_generator' to your INSTALLED\_APPS. +3. Add {% load menu\_generator %} to templates that will handle the + menus. + +.. code:: python + + #################################################################################### + Example: settings.py + #################################################################################### + + NAV_MENU_LEFT = [ + { + "name": "Home", + "url": "/", + }, + { + "name": "About", + "url": "/about", + }, + ] + + NAV_MENU_RIGHT = [ + { + "name": "Login", + "url": "login_url_view", # reversible + "validators": ["menu_generator.validators.is_anonymous"], + }, + { + "name": "Register", + "url": "register_view_url", # reversible + "validators": ["menu_generator.validators.is_anonymous"], + }, + { + "name": "Account", + "url": "/acount", + "validators": ["menu_generator.validators.is_authenticated"], + "submenu": [ + { + "name": "Profile", + "url": "/account/profile", + }, + { + "name": "Account Balance", + "url": "/account/balance", + "validators": ["myapp.profiles.is_paid_user"], + }, + { + "name": "Account Secrets", + "url": "/account/secrets", + "validators": ["menu_generator.validators.is_superuser"], + } + ], + }, + ] + + FOOTER_MENU_LEFT = [ + { + "name": "Facebook", + "url": "facebook.com/foobar", + }, + { + "name": "Contact US", + "url": "/contact", + }, + ] + + FOOTER_MENU_RIGHT = [ + { + "name": "Address", + "url": "/address", + }, + ] + +You can build the menu dictionaries list inside the project apps with +``menus.py`` files, see the docs for more. + +Then in your template, load the template tag to generate your menu. + +\`\`\`html {% load menu\_generator %} + +:: + + + + Django Menu Generator + + + {% get_menu "NAV_MENU_LEFT" as left_menu %} +
    + {% for item in left_menu %} +
  • + {{ item.name }} +
  • + {% if item.submenu %} + + {% endif %} + {% endfor %} +
    + + {% get_menu "NAV_MENU_RIGHT" as right_menu %} +
    + {% for item in right_menu %} +
  • + {{ item.name }} +
  • + {% if item.submenu %} + + {% endif %} + {% endfor %} +
    + + + + {% get_menu "FOOTER_MENU_LEFT" as left_footer_menu %} +
    + +
    + + {% get_menu "FOOTER_MENU_RIGHT" as right_footer_menu %} +
    + +
    + + + + +\`\`\` + +Running the tests: +------------------ + +To run the tests against the current environment: + +:: + + python manage.py test + +License: +-------- + +Released under a (`MIT `__) license. + +Author and mantainers: +---------------------- + +`Milton Lenis `__ - miltonln04@gmail.com + +Credits: +-------- + +I'd like to thank `Val Kneeman `__, the +original author of this project under the name 'menuware' +https://github.com/un33k/django-menuware + +.. |status-image| image:: https://travis-ci.org/RADYConsultores/django-menu-generator.svg?branch=master + :target: https://travis-ci.org/RADYConsultores/django-menu-generator?branch=master +.. |version-image| image:: https://img.shields.io/pypi/v/django-menu-generator.svg + :target: https://pypi.python.org/pypi/django-menu-generator +.. |coverage-image| image:: https://coveralls.io/repos/github/RADYConsultores/django-menu-generator/badge.svg?branch=master + :target: https://coveralls.io/github/RADYConsultores/django-menu-generator?branch=master From ba25d4ca178df7d17956d67a4294d14eec7ecf10 Mon Sep 17 00:00:00 2001 From: juandgc Date: Thu, 20 Apr 2017 22:25:34 -0500 Subject: [PATCH 2/3] Add author to Readme and add flake8 to travis ci --- .travis.yml | 4 ++++ README.rst | 6 ++++-- setup.cfg | 2 ++ setup.py | 1 - 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 setup.cfg diff --git a/.travis.yml b/.travis.yml index e9ae8e0..0ae1a37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,12 @@ env: install: - pip install -r requirements.txt + - pip install flake8 - pip install coveralls +before_script: + flake8 . + script: coverage run --source=menu_generator manage.py test after_success: diff --git a/README.rst b/README.rst index 3e7b912..d3586d7 100644 --- a/README.rst +++ b/README.rst @@ -27,9 +27,9 @@ Installation: You can install it with one of these options: - easy\_install django-menu-generator - pip install django-menu-generator - git clone -http://github.com/un33k/django-menu-generator 1. cd +https://github.com/RADYConsultores/django-menu-generator 1. cd django-menu-generator 2. run python setup.py - wget -https://github.com/un33k/django-menu-generator/zipball/master 1. unzip +https://github.com/RADYConsultores/django-menu-generator/zipball/master 1. unzip the downloaded file 2. cd into django-menu-generator-\* directory 3. run python setup.py @@ -196,6 +196,8 @@ Author and mantainers: `Milton Lenis `__ - miltonln04@gmail.com +`Juan Diego GarcĂ­a `__ - juandgoc@gmail.com + Credits: -------- diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..f1f2406 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 122 \ No newline at end of file diff --git a/setup.py b/setup.py index 6e1b6db..feea2cc 100755 --- a/setup.py +++ b/setup.py @@ -89,5 +89,4 @@ def get_package_data(package): package_data=get_package_data(package), install_requires=install_requires, classifiers=classifiers, - ) From 20550db49958421106ef6adfc74500593ab6f486 Mon Sep 17 00:00:00 2001 From: yamijuan Date: Thu, 20 Apr 2017 22:48:32 -0500 Subject: [PATCH 3/3] fix readme --- README.rst | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index d3586d7..72a66b0 100644 --- a/README.rst +++ b/README.rst @@ -25,13 +25,20 @@ Features: Installation: ------------- -You can install it with one of these options: - easy\_install -django-menu-generator - pip install django-menu-generator - git clone -https://github.com/RADYConsultores/django-menu-generator 1. cd -django-menu-generator 2. run python setup.py - wget -https://github.com/RADYConsultores/django-menu-generator/zipball/master 1. unzip -the downloaded file 2. cd into django-menu-generator-\* directory 3. run -python setup.py +You can install it with one of these options: + +- easy\_install django-menu-generator +- pip install django-menu-generator +- git clone https://github.com/RADYConsultores/django-menu-generator + + 1. cd django-menu-generator + 2. run python setup.py + +- wget https://github.com/RADYConsultores/django-menu-generator/zipball/master + + 1. unzip the downloaded file + 2. cd into django-menu-generator-\* directory + 3. run python setup.py Usage: ------ @@ -115,7 +122,8 @@ You can build the menu dictionaries list inside the project apps with Then in your template, load the template tag to generate your menu. -\`\`\`html {% load menu\_generator %} + +{% load menu\_generator %} :: @@ -175,7 +183,7 @@ Then in your template, load the template tag to generate your menu. -\`\`\` + Running the tests: ------------------ @@ -210,4 +218,4 @@ https://github.com/un33k/django-menuware .. |version-image| image:: https://img.shields.io/pypi/v/django-menu-generator.svg :target: https://pypi.python.org/pypi/django-menu-generator .. |coverage-image| image:: https://coveralls.io/repos/github/RADYConsultores/django-menu-generator/badge.svg?branch=master - :target: https://coveralls.io/github/RADYConsultores/django-menu-generator?branch=master + :target: https://coveralls.io/github/RADYConsultores/django-menu-generator?branch=master \ No newline at end of file