Skip to content
forked from mbr/flask-nav

Easily create navigation for Flask applications.

License

Notifications You must be signed in to change notification settings

surkum/flask-nav

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask-Nav

Flask-Nav is a Flask-Extension to ease the creation of navigational Elements in Applications. It provides means to Express the Navigational structure and different ways to render these, making it easy to custom tailor it for your application.

A motivating example:

from flask import Flask
from flask_nav import Nav
from flask_nav.elements import *

nav = Nav()

# registers the "top" menubar
nav.register_element('top', Navbar(
    View('Widgits, Inc.', 'index'),
    View('Our Mission', 'about'),
    Subgroup(
        'Products',
        View('Wg240-Series', 'products', product='wg240'),
        View('Wg250-Series', 'products', product='wg250'),
        Separator(),
        Label('Discontinued Products'),
        View('Wg10X', 'products', product='wg10x'),
    ),
    Link('Tech Support', href='http://techsupport.invalid/widgits_inc'),
))


app = Flask(__name__)
# [...] (view definitions)

nav.init_app(app)

You can find a small, runnable example application inside the example folder. To run it, install Flask-Appconfig and execute:

$ flask --app=example dev

The full documentation can be found on PyPI.

About

Easily create navigation for Flask applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 95.4%
  • CSS 2.7%
  • HTML 1.9%