renderer.jinja2
— jinja2
renderer¶
This plugin is an abstract plugin: it cannot be directly used, but several plugins with common features inherit from it.
This page describes those common features.
Options¶
Here are the common options to any plugin that is a subclass of this one.
templatedirs
: Additionnal directories where templates are being searched. By default, the following directories are used:some directory containing the default templates of this plugin;
.evariste/templates
(relative to the directory of the setup file);~/.config/evariste/templates
;~/.evariste/templates
;/usr/share/evariste/templates
.
template
: The name of the template used to render the tree.
Template¶
The following template variables are defined:
destdir
: Destination directory.shared
:shared
data (seeevariste.builder.Builder.shared
).local
: Local reference to the shared data (seeevariste.shared.Shared.get_plugin_view()
).sourcepath
: Source path of the repository.render_file
: Function that renders thefile
given in argument (this functions uses the file renderers).render_readme
: Function that renders the README of a file (this functions uses the README renderers).render_template
: Function that renders the template given in argument.templatevar
: Dictionary of template variables (see Template variables).tree
: TheRoot
being rendered.
Template variables¶
It can be convenient to define template variables in the setup file (the htmlplus plugins uses this). A dictionnary templatevar
is available in the template, and contains the following items:
date
: Compilation date.time
: Compilation time.datetime
: Compilation date and time.aftertree
: A credit line (with the date and Évariste version, and a link to the Évariste website).
It also contains any option that has been defined in the setup file, in the renderer.{keyword}.templatevar
option (where keyword
is the keyword of the plugin).
[renderer.html.templatevar]
title = This is the value of the <em>title</em> jinja2 template variable.