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

publisher : render database content as styled html

The lino.modlib.publisher plugin deserves better documentation.

It doesn’t add any database model, but a choicelist, a model mixin and an action. It also adds a printing build method (lino.modlib.printing.BuildMethods).

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

>>> from lino import startup
>>> startup('lino_book.projects.cms1.settings')
>>> from lino.api.doctest import *


class lino.modlib.publisher.PublisherBuildMethod

This deserves better documentation.

class lino.modlib.publisher.Publishable

This deserves better documentation.

class lino.modlib.publisher.PreviewPublication

This deserves better documentation.



A tuple of 2-tuples (loc, cls) where loc is a location string and cls a data table.

>>> pprint(dd.plugins.publisher.locations)
(('b', lino_xl.lib.blogs.models.LatestEntries),
 ('p', lino_xl.lib.pages.ui.Pages),
 ('r', lino.modlib.uploads.models.Uploads),
 ('s', lino_xl.lib.sources.models.Sources),
 ('t', lino_xl.lib.topics.models.Topics),
 ('u', lino.modlib.users.ui.Users))

When setting this setting (usually in a get_plugin_configs() method), the application developer should specify the data tables using their names. The above locations have been set in lino_cms.lib.cms.settings as follows:

yield ('publisher', 'locations', (
    ('b', 'blogs.LatestEntries'),
    ('p', 'pages.Pages'),
    ('t', 'topics.Topics'),
    ('u', 'users.Users')))