Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More
jinja
: Jinja printing¶
This document describes the lino.modlib.jinja
plugin
All code snippets on this page (lines starting with >>>
) are being
tested as part of our development workflow. The following
snippet initializes a demo project to use throughout this page.
>>> from lino import startup
>>> startup('lino_book.projects.min1.settings')
>>> from lino.api.doctest import *
Build methods¶
This module adds a build method for lino.modlib.printing
.
- class lino.modlib.jinja.JinjaBuildMethod¶
Inherits from
lino.modlib.printing.DjangoBuildMethod
.
Model mixins¶
- class lino.modlib.jinja.XMLMaker¶
Usage example in Lino and XML
- xml_file_name¶
The name of the XML file to generate. This file will be overwritten without asking. The name formatted with one name
self
in the context.
- xml_file_template¶
The name of a Jinja template to render for generating the XML content.
This must be either None or a
Path
object.
- xml_validator_file¶
The name of a “validator” to use for validating the XML content.
This must be either None or a
Path
object.Lino choose the validation method from the file’s suffix. It currently can handle suffixes “.xsd” and “.sch”.
- make_xml_file(ar)¶
django-admin commands¶
This plugin defines two django-admin
commands.
- showsettings¶
Print to stdout
all the Django settings that are active on this Lino
site.
Usage example:
>>> from atelier.sheller import Sheller
>>> shell = Sheller("lino_book/projects/min1")
>>> shell("python manage.py showsettings | grep EMAIL")
...
DEFAULT_FROM_EMAIL = webmaster@localhost
EMAIL_BACKEND = django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST = mail.example.com
EMAIL_HOST_PASSWORD =
EMAIL_HOST_USER =
EMAIL_PORT = 25
EMAIL_SSL_CERTFILE = None
EMAIL_SSL_KEYFILE = None
EMAIL_SUBJECT_PREFIX = [min1]
EMAIL_TIMEOUT = None
EMAIL_USE_LOCALTIME = False
EMAIL_USE_SSL = False
EMAIL_USE_TLS = False
SERVER_EMAIL = root@localhost
- status¶
Write a diagnostic status report about this Lino site.
A functional replacement for the diag
command.
>>> shell = Sheller("lino_book/projects/min1")
>>> shell("python manage.py status")
...
Plugins
=======
- lino : lino
- about : lino.modlib.about
- jinja : lino.modlib.jinja(needed by lino.modlib.bootstrap3)
- bootstrap3 : lino.modlib.bootstrap3(needed by lino.modlib.extjs, needs ['lino.modlib.jinja'])
- extjs : lino.modlib.extjs(needs ['lino.modlib.bootstrap3'])
- printing : lino.modlib.printing(needed by lino.modlib.system)
- system : lino.modlib.system(needs ['lino.modlib.printing'])
- users : lino.modlib.users(needs ['lino.modlib.system'])
- office : lino.modlib.office(needed by lino_xl.lib.countries)
- xl : lino_xl.lib.xl(needed by lino_xl.lib.countries)
- countries : lino_xl.lib.countries(needed by lino_xl.lib.contacts, needs ['lino.modlib.office', 'lino_xl.lib.xl'])
- contacts : lino_xl.lib.contacts(needs ['lino_xl.lib.countries', 'lino.modlib.system'])
- staticfiles : django.contrib.staticfiles
- sessions : django.contrib.sessions
Config directories
==================
- .../lino_xl/lib/contacts/config
- .../lino/modlib/users/config
- .../lino/modlib/printing/config
- .../lino/modlib/extjs/config
- .../lino/modlib/bootstrap3/config
- .../lino/modlib/jinja/config
- .../lino/config
The output may be
customized by overriding the jinja/status.jinja.rst
template.
- jinja/status.jinja.rst¶
The template file used by the status
command.