Skip to main content

A reusable Django app that shows documentation for the view that is currently displayed. The documentation is written in Markdown and gets displayed in jQuery modals.

Project description

A Django application for showing user documentation on every page of your project.

It resolves the current URL and tries to load a Markdown file for the currently displayed view in a jQuery modal. The files simply need to be stored in your app’s /static/ folders.

Installation

Do this:

$ pip install django-online-docs

Add online_docs to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...,
    'online_docs',
)

Add jquery and jquery-ui and online_docs.js to your base.html:

<head>
    ...
    <link rel="stylesheet" href="{{ STATIC_URL }}css/libs/ui-lightness/jquery-ui-1.8.16.custom.css">
    ...
</head>
<body>
    ...
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="{{ STATIC_URL }}js/libs/jquery-1.7.0.min.js"><\/script>')</script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.19/jquery-ui.min.js"></script>
    <script>window.jQuery || document.write('<script src="{{ STATIC_URL }}js/libs/jquery-ui-1.8.19.min.js"><\/script>')</script>
    <script src="{{ STATIC_URL }}online_docs/js/online_docs.js"></script>
</body>

Add the link to open the docs to your base.html:

{% load online_docs_tags %}
...
<ul id="navigation">
    ...
    <li>{% render_docs_link request %}</li>
</ul>

If you don’t like the appearance of the docs link, you can override the template online_docs/online_docs_link.html.

Usage

Just place .md files in all your apps’ static folders. The names of the files should be of the format [namespace_]view_name (namespace is optional). Don’t forget to run ./manage.py collectstatic.

Roadmap

  • Try to run the markdown files through Django’s templating engine to provide i18n and url support.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-online-docs-0.1.tar.gz (6.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page