help : Make local help pages

The lino.modlib.help plugin adds functionality for loading extracted help texts at startup and optionally adding a Help button to all data views.

It defines no database models. It provides some startup hooks and the django-admin command makehelp.

See Help Texts for a topic overview.

This is a tested document. The following instructions are used for initialization:

>>> import lino
>>> lino.startup('lino_book.projects.apc.settings.demo')
>>> from django.utils import translation
>>> from lino.api.doctest import *
>>> from django.db.models import Q
>>> from atelier.sheller import Sheller
>>> shell = Sheller()

How to activate the help button

As a site maintainer you can activate the Help button by setting lino.modlib.help.Plugin.make_help_pages to True. You can do this in your settings.py file:

def get_plugin_configs(self):
    yield super(Site, self).get_plugin_configs()
    ...
    yield ('help', 'make_help_pages', True)

Having a Help button requires the site to generate local help pages. So when this is True, Lino's collectstatic command will automatically call makehelp as well.

The makehelp command

This plugin adds the following django-admin command.

makehelp

Generate the local help pages for this Lino site.

>>> shell("django-admin makehelp --help")
... 
usage: django-admin makehelp [-h] [-t TMPDIR] [-l LANGUAGE] [--version] [-v {0,1,2,3}]
                             [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color]
                             [--force-color] [--skip-checks]

Generate the local help pages for this Lino site.

optional arguments:
  -h, --help            show this help message and exit
  -t TMPDIR, --tmpdir TMPDIR
                        Path for temporary files.
  -l LANGUAGE, --language LANGUAGE
                        Generate only the specified language.
  --version             Show program's version number and exit.
  -v {0,1,2,3}, --verbosity {0,1,2,3}
                        Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very
                        verbose output
  --settings SETTINGS   The Python path to a settings module, e.g. "myproject.settings.main". If this
                        isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used.
  --pythonpath PYTHONPATH
                        A directory to add to the Python path, e.g. "/home/djangoprojects/myproject".
  --traceback           Raise on CommandError exceptions.
  --no-color            Don't colorize the command output.
  --force-color         Force colorization of the command output.
  --skip-checks         Skip system checks.