Using Appy POD templates

When a printable document (.pdf, .odt or .rtf) is being generated using a subclass of AppyBuildMethod, then you can provide a document as template in .odt format which you can edit using LibreOffice Writer.

This template document contains special instructions defined by the appy.pod library.

Context

The Appy renderer installs additional functions to be used in do text|section|table from statements.

lino_xl.lib.appypod.context.jinja(template_name)

Render the template named template_name using Jinja. The template is supposed to produce HTML markup.

I template_name contains no dot, then the default filename extension .body.html is added.

lino_xl.lib.appypod.context.restify(s)

Render a string s which contains reStructuredText markup. The string is first passed to lino.utils.restify.restify() to convert it to XHTML, then to appy.pod's built in xhtml function. Without this, users would have to write each time something like:

do text
from xhtml(restify(self.body).encode('utf-8'))
lino_xl.lib.appypod.context.html(html)

Render a string that is in HTML (not XHTML).

lino_xl.lib.appypod.context.ehtml(e)

Render an ElementTree node (generated using etgen.html) into this document. This is done by passing it to lino.utils.html2odf.

table(ar, column_names=None)`

Render an lino.core.tables.TableRequest as a table. Example:

do text
from table(ar.spawn('auth.UsersOverview'))