Framework Integration


Add plim.adapters.pyramid_renderer into the pyramid.includes list of your .ini configuration file

pyramid.includes =
    # ... (other packages)

The adapter will add the .plim renderer for use in Pyramid. This can be overridden and more may be added via the config.add_plim_renderer() directive:

config.add_plim_renderer('.plm', mako_settings_prefix='mako.')

The renderer will load its configuration from a provided mako prefix in the Pyramid settings dictionary. The default prefix is ‘mako.’.


The following code snippet would get Flask working with plim:

from flask import Flask
from flask.ext.mako import MakoTemplates, render_template
from plim import preprocessor

app = Flask(__name__)
mako = MakoTemplates(app)
app.config['MAKO_PREPROCESSOR'] = preprocessor

def hello():
    return render_template('hello.html', name='mako')

if __name__ == "__main__":

With hello.html in templates dir:

doctype html
    title hello ${name}
    p hello ${name}

Syntax Highlighters

At this moment, Plim doesn’t have syntax highlighters.

But, at a starting point you can use Slim syntax highlighters, since most of Plim syntax is the same as of Slim.

Editors support