Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

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 tables. See Help texts for a topic overview.

It defines some startup hooks and the django-admin command makehelp.

It also defines a database model for storing site contacts.

Lines starting with >>> in this document are code snippets that get tested as part of our development workflow.

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

The help button

The help button (?) is a button that opens a browser window on the local help pages.

As a server administrator you can activate the Help button by setting help.make_help_pages to True.

Having a Help button requires the site to generate local help pages. So when this is True, you should not forget to call makehelp to generate the help pages.

Site contacts

When help.use_contacts is set to True, the server administrator can edit a table of site contacts.

>>> rt.show(help.SiteContacts)
====================== =============== ==================== ================================= ================================= =================================
 Site contact type      Organization    Represented by       Remark                            Remark (de)                       Remark (fr)
---------------------- --------------- -------------------- --------------------------------- --------------------------------- ---------------------------------
 Site owner             Rumma & Ko OÜ   Mrs Erna Ärgerlich
 Server administrator   Van Achter NV
 Hotline                                Mrs Annette Arens    Mon and Fri from 11:30 to 12:00   Mon and Fri from 11:30 to 12:00   Mon and Fri from 11:30 to 12:00
====================== =============== ==================== ================================= ================================= =================================

The Site contact type field of a site contact points to the SiteContactTypes choicelist, which can be modified by the server administrator.

>>> rt.show(help.SiteContactTypes)
======= ============= ======================
 value   name          text
------- ------------- ----------------------
 100     owner         Site owner
 200     serveradmin   Server administrator
 300     siteadmin     Site administrator
 400     hotline       Hotline
======= ============= ======================

Configuration options

This plugin defines the following plugin settings:

help.make_help_pages

Whether to add a help button in every toolbar. See The help button.

help.use_contacts

Whether this Lino site has a table of site contacts.

See Site contacts below.

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.

option...s:
  -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.