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.
This page contains code snippets (lines starting with >>>), which are
being tested during our development workflow. The following
snippet initializes the demo project used throughout this page.
>>> from lino_book.projects.noi2.startup import *
>>> from django.db.models import Q
>>> from atelier.sheller import Sheller
>>> shell = Sheller()
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 (bn)                       Remark (de)
---------------------- --------------- ---------------- --------------------------------- --------------------------------- ---------------------------------
 Site owner             Rumma & Ko OÜ   Erna Ärgerlich
 Server administrator   Van Achter NV
 Hotline                                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.
options:
  -h, --help            show this help message and exit
  -t..., --tmpdir TMPDIR
                        Path for temporary files.
  -l..., --language LANGUAGE
                        Generate only the specified language.
  --version             Show program's version number and exit.
  -v..., --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           Display a full stack trace on CommandError exceptions.
  --no-color            Don't colorize the command output.
  --force-color         Force colorization of the command output.
  --skip-checks         Skip system checks.
Remark: Above code snippets contains ellipses (”…”) because of #6283 (Doctest failures after Django upgrade).